Jaa


Set Share Properties

The Set Share Properties operation sets properties for the specified Azure file 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.

Protocol availability

Enabled file share protocol Available
SMB Yes
NFS Yes

Request

You can construct the Set Share Properties request as follows. We recommend HTTPS. Replace myaccount with the name of your storage account.

Method Request URI HTTP version
PUT https://myaccount.file.core.windows.net/myshare?restype=share&comp=properties HTTP/1.1

Replace the path components shown in the request URI with your own, as follows:

Path component Description
myaccount The name of your storage account.
myshare The name of your file share.

For details on path naming restrictions, see Naming and referencing shares, directories, files, and metadata.

URI parameters

You can specify the following additional parameters in the request URI:

Parameter Description
timeout Optional. Expressed in seconds. For more information, see Set timeouts for Azure Files operations.

Request headers

The following table describes required and optional request headers:

Request header Description
Authorization Required. Specifies the authorization scheme, account name, and signature. For more information, see Authorize requests to Azure Storage.
Date or x-ms-date Required. Specifies the Coordinated Universal Time (UTC) for the request. For more information, see Authorize requests to Azure Storage.
x-ms-version 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.
x-ms-share-quota Optional. Supported in version 2015-02-21 and later. Specifies the maximum size of the share, in gibibytes (GiB).
x-ms-share-provisioned-iops Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. If specified, updates the provisioned IOPS of the share to the specified value. If not specified, the provisioned IOPS of the share is unchanged.
x-ms-share-provisioned-bandwidth-mibps Optional. Supported in version 2025-01-05 and later. Only allowed for provisioned v2 file shares. If specified, updates the provisioned bandwidth of the share to the specified value, in mebibytes per second (MiBps). If not specified, the provisioned bandwidth of the share is unchanged.
x-ms-access-tier Optional. Supported in version 2019-12-12 and later. Specifies the access tier of the share. Valid values are TransactionOptimized, Hot, and Cool. For detailed information about file share tiering, see Azure Files storage tiers.
x-ms-root-squash: <NoRootSquash \| RootSquash \| AllSquash> Optional. Supported in version 2020-02-10 and later. Specifies the root squashing behavior on the share when NFS is enabled.
  • NoRootSquash: Turn off root squashing.
  • RootSquash: Map requests from UID/GID 0 to the anonymous UID/GID.
  • AllSquash: Map all UIDs and GIDs to the anonymous user.
x-ms-enable-snapshot-virtual-directory-access: <true \| false> Optional. Supported in version 2024-08-04 and later. Specifies whether the snapshot virtual directory should be accessible at the root of share mount point when NFS is enabled.
x-ms-client-request-id 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.
x-ms-lease-id:<ID> 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).
x-ms-share-paid-bursting-enabled: <true \| false> Optional. Supported in version 2024-11-04 and later. Only allowed for provisioned v1 premium file shares. This property can be used to enable or disable paid bursting. If the property is not specified, the share will retain its existing paid bursting enablement status.
x-ms-share-paid-bursting-max-iops Optional. Supported in version 2024-11-04 and later. Only allowed for provisioned v1 premium file shares. An integer representing the maximum paid bursting input/output operations per second (IOPS) allowed for the share.

If paid bursting is not already enabled on the share: The behavior is identical to the x-ms-share-paid-bursting-max-iops header in Create Share. The default if not specified is the maximum allowed IOPS for a share. If this header is set, x-ms-share-paid-bursting-enabled must also be set to true.

If paid bursting is already enabled on the share: x-ms-share-paid-bursting-max-iops can be used to update the maximum paid bursting IOPS for the share. x-ms-share-paid-bursting-enabled does not need to be set in this case. If x-ms-share-paid-bursting-enabled is set to true but x-ms-share-paid-bursting-max-iops is not set, the maximum paid bursting IOPS will remain unchanged.
x-ms-share-paid-bursting-max-bandwidth-mibps Optional. Supported in version 2024-11-04 and later. Only allowed for provisioned v1 premium file shares. An integer representing the maximum paid bursting mebibytes per second (MiB/s) allowed for the share.

