Open smokedlinq opened 1 year ago
@zhoxing-ms for awareness
@smokedlinq Could you please send the debug log (add --debug
parameter`) to me by email? My email address is Zhou.Xing@microsoft.com, thanks~
@zhoxing-ms sent, let me know if you need anything else.
Sorry, I can't reproduce your problem. And I see that the REST service has returned the status code 204
after the deletion.
This issue needs to be investigated by ARM service team, so I transfer this issue to them.
'x-ms-correlation-request-id': 'fd38435c-e8b6-4680-9be5-5c2633f15c7b'
@zhoxing-ms Thanks for looking, if it'd help if I opened a support ticket let me know. For now, I have a viable workaround but it definitely seems like an issue that should be looked into so I'll leave this issue open.
I am using version 2.52.0 and this one does require that you set the subscription context yourself first.
E.g. when subscription context is set to Subscription A and you submit the following cli command:
az lock delete --ids /subscriptions/subscription-b/resourcegroups/rg-storageaccounts/providers/microsoft.storage/storageAccounts/mystorageaccount/providers/Microsoft.Authorization/locks/AzureBackupProtectionLock --debug
It results in the following error:
Unexpected --resource-group for lock AzureBackupProtectionLock, expected rg-resourcegroup
Apparently the cli also has some awareness of the last resource group it was targeting, not sure.
As soon as I switch the context to the target subscription, the command is able to remove the lock.
E.g.
az account set --subscription subscription-a
az lock delete --ids /subscriptions/subscription-b/resourcegroups/rg-storageaccounts/providers/microsoft.storage/storageAccounts/mystorageaccount/providers/Microsoft.Authorization/locks/AzureBackupProtectionLock --debug
Runs successful.
Ideally the az lock delete command with the --ids
switch is not dependant on the current subscription context.
Do you recommend me to open up a separate issue for my experience?
Describe the bug
When running the
az lock delete
command with the--ids
parameter, it completes successfully but does not delete the lock. Workaround is to use theaz resource delete
command.Command Name
az lock delete
To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.
az lock delete --ids {}
Expected Behavior
The lock resource is deleted
Environment Summary
Additional Context