Failed to update App Service plan

I was trying to scale down my Azure App Service Web App and got this error, also shown in Figure 1:

Failed to update App Service plan LG1-ASP-001: {“Code”:”Conflict”,”Message”:”The site(s) ‘LG1’ exceed maximum number of slots allowed for the hosting plan. Remove all deployment slots before scaling to a different mode.”,”Target”:null,”Details”:[{“Message”:”The site(s) ‘LG1’ exceed maximum number of slots allowed for the hosting plan. Remove all deployment slots before scaling to a different mode.”},{“Code”:”Conflict”},{“ErrorEntity”:{“Code”:”Conflict”,”Message”:”The site(s) ‘LG1’ exceed maximum number of slots allowed for the hosting plan. Remove all deployment slots before scaling to a different mode.”,”ExtendedCode”:”04054″,”MessageTemplate”:”The site(s) ‘{0}’ exceed maximum number of slots allowed for the hosting plan. Remove all deployment slots before scaling to a different mode.”,”Parameters”:[“LG1″],”InnerErrors”:null}}],”Innererror”:null}

image

Figure 1, Failed to update App Service plan

What this likely means is that 1 or more of the App Service in the App Service Plan (ASP), which I discuss some here, contains a configuration or feature which is not supported in the plan to which you are scaling to.  For example, take a look at the App Service Plan descriptions here.  Notice that ‘staging environments’ are only supported/allowed in either Standard or Premium mode.  If your App Service is currently in either Standard or Premium mode and you have a staging environment, when you attempt to scale down to Free, Shared or Basic, you will get this error.

The useful piece of information in the exception is the name of the App Service which is causing the exception.  You can then review that specific App Service and see which feature is enabled which is preventing the scale.  If there were more than 1 App Service preventing the scale, it would be shown as well.

I am certain the exception message is being worked on to make it easier to understand and act, however, until then, the above is at least a reason for this.  #HTH