If paid bursting is not already enabled on the share: The behavior is identical to the x-ms-share-paid-bursting-max-bandwidth-mibps header in Create Share. The default if not specified is the maximum allowed MiB/s for a share. If this header is set, x-ms-share-paid-bursting-enabled must also be set to true.

If paid bursting is already enabled on the share: x-ms-share-paid-bursting-max-bandwidth-mibps can be used to update the maximum paid bursting MiB/s for the share. x-ms-share-paid-bursting-enabled does not need to be set in this case. If x-ms-share-paid-bursting-enabled is set to true but x-ms-share-paid-bursting-max-bandwidth-mibps is not set, the maximum paid bursting bandwidth will remain unchanged.

Request body

None.

Sample request

PUT https://myaccount.file.core.windows.net/myshare?restype=share&comp=properties  
  
Request Headers:  
x-ms-version: 2020-02-10  
x-ms-date: <date>  
Authorization: SharedKey myaccount: Z5043vY9MesKNh0PNtksNc9nbXSSqGHueE00Jdjid0Q=  
x-ms-share-quota: 55  
x-ms-root-squash: RootSquash

Response

The response includes an HTTP status code and a set of response headers.

Status code

A successful operation returns status code 200 (OK).

For information about status codes, see Status and error codes.

Response headers

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.

Response header Description
Last-Modified 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.
ETag Contains a value that represents the version of the share, as a quoted string.
x-ms-request-id Uniquely identifies the request that was made. You can also use it to troubleshoot the request. For more information, see Troubleshoot API operations.
x-ms-version Indicates the version of Azure Files that's used to execute the request.
Date or x-ms-date A UTC date/time value that indicates the time at which the service sent the response.
x-ms-client-request-id Can be used to troubleshoot requests and corresponding responses. The value of this header is equal to the value of the x-ms-client-request-id header, if it's present in the request and the value is at most 1,024 visible ASCII characters. If the x-ms-client-request-id header is not present in the request, this header won't be present in the response.
x-ms-share-quota Version 2025-01-05 and later. Returned only for provisioned v2 file shares. Returns the provisioned storage size of the share, in gibibytes (GiB).
x-ms-share-provisioned-iops Version 2025-01-05 and later. Returned only for provisioned v2 file shares. Returns the provisioned number of input/output operations per second (IOPS) of the share.
x-ms-share-provisioned-bandwidth-mibps Version 2025-01-05 and later. Returned only for provisioned v2 file shares. Returns the provisioned bandwidth of the share, in mebibytes per second (MiBps).
x-ms-share-included-burst-iops Version 2025-01-05 and later. Returned only for provisioned v2 file shares. Returns the calculated burst IOPS of the share.
x-ms-share-max-burst-credits-for-iops Version 2025-01-05 and later. Returned only for provisioned v2 file shares. Returns the calculated maximum burst credits for the share. This is not the current burst credit level, but the maximum burst credits the share can have.
x-ms-share-next-allowed-quota-downgrade-time Version 2025-01-05 and later. Returned only for provisioned v2 file shares. A date/time value that specifies when the quota for the file share is permitted to be reduced. The date format follows RFC 1123.
x-ms-share-next-allowed-provisioned-iops-downgrade-time Version 2025-01-05 and later. Returned only for provisioned v2 file shares. A date/time value that specifies when the provisioned IOPS for the file share is permitted to be reduced. The date format follows RFC 1123.
x-ms-share-next-allowed-provisioned-bandwidth-downgrade-time Version 2025-01-05 and later. Returned only for provisioned v2 file shares. A date/time value that specifies when the provisioned bandwidth for the file share is permitted to be reduced. The date format follows RFC 1123.

Response body

None.

Authorization

Only the account owner can call this operation.

Remarks

For more information on setting the share quota, see Create Share.

If you set share quota to be smaller than the size of the data on the share, the operation will succeed. However, you won't be able to add more data to the share until the amount of the data on the share is reduced below the quota. You can reduce the amount of data by either deleting or compressing files.

Set Share Properties is not supported for a share snapshot. An attempt to perform this operation on a share snapshot will fail with status code 400 (InvalidQueryParameterValue).

If you set x-ms-enable-snapshot-virtual-directory-access header for NFS shares, re-mount the share to observe the updated behavior.

See also

Operations on FileShare resources (Azure Files)