How to fix Azure DevOps app service deployment always responding with 409 Conflict on first time trying to deploy

Kevin Utz 0 Reputation points
2023-06-16T16:42:00.7666667+00:00

Hello,

We have various build and release pipelines. The current issue involves a non-YAML release pipeline that deploys to an Azure Linux AppService.

We have ~8 of these pipelines and they're essentially identical. However, one of them continually has an issue.

With this pipeline, we encounter a 409 Conflict error on the first deployment every time. Subsequent deployments are successful.

I SSH'd into the AppService and noticed that after a successful deployment, the log files still show a "pending" deployment.

If I deploy a 2nd time, it works.

Has anyone else ran into this? Any advice for fixing?

Here is the exact error we got for the 409:

##[error]Error: Error: Failed to deploy web package to App Service. Conflict (CODE: 409)
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
39,315 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sina Salam 11,116 Reputation points
    2023-06-16T17:16:27.63+00:00

    @Kevin Utzy Welcome to Microsoft Q&A and thank you for posting your questions here. Apologize for the inconvenience cause on this.

    @Kevin UtzWelcome to Microsoft Q&A and thank you for posting your questions here.

    To understand your questions, you encountered a 409 Conflict error on the first deployment every time. Subsequent deployments are successful, and you were if anyone else ran into this? and if there is any advice for fixing?

    It is a common error and yes! Many people have encountered the same.

    Bing

    The error message "Failed to deploy web package to App Service. Conflict (CODE: 409)" is a common error that occurs when deploying an Azure web app . This error usually occurs when there is a conflict between the files that are being deployed and the files that are already present on the server . To resolve this issue, you can try the following steps:

    • Check that there is a variable 'WEBSITE_WEBDEPLOY_USE_SCM' set in Application settings of Azure App Service. If it does not exist add it. Make sure that it is set to true .
    • Check if there are any files in the target directory that are locked or in use by another process .
    • Try deleting all files from the target directory before deploying again .

    References:

    1. Microsoft Bing AI, https://stackoverflow.com/questions/59741421/azure-yaml-deployment-failing-with-error-failed-to-deploy-web-package-to-app-s by Sina Salam, June 16, 2023.
    2. Microsoft Bing AI, https://stackoverflow.com/questions/59057800/failed-to-deploy-web-package-to-app-service-on-azure-devops by Sina Salam, June 16, 2023.

    This type of question have been solved on Microsoft Q&A in the past, you can read more here. The link provides you with additional option to look into available diskspace and related blogs.

    I hope this helps you resolve your issue! If this answer solves your issue, please vote for it so other community members know that it is a useful answer. PS: Do not hesitate to let me know if you have any other questions.

    Best Regards,

    Sina


  2. Anonymous
    2023-06-16T17:48:26.86+00:00

    Devops / TFS is not currently supported here on Q&A. The product group for Azure DevOps / TFS actively monitors questions over at
    https://developercommunity.visualstudio.com/report?space=21&entry=problem
    https://developercommunity.visualstudio.com/report?space=22&entry=problem
    https://azure.microsoft.com/en-in/support/devops/

    --please don't forget to upvote and Accept as answer if the reply is helpful--


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.