‘code’:’DeploymentFailed’ + Azure Static Web Application + Angular + Azure DevOps + deployment error troubleshooting

Balram Chavan
2 min readDec 7, 2022

Recently, I came across a very weird error while deploying an Angular application to Azure Static Web application service.

The Azure Static Web App service is a go-to-solution for deploying Single Page Applications in Azure. It provides built-in support for Angular, React, Vue etc. I will write a separate story about how to deploy an Angular application in Azure Static Web App.

So, I had two Angular applications ready, and code checked in Azure DevOps. There are two branches develop and main for QA and Production environments. I followed the steps to deploy my first application, and it worked smoothly. I was super happy to see how quick and easy it was.

Then I turned to my second Angular application, and started deployment of a Static Web App, where all went wrong. Even though all information was provided correctly, I used to get below error message without anything specific details why it's failing.

'code': 'DeploymentFailed',
'message': 'At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/DeployOperations for usage details.',
'details': [
'code': 'InternalServerError',
'message': 'There was an unexpected InternalServerError. Please try again later. x-ms-correlation-request-id: 7ec8e396-fa93–4541-b5a3–2788131eabe2'

As you can see, there were no pointers to follow why deployment was failing. I kept retrying by choosing different branch, region etc. But no luck, it kept failing with same error.

I opened a support ticket with Microsoft, and they responded with detailed template response asking all details, screenshots, timestamp when it happened etc. Before I responded to them, I wanted to understand why it's working for one repository and not for another.

After checking all settings in Azure DevOps for both of those repositories, I found out that the second repository had Branch Policies setup which required minimum number of reviews and direct commit to develop branch was not allowed.

This make sense, as Azure Static Web App tries to create a new commit when we set up a service for CI.

I disabled these settings, and retried, and boom… it worked! The Static Web App got successfully created and deployed.

It was quite an interesting troubleshooting experience, and I hope this story can help someone to save that amount of time.