I am using python SDK to lock a particular azure resource. Although I found documentation, I am getting exceptions as a resource not found while I am trying to lock the storage account.
As I am trying to store accounts in a Resource Grp, I'm using the below functionality.
I initiated Managementlockclient
and ResourceManagementClient
.
lockclient = ManagementLockClient( credential=credential,
subscription_id=subscriptionid
)
lockclient.management_locks.create_or_update_at_resource_level()
Apart from the above, is there any other way to lock all storage accounts in a resource group? I know we have a functionality to lock all resources in an RG using create_or_update_at_resource_group_level
but I only want to lock storage accounts. So I am using create_or_update_at_resource_level
.
Can anyone please help?
Response : <class 'azure.core.exceptions.ResourceNotFoundError'> occurred.