An Azure backup service that provides built-in management at scale.
Azure Backup applies a delete lock (AzureBackupProtectionLock) on the storage account to prevent accidental deletion of the account and any file shares in it. Because of this lock, deleting the test file share directly is blocked.
To delete the unneeded file share, use one of these approaches:
- Remove or change the storage account lock
- Go to the storage account in the Azure portal.
- Open Locks.
- Either remove the AzureBackupProtectionLock or change it from a delete lock to a read lock (if currently a modify/delete lock), depending on what is configured.
- After the delete restriction is removed, delete the file share (for example, via File shares → select share → Delete share, or using
Remove-AzRmStorageShare/az storage share-rm delete). - Be aware that removing or loosening the lock temporarily exposes the storage account and all file shares to possible accidental deletion.
- Remove locks/leases created by value-added services
- Azure Backup and other services may also place share leases or additional locks on specific file shares or snapshots.
- Follow the guidance in the Azure Files troubleshooting article to remove resource locks and leases that block modification or deletion of the share. This may involve running the provided PowerShell script that removes all resource locks and leases on the storage account and its file shares.
- After locks/leases are removed, delete the test file share.
Note: Removing locks or leases that Azure Backup uses can affect backup and restore operations and may allow deletion of protected shares or snapshots. Review backup requirements before permanently changing locks.
References: