0
votes

While Copy a production database locally with AZ CLI it has been copied successfully. But when I am integrating it into the Azure DevOps I am getting the ERROR : The Resource 'Microsoft.Sql/servers/mi-tools/databases/ABC' under resource group 'xyz' was not found.

Here is the code that I need to execute in my Pipeline.

az sql db copy --subscription $(SubscriptionName) --dest-server $(ServerName) --name $(ProductionDatabaseName) --dest-name $(CopyDatabaseName) --resource-group $(ResourceGroupName) --server $(ServerName) -f Gen5 -c 4 --compute-model Serverless

1
wrong context, probably, so you need to use proper subscription4c74356b41
I have used the proper subscription and also I get the solution thank you.Sonu Shaw

1 Answers

0
votes

While deleting a database through the Azure DevOps pipeline it will take some time to delete. And my next line copied the database So it will execute immediately and the database not completely deleted.

You have to do it within two-step in Azure DeOps.