Delete restored files

Bert Coddens 0 Reputation points
2026-11-17T08:44:14.1133333+00:00

Problem summary

Unable to delete _restoreShare in Azure Files after a restore operation. The restore job completed 5 days ago, but the artifact remains and is still read-only.

Environment

Storage account: vanlaeckefiles

Resource ID: /subscriptions/c17b9cde-321d-45a9-8c42-ea74bf8817e6/resourceGroups/VanLaecke-RG-Storage/providers/Microsoft.Storage/storageAccounts/vanlaeckefiles

Subscription: Van Laecke Group - ESC CSP

Issue details

Attempts to delete _restoreShare from Storage browser fail with:

The specified resource is read-only and cannot be modified at this time.

An earlier related error also showed:

The specified directory is not empty.

Restore jobs are completed and are no longer running. The restore finished about 5 days ago, so this appears to be a stale restore artifact or backend lock that was not released.

Request IDs / timestamps

11835674-301a-002e-146b-76cfcd000000 — 2026-11-17T08:12:57.9468530Z

41a46ba3-101a-004b-6b6b-766189000000 — 2026-11-17T08:12:20.4445859Z

118330f3-301a-002e-406b-76cfcd000000 — 2026-11-17T08:10:20.2327270Z

37f3735c-b01a-0052-076b-76e132000000 — 2026-11-17T08:10:40.3591322Z

Requested help

Please investigate and clear the stale read-only state / restore lock on _restoreShare, or advise on the supported cleanup method.

Azure Storage Explorer
Azure Storage Explorer

An Azure tool that is used to manage cloud storage resources on Windows, macOS, and Linux.

0 comments No comments

1 answer

Sort by: Most helpful
  1. AI answer

    2026-11-17T08:46:37.56+00:00

    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:

    1. Replace <containing-share> with the actual Azure file share containing _restoreShare.
    2. Verify that this is the live share, not a Previous Versions/snapshot view.
    3. 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%"
    
    1. Retry deleting _restoreShare in Storage Browser.
    2. 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:

    1. Open the storage account.
    2. Select File shares → the containing share → Snapshots.
    3. Determine whether the object being viewed belongs to a dated snapshot rather than the live share.
    4. 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 ReadOnly or CanNotDelete lock affects management operations such as deleting the file share or changing account configuration. ^4^

    For whole-share deletion:

    1. Open Storage account → Settings → Locks.
    2. Check for AzureBackupProtectionLock, ReadOnly, or CanNotDelete.
    3. If _restoreShare is itself a backup-protected file share, open Recovery Services vault/Backup Center → Backup items → Azure File Share → Stop backup.
    4. Choose Retain backup data unless permanent removal of recovery points is explicitly intended. Delete backup data can permanently remove protected recovery data.
    5. 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:

    • _restoreShare is 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

    1. Manage file locks
    2. Use Azure Files Share Snapshots | Microsoft Learn
    3. Troubleshoot Azure Files backup - Azure Backup | Microsoft Learn
    4. Apply an Azure Resource Manager lock to a storage account
    5. How to delete a file share that's within a lock protected storage account? - Microsoft Q&A
    6. Troubleshoot Azure Files connectivity and access problems (SMB)
    7. Create an Azure support request
    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.