An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.
If _restoreShare is a directory in the live Azure file share, mount that share over SMB, remove its SMB read-only attribute, and then delete it; if it is a snapshot or remains read-only afterward, use the applicable backup-lock or Microsoft Support path below.
1. Clear the SMB read-only attribute
A read-only file or directory can reject FileREST write operations with ReadOnlyAttribute; the attribute must be removed through an SMB client rather than Storage Browser/REST. ^1^
On a Windows system that can mount the containing share:
- Replace
<containing-share>with the actual Azure file share containing_restoreShare. - Verify that this is the live share, not a Previous Versions/snapshot view.
- Open an elevated Command Prompt and inspect the directory before changing anything:
set "TARGET=\\vanlaeckefiles.file.core.windows.net\<containing-share>\_restoreShare"
dir /A /S "%TARGET%"
attrib "%TARGET%"
attrib -R "%TARGET%\*" /S /D
attrib -R "%TARGET%"
- Retry deleting
_restoreSharein Storage Browser. - If Storage Browser still reports that the directory is not empty, delete it over SMB only after confirming that none of the restored data is needed:
rmdir /S /Q "%TARGET%"
Warning: rmdir /S /Q permanently deletes the specified directory and all contents without confirmation. Verify the expanded path and copy any required restored files first.
2. Confirm that it is not a snapshot
Azure Files share snapshots are read-only point-in-time copies. They can be read, copied, or deleted, but their contents cannot be modified. A snapshot URI includes a sharesnapshot timestamp parameter. ^2^
In the portal:
- Open the storage account.
- Select File shares → the containing share → Snapshots.
- Determine whether the object being viewed belongs to a dated snapshot rather than the live share.
- If it is a snapshot, do not try to empty
_restoreShare. Delete the snapshot through Snapshots only if its recovery point is no longer required.
Deleting an Azure Backup-created snapshot can make its corresponding recovery point unusable, so do not delete it unless loss of that recovery point is approved. ^3^
3. Check management locks only if deleting the entire file share
An ARM lock and an SMB read-only attribute are different:
- An SMB attribute applies to files or directories and matches a data-plane read-only failure.
- A storage-account ARM
ReadOnlyorCanNotDeletelock affects management operations such as deleting the file share or changing account configuration. ^4^
For whole-share deletion:
- Open Storage account → Settings → Locks.
- Check for
AzureBackupProtectionLock,ReadOnly, orCanNotDelete. - If
_restoreShareis itself a backup-protected file share, open Recovery Services vault/Backup Center → Backup items → Azure File Share → Stop backup. - Choose Retain backup data unless permanent removal of recovery points is explicitly intended. Delete backup data can permanently remove protected recovery data.
- Remove the lock only after identifying its owner, delete the unneeded share, and restore the required protection afterward. Azure Backup can reapply service-managed locks or leases. ^5^ ^6^
The operator needs sufficient Azure RBAC permission for each action. Backup changes require an appropriate backup-management role, such as Backup Contributor or higher; lock and storage-resource deletion also require permission at the scope where those resources are defined. If the portal denies an operation, have the subscription or resource administrator perform it rather than attempting to bypass the service-managed protection.
Do not manually break an unidentified Azure Backup lease. Service-managed leases can protect backup operation integrity and may be reapplied.
4. Escalate a persistent service-side state
Because the restore jobs completed five days ago, escalate if all of these are true:
-
_restoreShareis confirmed to be in the live share. - Its SMB read-only attribute is absent or has been cleared.
- No relevant restore job remains active.
- No applicable ARM protection lock is blocking the attempted operation.
- Deletion still returns the same read-only error.
From the affected storage account, select Support + Troubleshooting → Create a support request. Include:
- Storage account and containing share name.
- Restore job ID, restore type, source, and destination.
- Completion timestamp.
- The four request IDs and UTC timestamps already captured.
- Exact error text and screenshots.
- Confirmation that the SMB attribute and ARM-lock checks were completed.
- Whether the failing operation is directory deletion or whole-share deletion.
Select Yes for advanced diagnostic information if permitted, so Azure Support can investigate the storage-side state and clear it if a stale service-managed lock is confirmed. ^7^
References
- Manage file locks
- Use Azure Files Share Snapshots | Microsoft Learn
- Troubleshoot Azure Files backup - Azure Backup | Microsoft Learn
- Apply an Azure Resource Manager lock to a storage account
- How to delete a file share that's within a lock protected storage account? - Microsoft Q&A
- Troubleshoot Azure Files connectivity and access problems (SMB)
- Create an Azure support request