You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure Pipeline触发构建后Web应用未更新的问题排查求助

Azure Pipeline触发构建后Web应用未更新的问题排查求助

大家好,我碰到一个棘手的问题:我搭建了一条Azure Pipeline来部署Web应用,现在每次更新代码仓库后,Pipeline确实会触发构建流程,但Web应用始终没有同步更新。有没有大佬能帮忙分析下可能的原因?

下面是我用到的YAML配置文件:

# Docker

# Build and push an image to Azure Container Registry

trigger:
- main

resources:
- repo: self

variables:
# Container registry service connection established during pipeline creation
dockerRegistryServiceConnection: 'blah1'
imageRepository: 'blah2'
containerRegistry: 'blah3.azurecr.io'
dockerfilePath: '$(Build.SourcesDirectory)/Dockerfile'
tag: '$(Build.BuildId)'

# Agent VM image name
vmImageName: 'ubuntu-latest'

stages:
- stage: Build
  displayName: Build and push stage
  jobs:
  - job: Build
    displayName: Build
    pool:
      vmImage: $(vmImageName)
    steps:
    - task: Docker@2
      displayName: Build and push an image to container registry
      inputs:
        command: buildAndPush
        repository: $(imageRepository)
        dockerfile: $(dockerfilePath)
        containerRegistry: $(dockerRegistryServiceConnection)
        tags: |
          $(tag)

我自己先梳理了几个可能的排查方向,但还没定位到问题:

  • 是不是镜像推送成功了但Web应用没拉取新镜像?我去Azure容器注册表确认过,新镜像确实推上去了,但Web应用的配置里是不是没设置自动拉取?
  • Pipeline是不是只完成了构建和推送,漏掉了部署到Web应用的步骤?看我的YAML好像只有构建推送镜像的阶段,是不是缺了部署任务?
  • 有没有可能是镜像标签的问题?我用的是$(Build.BuildId)作为标签,每次构建标签都不一样,但Web应用是不是还在引用旧标签的镜像?
  • 会不会是网络或权限问题?比如Web应用有没有从容器注册表拉取镜像的权限?

有没有大佬能帮我再排查下,或者补充其他可能的原因?

备注:内容来源于stack exchange,提问作者frank

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.22 12:39:35