Yauhen
Yauhen

Reputation: 11

Azure Web App Deployment Logs Show Incorrect Link to Azure DevOps Pipeline

I’m experiencing an issue with the deployment logs in Azure Web Apps. The deployment itself works fine, but when I navigate to the Deployment Center in the Azure Portal and click on the link to the Azure DevOps pipeline (to review the build or deployment details), I get a 404 error.

Here are the details of the setup:

Deployment Type:

I'm using a single YAML pipeline in Azure DevOps for both build and release. The deployment tasks include building the app and deploying it directly to the Azure Web App.

Observations:

For apps where I use separate build and release pipelines, the link in the deployment logs works correctly and redirects to the appropriate pipeline. For apps where I deploy using a single YAML pipeline, the link in the deployment logs is incorrect and leads to a "Page not found" error in Azure DevOps.

Here’s a simplified version of the deployment step in my YAML pipeline:

parameters:
  path_to_project: ''  
  net_version: ''
  artifact_name: ''  
  azure_subscription: ''

steps:  

- task: UseDotNet@2
  condition: ne('${{ parameters.net_version }}', 'globalJson')
  inputs:
    version: '${{ parameters.net_version }}'

- task: NuGetAuthenticate@1
  displayName: 'Authenticate to NuGet'

- task: DotNetCoreCLI@2
  displayName: 'Build'
  inputs:
    command: 'build'
    projects: '${{ parameters.path_to_project }}'
    arguments: ''

- task: DotNetCoreCLI@2
  displayName: 'Publish'
  inputs:
    command: 'publish'
    projects: '${{ parameters.path_to_project }}'
    publishWebProjects: false
    arguments: '--output $(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
  displayName: 'Publish Artifact'
  inputs:
    PathtoPublish: '$(Build.ArtifactStagingDirectory)'
    ArtifactName: '${{ parameters.artifact_name }}'

- task: DownloadBuildArtifacts@0
  displayName: 'Download Artifact'
  inputs:
    artifactName: ${{ parameters.artifact_name }}
    downloadPath: '$(System.ArtifactsDirectory)/${{ parameters.artifact_name }}'

- task: AzureWebApp@1
  inputs:
    azureSubscription: ${{ parameters.azure_subscription }} 
    appType: webApp
    appName: ${{ parameters.app_name }}
    package: '$(System.ArtifactsDirectory)/**/*.zip' 
    deploymentMethod: 'auto'

enter image description here enter image description here

Upvotes: 0

Views: 56

Answers (1)

Ziyang Liu-MSFT
Ziyang Liu-MSFT

Reputation: 5331

I can reproduce the same issue. It seems like a bug in Azure Web app.

When deploying using one YAML pipeline, the link of the build is https://dev.azure.com/{Org}/{Project}/_git/{RepoName}/%7B1%7D/_build?buildId={buildId}&_a=summary. This URL is wrong. It has git in the path, which results in a 404 error.

When deploying using Build and classic release, the link of the build is https://dev.azure.com/{Org}/{Project}/_build?buildId={buildId}&_a=summary, which is correct.

As a workaround, you can copy the link of the build, remove the path related to the git from it and then redirect to the Azure pipeline.

enter image description here

Besides, you can report this issue to Azure App Service team for further investigation and fix.

Upvotes: 0

Related Questions