Hello @Anonymous ,
Thanks for your query !
Please try the below command ( I just tried from my end and it is working)
az lock list -g rgname --query "[?type=='Microsoft.Authorization/locks'].id" --output tsv | xargs -n 1 -t az lock delete --id
example output
az lock delete --id /subscriptions/subid/resourceGroups/akswithudr/providers/Microsoft.Authorization/locks/s1
az lock delete --id /subscriptions/subid/resourceGroups/akswithudr/providers/Microsoft.Authorization/locks/s2
az lock delete --id /subscriptions/subid/resourceGroups/akswithudr/providers/Microsoft.Authorization/locks/s3
Let us know if that helps !
Please make sure to "UpVote & Accept the answer" , so that it will help the community out there who are looking for similar queries
Regards,
Shiva