none
Unable to delete a file from Azure File Storage RRS feed

  • Question

  • I am trying to delete a file from my file storage. I am getting this error:
    Failed to delete file XXX. Error: The specified resource is read-only and cannot be modified at this time.
    Where can I change the properties so that i can delete it?
    Sunday, February 4, 2018 4:55 AM

Answers

  • Hi biconix,

    The only way we have to change the read-only attribute at this time is to mount the share over SMB, right click the file, and uncheck the "Read-only" attribute. It sounds bizarre, but the reason for this is that there is currently a discrepancy between what can be done with SMB (which fully supports Windows attributes and properties) and the File REST protocol, which does not. The Azure Portal interface makes all requests over the File REST protocol. You should get the same error message if you tried to delete a file with the read-only attribute set with the Azure RM PowerShell, Azure CLI, or any of our SDKs.

    We are working on making the File REST protocol a proper superset of SMB (can do everything SMB can do, plus the Azure specific things like create a share, set quota, etc), but I do not have a date to share yet regarding when this effort will be complete. At that time, it will be possible to set Windows attributes/properties, delete files, move them, etc with the File REST API (and consequently from the Azure Portal, PowerShell, CLI, SDKs, etc).

    Sorry for the inconvenience until then,

    Will Gries

    Program Manager, Azure Files

    Sunday, February 4, 2018 10:37 PM

All replies

  • Drive mappings to an Azure File share accessible from File Explorer provide full access on the storage account level - so this should certainly allow you to delete any file from the file share.

    You might want to check the status of the underlying storage account in the Azure portal

    hth
    Marcin

    • Proposed as answer by T_Vuorenmaa Sunday, February 4, 2018 12:56 PM
    • Unproposed as answer by T_Vuorenmaa Sunday, February 4, 2018 12:57 PM
    • Proposed as answer by T_Vuorenmaa Sunday, February 4, 2018 12:57 PM
    • Marked as answer by biconix Sunday, February 4, 2018 2:45 PM
    • Unmarked as answer by Md Shihab Monday, February 5, 2018 2:18 AM
    Sunday, February 4, 2018 11:59 AM
  • I had been using the desktop app (Microsoft Azure Storage) and the Azure portal to delete and upload files. with both of these methods i was encountering the problem

    when i created a file share (mapped directory) I was able to do everything.

    the interesting thing to also note is that my ISP (Comcast) blocks the file share port and i was not able to share the files. I needed to use a VPN/proxy to successfully accomplish this

    thanks

    m

    Sunday, February 4, 2018 2:45 PM
  • Hi biconix,

    The only way we have to change the read-only attribute at this time is to mount the share over SMB, right click the file, and uncheck the "Read-only" attribute. It sounds bizarre, but the reason for this is that there is currently a discrepancy between what can be done with SMB (which fully supports Windows attributes and properties) and the File REST protocol, which does not. The Azure Portal interface makes all requests over the File REST protocol. You should get the same error message if you tried to delete a file with the read-only attribute set with the Azure RM PowerShell, Azure CLI, or any of our SDKs.

    We are working on making the File REST protocol a proper superset of SMB (can do everything SMB can do, plus the Azure specific things like create a share, set quota, etc), but I do not have a date to share yet regarding when this effort will be complete. At that time, it will be possible to set Windows attributes/properties, delete files, move them, etc with the File REST API (and consequently from the Azure Portal, PowerShell, CLI, SDKs, etc).

    Sorry for the inconvenience until then,

    Will Gries

    Program Manager, Azure Files

    Sunday, February 4, 2018 10:37 PM