azure-pipelines-tasks: [BUG]: 404 Failed to deploy web package to App Service (Linux)

Task name

AzureRmWebAppDeployment

Task version

4

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

Windows

Task log

##[debug][POST]https://$contoso-project-int-ase-front:***@contoso-project-int-ase-front.scm.azurewebsites.net/api/zipdeploy?isAsync=true&deployer=VSTS_ZIP_DEPLOY&message=%7B%22type%22%3A%22deployment%22%2C%22commitId%22%3A%22ca18ed0cf5370f2079a1256627325eb63b909842%22%2C%22buildId%22%3A%226477%22%2C%22buildNumber%22%3A%22Extranet_release-v1.1.7_2023.08.01.3%22%2C%22repoProvider%22%3A%22TfsGit%22%2C%22repoName%22%3A%22contoso-Extranet%22%2C%22collectionUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F%22%2C%22teamProject%22%3A%220d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22buildProjectUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F0d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22repositoryUrl%22%3A%22https%3A%2F%2Fcompany-unit%40dev.azure.com%2Fcompany-unit%2Fcontoso-Extranet%2F_git%2Fcontoso-Extranet%22%2C%22branch%22%3A%22release-v1.1.7%22%2C%22teamProjectName%22%3A%22contoso-Extranet%22%2C%22slotName%22%3A%22production%22%7D
##[debug]ZIP Deploy response: {"statusCode":202,"statusMessage":"Accepted","headers":{"content-length":"0","connection":"close","date":"Tue, 01 Aug 2023 08:08:46 GMT","server":"Kestrel","location":"https://contoso-project-int-ase-front.scm.azurewebsites.net:443/api/zipdeploy?isAsync=true&deployer=VSTS_ZIP_DEPLOY&message=%7B%22type%22%3A%22deployment%22%2C%22commitId%22%3A%22ca18ed0cf5370f2079a1256627325eb63b909842%22%2C%22buildId%22%3A%226477%22%2C%22buildNumber%22%3A%22Extranet_release-v1.1.7_2023.08.01.3%22%2C%22repoProvider%22%3A%22TfsGit%22%2C%22repoName%22%3A%22contoso-Extranet%22%2C%22collectionUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F%22%2C%22teamProject%22%3A%220d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22buildProjectUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F0d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22repositoryUrl%22%3A%22https%3A%2F%2Fcompany-unit%40dev.azure.com%2Fcompany-unit%2Fcontoso-Extranet%2F_git%2Fcontoso-Extranet%22%2C%22branch%22%3A%22release-v1.1.7%22%2C%22teamProjectName%22%3A%22contoso-Extranet%22%2C%22slotName%22%3A%22production%22%7D/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2023-08-01_08-08-46Z","scm-deployment-id":"a075012a-fa1d-4691-9f2e-c7f5555b1eba","retryafter":"30"}}
##[debug]Polling for ZIP Deploy URL: https://contoso-project-int-ase-front.scm.azurewebsites.net:443/api/zipdeploy?isAsync=true&deployer=VSTS_ZIP_DEPLOY&message=%7B%22type%22%3A%22deployment%22%2C%22commitId%22%3A%22ca18ed0cf5370f2079a1256627325eb63b909842%22%2C%22buildId%22%3A%226477%22%2C%22buildNumber%22%3A%22Extranet_release-v1.1.7_2023.08.01.3%22%2C%22repoProvider%22%3A%22TfsGit%22%2C%22repoName%22%3A%22contoso-Extranet%22%2C%22collectionUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F%22%2C%22teamProject%22%3A%220d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22buildProjectUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F0d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22repositoryUrl%22%3A%22https%3A%2F%2Fcompany-unit%40dev.azure.com%2Fcompany-unit%2Fcontoso-Extranet%2F_git%2Fcontoso-Extranet%22%2C%22branch%22%3A%22release-v1.1.7%22%2C%22teamProjectName%22%3A%22contoso-Extranet%22%2C%22slotName%22%3A%22production%22%7D/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2023-08-01_08-08-46Z
##[debug]setting affinity cookie 
##[debug]CLIENT_RESETSTREAMONRETRY=undefined
##[debug][GET]https://contoso-project-int-ase-front.scm.azurewebsites.net:443/api/zipdeploy?isAsync=true&deployer=VSTS_ZIP_DEPLOY&message=%7B%22type%22%3A%22deployment%22%2C%22commitId%22%3A%22ca18ed0cf5370f2079a1256627325eb63b909842%22%2C%22buildId%22%3A%226477%22%2C%22buildNumber%22%3A%22Extranet_release-v1.1.7_2023.08.01.3%22%2C%22repoProvider%22%3A%22TfsGit%22%2C%22repoName%22%3A%22contoso-Extranet%22%2C%22collectionUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F%22%2C%22teamProject%22%3A%220d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22buildProjectUrl%22%3A%22https%3A%2F%2Fdev.azure.com%2Fcompany-unit%2F0d311dd0-de9f-4189-b738-60f14ef6869d%22%2C%22repositoryUrl%22%3A%22https%3A%2F%2Fcompany-unit%40dev.azure.com%2Fcompany-unit%2Fcontoso-Extranet%2F_git%2Fcontoso-Extranet%22%2C%22branch%22%3A%22release-v1.1.7%22%2C%22teamProjectName%22%3A%22contoso-Extranet%22%2C%22slotName%22%3A%22production%22%7D/api/deployments/latest?deployer=VSTS_ZIP_DEPLOY&time=2023-08-01_08-08-46Z
##[debug]Could not parse response: {}
##[debug]Response: undefined
##[error]Failed to deploy web package to App Service.
##[debug]Processed: ##vso[task.issue type=error;]Failed to deploy web package to App Service.
##[debug]Deployment Failed with Error: Error: Error: Failed to deploy web package to App Service. Not Found (CODE: 404)
##[debug]task result: Failed
##[error]Error: Error: Failed to deploy web package to App Service. Not Found (CODE: 404)

