Azure Resource Group – Empty Resource Group Isn’t Really Empty!
The Problem
During a recent implementation of Azure Autoscale I encountered an error that made no sense whatever for what I was doing. There were two existing App Services Web apps configured to which I was activating Scale Out (App service plan). During the course of implementing and testing I had created a couple service plans with rules and deleted them with no issues or errors. Then I started receiving the error “An autoscale setting already exists for this resource.” I had deleted the existing service plans, generated new plans with Scale Out disabled, and then deploying the template that enabled the autoscale, configured the service plans and created two new rules. The template was now failing, giving me the above mentioned error.
The error did not make any sense to me, I had deleted the service plan files and there was nothing in the resource group except for the app service. The error was especially odd to receive when the autoscale service wasn’t even enabled. So why was it saying the autoscale setting already existed?
The Research
Researching online a single post was found where someone else was receiving the same error. They tried several different things with no result, so they finally deleted the resource group and started over. They recreated the resource group and that problem went away. So I gave this a try. I deleted my service app and service plans from the resource group. It was now empty, however when I went to delete the resource group it a window popped up showing six application settings files still in the resource group. I cancelled and went back to the resource group blade, and it showed the resource group as being empty. So I deleted the resource group and the rule settings files.
A new resource group was created and everything worked on the first past of generating the profile and the 2 rules settings files. But when the profile was deleted and recreated as was done in the first round, the error returned.
The Reveal
The issue was that when I deleted the service plan profile it did not delete the settings files that were created when you created the rules. In addition, the settings files were not visible when I looked at the contents of the resource group. So after recreating the rules settings using the same name that I had previously used I got the error: “An autoscale setting already exists for this resource.”
This appears to be a bug and has been reported to Microsoft. The settings files should be visible in the resource group.