Set Share Metadata
Set Share Metadata operation sets one or more user-defined name/value pairs for the specified share. Although this operation is fully supported, it's a legacy management operation. We recommend that you use the File Shares - Update operation provided by the storage resource provider (Microsoft.Storage) instead. To learn more about programmatically interacting with
FileShare resources by using the storage resource provider, see Operations on FileShare resources.
|Enabled file share protocol||Available|
You construct the
Set Share Metadata request as follows. We recommend HTTPS. Replace myaccount with the name of your storage account.
|Method||Request URI||HTTP version|
Replace the path components shown in the request URI with your own, as follows:
||The name of your storage account.|
||The name of your file share.|
For details on path naming restrictions, see Naming and referencing shares, directories, files, and metadata.
You can specify the following additional parameters on the request URI:
||Optional. Expressed in seconds. For more information, see Set timeouts for Azure Files operations.|
The following table describes required and optional request headers:
||Required. Specifies the authorization scheme, account name, and signature. For more information, see Authorize requests to Azure Storage.|
||Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authorize requests to Azure Storage.|
||Required for all authorized requests. Specifies the version of the operation to use for this request. For more information, see Versioning for the Azure Storage services.|
||Optional. Provides a name/value pair to contain metadata for the share.
Each call to this operation replaces all existing metadata attached to the share. To remove all metadata from the share, call this operation with no metadata headers.
Metadata names must adhere to the naming rules for C# identifiers.
||Optional. Provides a client-generated, opaque value with a 1-kibibyte (KiB) character limit that's recorded in the Storage Analytics logs when logging is configured. We highly recommend that you use this header to correlate client-side activities with requests that the server receives. For more information, see Monitor Azure Blob Storage.|
||Required if the destination file share has an active lease. Available for version 2020-02-10 and later. If the request doesn't include the lease ID or it isn't valid, the operation fails with status code 412 (Precondition Failed).
If this header is specified and the destination file share doesn't currently have an active lease, the operation fails with status code 412 (Precondition Failed).
PUT https://myaccount.file.core.windows.net/myshare?restype=share&comp=metadata HTTP/1.1 Request Headers: x-ms-version: 2014-02-14 x-ms-date: Mon, 27 Jan 2014 22:50:32 GMT x-ms-meta-Category: Images Authorization: SharedKey myaccount:Z5043vY9MesKNh0PNtksNc9nbXSSqGHueE00JdjidOQ=
The response includes an HTTP status code and a set of response headers.
A successful operation returns status code 200 (OK).
For information about status codes, see Status and error codes.
The response for this operation includes the following headers. The response might also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.
||Returns the date and time that the share was last modified. The date format follows RFC 1123. For more information, see Representation of date/time values in headers. Any operation that modifies the share or its properties updates the last modified time. Operations on files don't affect the last modified time of the share.|
||Contains a value that represents the version of the share, in quotation marks.|
||Uniquely identifies the request that was made. You can use it to troubleshoot the request. For more information, see Troubleshoot API operations.|
||Indicates the version of Azure Files that was used to execute the request.|
||A UTC date/time value that indicates the time at which the service sent the response.|
||Can be used to troubleshoot requests and corresponding responses. The value of this header is equal to the value of the
Only the account owner can call this operation.
Set Share Metadata overwrites all existing metadata that's associated with the share. It's not possible to modify an individual name/value pair.
You can also set metadata for a share at the time that it's created, as part of the Create Share operation.
Set Share Metadata updates the
Last-Modified-Time properties for the share.
Set Share Metadata is not supported for a share snapshot. An attempt to perform this operation on a share snapshot will fail with status code 400 (InvalidQueryParameterValue). You can set metadata for a share snapshot at the time that it's created, as part of the
Snapshot Share operation.