Web App deployment failed "The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'."

Allan Chong 5 Reputation points
2023-06-26T23:02:08.2666667+00:00

When deploying a github repo from an external account, the web app deployment fails at Microsoft.web/sites/sourcecontrols with error code:"ResourceDeploymentFailure" and error message:"The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed'."

Even after disconnecting and reconnecting the github, the Web App's Deployment Center still states it hasn't deployed yet and receives the error "Request failed with status code: 401 under 'Fetching changes' activity".

Any help on this is much appreciated, thank you.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,128 questions
{count} vote

1 answer

Sort by: Most helpful
  1. ajkuma 27,941 Reputation points Microsoft Employee
    2023-06-27T19:57:15.73+00:00

    @Allan Chong , Thanks for posting this question.

    Firstly, apologies you're experiencing this issue.

    Based on my understanding of your issue description- The error message "The resource write operation failed to complete successfully, because it reached terminal provisioning state 'Failed', typically indicates that there was an issue with the deployment process. This error can occur due to a variety of reasons, including issues with the GitHub repository, issues with the Azure Web App, or issues with the deployment process itself.

    The error message "Request failed with status code: 401 under 'Fetching changes' activity" indicates that there was an authentication issue when fetching changes from the GitHub repository. This error can occur if the credentials used to authenticate with the GitHub repository are incorrect or have expired.

    To isolate the issue, you may try the following steps:

    1.Verify the GitHub repo ( that you shared) to ensure that it is accessible and that the credentials used to authenticate with the repository are correct.

    1. Check the Azure Web App to ensure that it is properly configured and that there are no issues with the deployment process.

    Additionally,

    1. (If you haven't tried this already) - Try disconnecting and reconnecting the GitHub repository to the Azure Web App to see if this resolves the issue.
    2. Review the deployment logs for the Azure Web App to see if there are any errors or issues that could be causing the deployment to fail.

    Checkout the log directory/location info- Access log files -Enable and review logs to fetch more details about the error.

    https://learn.microsoft.com/azure/app-service/troubleshoot-diagnostic-logs#access-log-files

    Kindly let us know how it goes, I'll follow-up with you further.


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.