Scenario:
if you want to cancel updating database pricing tier. this can be due to mistake, or long running scale Operation.
Resolution:
-
open Azure cloud shell or use your local Azure CLI installation.
- edit the following command with your database details and execute the script
- review the output to confirm operation has been canceled.
$ResourceGroupName = "" $ServerName = "" $DatabaseName = "" #---------------------------------------- $OperationName = (az sql db op list --resource-group $ResourceGroupName --server $ServerName --database $DatabaseName --query "[?state=='InProgress'].name" --out tsv) if(-not [string]::IsNullOrEmpty($OperationName)) { (az sql db op cancel --resource-group $ResourceGroupName --server $ServerName --database $DatabaseName --name $OperationName) "Operation " + $OperationName + " has been canceled" } else { "No in progress operation found" }
This post first appeared on MSDN Blogs | Get The Latest Information, Insights, Announcements, And News From Microsoft Experts And Developers In The MSDN Blogs., please read the originial post: here