Share via


ShareSasBuilder Class

Definition

ShareSasBuilder is used to generate a Shared Access Signature (SAS) for an Azure Storage share, directory, or file.

   For more information, see
Creating a Service SAS.
public class ShareSasBuilder
type ShareSasBuilder = class
Public Class ShareSasBuilder
Inheritance
ShareSasBuilder

Constructors

ShareSasBuilder(ShareFileSasPermissions, DateTimeOffset)

Initializes a new instance of the ShareSasBuilder class to create a Azure File Sas.

ShareSasBuilder(ShareSasPermissions, DateTimeOffset)

Initializes a new instance of the ShareSasBuilder class to create a File Share Sas.

Properties

CacheControl

Override the value returned for Cache-Control response header.

ContentDisposition

Override the value returned for Content-Disposition response header.

ContentEncoding

Override the value returned for Cache-Encoding response header.

ContentLanguage

Override the value returned for Cache-Language response header.

ContentType

Override the value returned for Cache-Type response header.

ExpiresOn

The time at which the shared access signature becomes invalid. This field must be omitted if it has been specified in an associated stored access policy.

FilePath

The path of the file or directory being made accessible, or Empty for a share SAS.

Identifier

An optional unique value up to 64 characters in length that correlates to an access policy specified for the share.

IPRange

Specifies an IP address or a range of IP addresses from which to accept requests. If the IP address from which the request originates does not match the IP address or address range specified on the SAS token, the request is not authenticated. When specifying a range of IP addresses, note that the range is inclusive.

Permissions

The permissions associated with the shared access signature. The user is restricted to operations allowed by the permissions. This field must be omitted if it has been specified in an associated stored access policy. The ShareFileSasPermissions, ShareSasPermissions, or ShareAccountSasPermissions can be used to create the permissions string.

Protocol

The optional signed protocol field specifies the protocol permitted for a request made with the SAS. Possible values are HttpsAndHttp, Https, and None.

Resource

Specifies which resources are accessible via the shared access signature.

Specify "f" if the shared resource is a file. This grants access to the content and metadata of the file.

Specify "s" if the shared resource is a share. This grants access to the content and metadata of any file in the share, and to the list of directories and files in the share.

ShareName

The name of the share being made accessible.

StartsOn

Optionally specify the time at which the shared access signature becomes valid. If omitted when DateTimeOffset.MinValue is used, start time for this call is assumed to be the time when the storage service receives the request.

Methods

SetPermissions(ShareAccountSasPermissions)

Sets the permissions for a file account level SAS.

SetPermissions(ShareFileSasPermissions)

Sets the permissions for a file SAS.

SetPermissions(ShareSasPermissions)

Sets the permissions for a share SAS.

SetPermissions(String, Boolean)

Sets the permissions for the SAS using a raw permissions string.

SetPermissions(String)

Sets the permissions for the SAS using a raw permissions string.

ToSasQueryParameters(StorageSharedKeyCredential, String)

Use an account's StorageSharedKeyCredential to sign this shared access signature values to produce the proper SAS query parameters for authenticating requests.

ToSasQueryParameters(StorageSharedKeyCredential)

Use an account's StorageSharedKeyCredential to sign this shared access signature values to produce the proper SAS query parameters for authenticating requests.

Applies to