I'm trying to change the ResourceGroup for my Azure SQL Server (This includes one database I've added to this group and of course the master database). I created a new Azure Group and when I try switching the that group, I get a ResourceNotFound error.
The error displays the name of a database that I've been trying to deploy on the ResourceGroup I'm changing from, but it fails on deployment so there's no database of that name available.
This error occurs on the validation step and gives me this message:
{"code":"ResourceMoveFailed","message":"Could not get all the resources to be moved from the providers. Please see details for more information. Diagnostic information: timestamp '20190806T192716Z', subscription id '******', tracking id '*******', request correlation id '*******'.","details":[{"message":"Unable to get resource '/modules/AzureResourceManager/subscriptions/*******/resourcegroups/********/providers/Microsoft.Sql/servers/********/databases/{Undeployed_Database_Name}'. Status code 'NotFound'. Reason '{\"error\":{\"code\":\"ResourceNotFound\",\"message\":\"The requested resource of type 'Microsoft.Sql/servers/databases' with name '{Undeployed_Database_Name}' was not found.\"}}'."}]}
{Undeployed_Database_Name} pertains to the database name of the deployment that had failed. I'm assuming the deployment failure must have not completely rolled back during the error that had occurred, but I can't find this database ANYWHERE. Any help would be appreciated.
I figured out a way to resolve this issue, but it's not ideal for most situations. The problem seemed to come up by doing this:
I had created a free database (the 5 DTU 32 MB database). I tried to create another free database and it failed probably because you can't have more than one free database. This failed deployment ended up causing the issue I had.
I ended up deleting my SQL Server, which is where I was trying to host both of the free databases. Upon doing this I was able to create a new SQL Server with a basic database and a free database with no issues. I even named them the same name as the one I was trying to deploy before with no issues. I feel like this may have been a bug with how resources are handled when a deployment has failed, but I can't say for sure since I'm newer to Azure. Just wanted to give you all my solution, but I'd like to here if anyone else has had this issue and has solved it in a different way.