Search code examples
azurerestazure-storageazure-filesazure-storage-files

Specifying filesystem attributes with Azure Storage REST API version >= 2019-02-02


I'm trying to use the Storage REST API to create a file in file storage. As of the 2019-02-02 API version, this requires specifying a number of filesystem parameters in the headers. Most of them I can figure out or use the defaults, but one has me stumped:

  • x-ms-file-attributes: Required. Version 2019-02-02 and newer. The file system attributes to be set on the file. See the list of available attributes.

The list of available attributes is just a table of Win32 filesystem attributes, which isn't very helpful in a http context.

enter image description here

The question is, how do I specify these attributes as part of a http[s] request? I've tried various header values like x-ms-file-attributes: Archive or x-ms-file-attributes: None, but without any luck.

InvalidHeaderValue
The value for one of the HTTP headers is not in the correct format.
RequestId:bf47ff6b-001a-0086-6358-0854b5000000
Time:2020-04-01T19:08:28.8394578Z
x-ms-file-attributes
archive

Solution

  • The x-ms-file-attributes: None or x-ms-file-attributes: Archive should work, and I test it with postman, it works:

    enter image description here

    If you're using code, please includes your code in the post so we can check it(do you use archive instead of Archive in code?). And I have tested this api(version 2019-02-02) with c#, no issues.