....

##[debug][PUT]https://$contoso-project-int-ase-front:***@contoso-project-int-ase-front.scm.azurewebsites.net/api/deployments/64771690877327941
##[debug]Could not parse response: {}
##[debug]Response: undefined
##[debug]updateDeployment. Data: {"statusCode":409,"statusMessage":"Conflict","headers":{"connection":"close","content-type":"text/plain; charset=utf-8","date":"Tue, 01 Aug 2023 08:08:47 GMT","server":"Kestrel","transfer-encoding":"chunked"},"body":"The 'Performing deployment' operation conflicts with the pending 'Deployment' operation started at 08/01/2023 08:08:46.  Please retry operation later."}
##[warning]Error: Failed to update deployment history. Error: Conflict (CODE: 409)

Relevant log output

##[error]Failed to deploy web package to App Service.
##[error]Error: Error: Failed to deploy web package to App Service. Not Found (CODE: 404)

...

##[warning]Error: Failed to update deployment history. Error: Conflict (CODE: 409)

Aditional info

The deployment actually works and is visible in the deployment log. 
However the task fails with this 404 error. It looks like the polling for deployment status is failing

This error appeared suddenly across environments. (Across different App plan instances/SKU)

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 8
  • Comments: 26 (3 by maintainers)

Most upvoted comments

Hello @jammyzt,

Just did a test run and it seems to be working correctly for an app that was consistently failing until then. I’m leaving the issue open in case this has not been fixed for everyone.

Same issue:

Run azure/webapps-deploy@v1
Package deployment using ZIP Deploy initiated.
Error: Failed to deploy web package to App Service.
Error: Deployment Failed with Error: Error: Failed to deploy web package to App Service.
Not Found (CODE: 404)
Error: Error: Failed to deploy web package to App Service.
Not Found (CODE: 404)

same error for me too

Same thing here - except we’re using AzureWebApp - same errors though, so wonder if there is something underlying supporting these

@jammyzt so what helped? this tip: “deleted the app service and recreated a new one and it fixed the issue”?

No change on our side. Our app services were always destroyed every night and recreated in the morning.

We suddenly saw the issues on Tuesday morning and they continued until yesterday. This morning, everything is working after no change on our side.

We have an open support ticket with our friends at Microsoft but have had no response beyond acknowledgement of the ticket. I suspect something has been fixed on their side.

@jammyzt so what helped? this tip: “deleted the app service and recreated a new one and it fixed the issue”?

Deploy WebApp to Azure 1 Run azure/webapps-deploy@v2 11 Package deployment using ZIP Deploy initiated. 12 Error: Failed to deploy web package to App Service 13 Error: Deployment Failed, Erro: Failed to deploy web package to App Service. 14 Not Found (CODE: 404) 15 App Service Application URL: http://<removed>

problems started from 2023.08.01 it was all fine for 2 years.

We had the exact same issue. He deleted the app service and recreated a new one and it fixed the issue.

Hello @leivavictor and @vivelys.

The task is still usable (kind of) , as this is only the polling for deployment status that fails, deployment is actually launched. So if you don’t have any task that depends directly on the deployment in your pipeline you can simply set the task to continue on error for now.

By the way, this problem did not appear in another similar project.

Hi Eazyed and leivavictor, I’m facing the same problem. The deployment appears to have failed, but when I look in my web app log, the correct version is deployed. However, as the deployment appears to have failed, my pipeline stops.

Same here. My deployments used to work, and they don’t anymore since yesterday : Deployment Failed, Error: Failed to deploy web package to App Service. Site Not Found (CODE: 404)

The delete/recreate app service trick doesn’t work for me either

No change here just now despite deleting & recreating both app service (including additional slot) and app service plan - still fails 😦

The “delete/recreate” tip did the trick for me. The web app slots where I didn’t apply this workaround still reply the deployment failed

Hello all! I’ve just reached the office and all 30 linux function apps have deployed correctly!

There was the odd hiccup on two of them but they immediately retried and successfully deployed.

@Eazyed How are things for you today? 😃

We deploy our app services in dev via bicep each morning and release the code via ado. They’re torn down each night. This has worked beautifully for a few months and started failing on Tuesday.

We had the exact same issue. He deleted the app service and recreated a new one and it fixed the issue

Unfortunately, we’re not having this joy. Our brand new Functions on brand new ASPs are “failing” to deploy. Same story as others, the function does deploy but ado thinks it has failed

Hello @Eazyed , I’ve exactly the same issue in one of my app service deployment, so I’ll watch if a resolution will be found here.

Hi Eazyed, I am facing the same issue. In my case I also redeployed an environment and it worked just for 3 deployments but now it came back to the same behavior.