Show / Hide Table of Contents

Class SasQueryParameters

A SasQueryParameters object represents the components that make up an Azure Storage Shared Access Signature's query parameters. It includes components used by all Azure Storage resources (Blob Containers, Blobs, Files, and Queues). You can construct a new instance using the service specific SAS builder types. For more information, Create a service SAS.

Inheritance
System.Object
SasQueryParameters
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Storage.Common.dll
Syntax
public class SasQueryParameters

Constructors

SasQueryParameters()

Initializes a new instance of the SasQueryParameters class.

Declaration
protected SasQueryParameters ();

SasQueryParameters(IDictionary<String,String>)

Creates a new instance of the SasQueryParameters type based on the supplied query parameters values. All SAS-related query parameters will be removed from values.

Declaration
protected SasQueryParameters (System.Collections.Generic.IDictionary<string,string> values);
Parameters
System.Collections.Generic.IDictionary<System.String,System.String> values

URI query parameters

SasQueryParameters(String, Nullable<AccountSasServices>, Nullable<AccountSasResourceTypes>, SasProtocol, DateTimeOffset, DateTimeOffset, SasIPRange, String, String, String, String, String, String, String, String, String)

Creates a new SasQueryParameters instance.

Declaration
[System.ComponentModel.EditorBrowsable]
protected SasQueryParameters (string version, Nullable<Azure.Storage.Sas.AccountSasServices> services, Nullable<Azure.Storage.Sas.AccountSasResourceTypes> resourceTypes, Azure.Storage.Sas.SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, Azure.Storage.Sas.SasIPRange ipRange, string identifier, string resource, string permissions, string signature, string cacheControl = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string contentType = null);
Parameters
System.String version

System.Nullable<AccountSasServices> services

System.Nullable<AccountSasResourceTypes> resourceTypes

SasProtocol protocol

System.DateTimeOffset startsOn

System.DateTimeOffset expiresOn

SasIPRange ipRange

System.String identifier

System.String resource

System.String permissions

System.String signature

System.String cacheControl

System.String contentDisposition

System.String contentEncoding

System.String contentLanguage

System.String contentType

SasQueryParameters(String, Nullable<AccountSasServices>, Nullable<AccountSasResourceTypes>, SasProtocol, DateTimeOffset, DateTimeOffset, SasIPRange, String, String, String, String, String, String, String, String, String, String, String, String, Nullable<Int32>)

Creates a new SasQueryParameters instance.

Declaration
[System.ComponentModel.EditorBrowsable]
protected SasQueryParameters (string version, Nullable<Azure.Storage.Sas.AccountSasServices> services, Nullable<Azure.Storage.Sas.AccountSasResourceTypes> resourceTypes, Azure.Storage.Sas.SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, Azure.Storage.Sas.SasIPRange ipRange, string identifier, string resource, string permissions, string signature, string cacheControl = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string contentType = null, string authorizedAadObjectId = null, string unauthorizedAadObjectId = null, string correlationId = null, Nullable<int> directoryDepth = null);
Parameters
System.String version

System.Nullable<AccountSasServices> services

System.Nullable<AccountSasResourceTypes> resourceTypes

SasProtocol protocol

System.DateTimeOffset startsOn

System.DateTimeOffset expiresOn

SasIPRange ipRange

System.String identifier

System.String resource

System.String permissions

System.String signature

System.String cacheControl

System.String contentDisposition

System.String contentEncoding

System.String contentLanguage

System.String contentType

System.String authorizedAadObjectId

System.String unauthorizedAadObjectId

System.String correlationId

System.Nullable<System.Int32> directoryDepth

SasQueryParameters(String, Nullable<AccountSasServices>, Nullable<AccountSasResourceTypes>, SasProtocol, DateTimeOffset, DateTimeOffset, SasIPRange, String, String, String, String, String, String, String, String, String, String, String, String, Nullable<Int32>, String)

Creates a new SasQueryParameters instance.

Declaration
protected SasQueryParameters (string version, Nullable<Azure.Storage.Sas.AccountSasServices> services, Nullable<Azure.Storage.Sas.AccountSasResourceTypes> resourceTypes, Azure.Storage.Sas.SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, Azure.Storage.Sas.SasIPRange ipRange, string identifier, string resource, string permissions, string signature, string cacheControl = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string contentType = null, string authorizedAadObjectId = null, string unauthorizedAadObjectId = null, string correlationId = null, Nullable<int> directoryDepth = null, string encryptionScope = null);
Parameters
System.String version

System.Nullable<AccountSasServices> services

System.Nullable<AccountSasResourceTypes> resourceTypes

SasProtocol protocol

System.DateTimeOffset startsOn

System.DateTimeOffset expiresOn

SasIPRange ipRange

System.String identifier

System.String resource

System.String permissions

System.String signature

System.String cacheControl

System.String contentDisposition

System.String contentEncoding

System.String contentLanguage

System.String contentType

System.String authorizedAadObjectId

System.String unauthorizedAadObjectId

System.String correlationId

System.Nullable<System.Int32> directoryDepth

System.String encryptionScope

Fields

DefaultSasVersion

The default service version to use for Shared Access Signatures.

Declaration
public const string DefaultSasVersion;
Field Value
System.String

Properties

AgentObjectId

Gets the Unauthorized AAD Object Id associated with the shared access signature. The AAD Object Id of a user that is assumed to be unauthorized by the owner of the User Delegation Key. The Azure Storage Service will perform an additional POSIX ACL check to determine if the user is authorized to perform the requested operation. This cannot be used in conjuction with PreauthorizedAgentObjectId. Only valid in an HNS enabled account. If this value is set in an non-HNS enabled account, an authorization failure will be thrown.

Declaration
public string AgentObjectId { get; }
Property Value
System.String

CacheControl

Gets the Cache-Control response header, which allows for specifying the client-side caching to be used for blob and file downloads.

Declaration
public string CacheControl { get; }
Property Value
System.String

ContentDisposition

Gets the Content-Disposition response header, which allows for specifying the way that the blob or file content can be displayed in the browser.

Declaration
public string ContentDisposition { get; }
Property Value
System.String

ContentEncoding

Gets the Content-Encoding response header, which allows for specifying the type of encoding used for blob and file downloads.

Declaration
public string ContentEncoding { get; }
Property Value
System.String

ContentLanguage

Gets the Content-Language response header, which allows for specifying the language of the downloaded blob or file content.

Declaration
public string ContentLanguage { get; }
Property Value
System.String

ContentType

Gets the Content-Type response header, which allows for specifying the type of the downloaded blob or file content.

Declaration
public string ContentType { get; }
Property Value
System.String

CorrelationId

Gets the Correlation Id associated with the shared access signature. This is used to correlate the storage audit logs with the audit logs used by the principal generating and distributing SAS.

Declaration
public string CorrelationId { get; }
Property Value
System.String

DirectoryDepth

Gets the Directory Depth specificed in the canonicalizedresource field of the string-to-sign. The depth of the directory is the number of directories beneath the root folder. Required when resource (sr) = d to indicate the depth of the directory. The value must be a non-negative integer.

Declaration
public Nullable<int> DirectoryDepth { get; }
Property Value
System.Nullable<System.Int32>

Empty

Gets empty shared access signature query parameters.

Declaration
public static Azure.Storage.Sas.SasQueryParameters Empty { get; }
Property Value
SasQueryParameters

EncryptionScope

Gets the Encryption Scope associated with the shared access signature.

Declaration
public string EncryptionScope { get; }
Property Value
System.String

ExpiresOn

Gets the time at which the shared access signature becomes invalid. System.DateTimeOffset.MinValue means not set.

Declaration
public DateTimeOffset ExpiresOn { get; }
Property Value
System.DateTimeOffset

Identifier

Gets the optional unique value up to 64 characters in length that correlates to an access policy specified for the blob container, queue, or share.

Declaration
public string Identifier { get; }
Property Value
System.String

IPRange

Gets the optional IP address or a range of IP addresses from which to accept requests. When specifying a range, note that the range is inclusive.

Declaration
public Azure.Storage.Sas.SasIPRange IPRange { get; }
Property Value
SasIPRange

Permissions

Gets 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.

Declaration
public string Permissions { get; }
Property Value
System.String

PreauthorizedAgentObjectId

Gets the Authorized AAD Object Id associated with the shared access signature. The AAD Object ID of a user authorized by the owner of the User Delegation Key to perform the action granted by the SAS. The Azure Storage service will ensure that the owner of the user delegation key has the required permissions before granting access but no additional permission check for the user specified in this value will be performed. This cannot be used in conjuction with AgentObjectId. Only valid in an HNS enabled account. If this value is set in an non-HNS enabled account, an authorization failure will be thrown.

Declaration
public string PreauthorizedAgentObjectId { get; }
Property Value
System.String

Protocol

Optional. Specifies the protocol permitted for a request made with the shared access signature.

Declaration
public Azure.Storage.Sas.SasProtocol Protocol { get; }
Property Value
SasProtocol

Resource

Gets the resources are accessible via the shared access signature.

Declaration
public string Resource { get; }
Property Value
System.String

ResourceTypes

Gets which resources are accessible via the shared access signature.

Declaration
public Nullable<Azure.Storage.Sas.AccountSasResourceTypes> ResourceTypes { get; }
Property Value
System.Nullable<AccountSasResourceTypes>

Services

Gets the signed services accessible with an account level shared access signature.

Declaration
public Nullable<Azure.Storage.Sas.AccountSasServices> Services { get; }
Property Value
System.Nullable<AccountSasServices>

Signature

Gets the string-to-sign, a unique string constructed from the fields that must be verified in order to authenticate the request. The signature is an HMAC computed over the string-to-sign and key using the SHA256 algorithm, and then encoded using Base64 encoding.

Declaration
public string Signature { get; }
Property Value
System.String

StartsOn

Gets the optional time at which the shared access signature becomes valid. If omitted, start time for this call is assumed to be the time when the storage service receives the request. System.DateTimeOffset.MinValue means not set.

Declaration
public DateTimeOffset StartsOn { get; }
Property Value
System.DateTimeOffset

Version

Gets the storage service version to use to authenticate requests made with this shared access signature, and the service version to use when handling requests made with this shared access signature.

Declaration
public string Version { get; }
Property Value
System.String

Methods

AppendProperties(StringBuilder)

Builds the query parameter string for the SasQueryParameters instance.

Declaration
protected internal void AppendProperties (System.Text.StringBuilder stringBuilder);
Parameters
System.Text.StringBuilder stringBuilder

StringBuilder instance to add the query params to

Create(String, Nullable<AccountSasServices>, Nullable<AccountSasResourceTypes>, SasProtocol, DateTimeOffset, DateTimeOffset, SasIPRange, String, String, String, String, String, String, String, String, String, String, String, String, Nullable<Int32>)

Creates a new SasQueryParameters instance.

Declaration
[System.ComponentModel.EditorBrowsable]
protected static Azure.Storage.Sas.SasQueryParameters Create (string version, Nullable<Azure.Storage.Sas.AccountSasServices> services, Nullable<Azure.Storage.Sas.AccountSasResourceTypes> resourceTypes, Azure.Storage.Sas.SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, Azure.Storage.Sas.SasIPRange ipRange, string identifier, string resource, string permissions, string signature, string cacheControl = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string contentType = null, string authorizedAadObjectId = null, string unauthorizedAadObjectId = null, string correlationId = null, Nullable<int> directoryDepth = null);
Parameters
System.String version

System.Nullable<AccountSasServices> services

System.Nullable<AccountSasResourceTypes> resourceTypes

SasProtocol protocol

System.DateTimeOffset startsOn

System.DateTimeOffset expiresOn

SasIPRange ipRange

System.String identifier

System.String resource

System.String permissions

System.String signature

System.String cacheControl

System.String contentDisposition

System.String contentEncoding

System.String contentLanguage

System.String contentType

System.String authorizedAadObjectId

System.String unauthorizedAadObjectId

System.String correlationId

System.Nullable<System.Int32> directoryDepth

Returns
SasQueryParameters

Create(String, Nullable<AccountSasServices>, Nullable<AccountSasResourceTypes>, SasProtocol, DateTimeOffset, DateTimeOffset, SasIPRange, String, String, String, String, String, String, String, String, String, String, String, String, Nullable<Int32>, String)

Creates a new SasQueryParameters instance.

Declaration
protected static Azure.Storage.Sas.SasQueryParameters Create (string version, Nullable<Azure.Storage.Sas.AccountSasServices> services, Nullable<Azure.Storage.Sas.AccountSasResourceTypes> resourceTypes, Azure.Storage.Sas.SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, Azure.Storage.Sas.SasIPRange ipRange, string identifier, string resource, string permissions, string signature, string cacheControl = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string contentType = null, string authorizedAadObjectId = null, string unauthorizedAadObjectId = null, string correlationId = null, Nullable<int> directoryDepth = null, string encryptionScope = null);
Parameters
System.String version

System.Nullable<AccountSasServices> services

System.Nullable<AccountSasResourceTypes> resourceTypes

SasProtocol protocol

System.DateTimeOffset startsOn

System.DateTimeOffset expiresOn

SasIPRange ipRange

System.String identifier

System.String resource

System.String permissions

System.String signature

System.String cacheControl

System.String contentDisposition

System.String contentEncoding

System.String contentLanguage

System.String contentType

System.String authorizedAadObjectId

System.String unauthorizedAadObjectId

System.String correlationId

System.Nullable<System.Int32> directoryDepth

System.String encryptionScope

Returns
SasQueryParameters

Create(IDictionary<String,String>)

Creates a new instance of the SasQueryParameters type based on the supplied query parameters values. All SAS-related query parameters will be removed from values.

Declaration
protected static Azure.Storage.Sas.SasQueryParameters Create (System.Collections.Generic.IDictionary<string,string> values);
Parameters
System.Collections.Generic.IDictionary<System.String,System.String> values

URI query parameters

Returns
SasQueryParameters

Create(String, Nullable<AccountSasServices>, Nullable<AccountSasResourceTypes>, SasProtocol, DateTimeOffset, DateTimeOffset, SasIPRange, String, String, String, String, String, String, String, String, String)

Creates a new SasQueryParameters instance.

Declaration
[System.ComponentModel.EditorBrowsable]
protected static Azure.Storage.Sas.SasQueryParameters Create (string version, Nullable<Azure.Storage.Sas.AccountSasServices> services, Nullable<Azure.Storage.Sas.AccountSasResourceTypes> resourceTypes, Azure.Storage.Sas.SasProtocol protocol, DateTimeOffset startsOn, DateTimeOffset expiresOn, Azure.Storage.Sas.SasIPRange ipRange, string identifier, string resource, string permissions, string signature, string cacheControl = null, string contentDisposition = null, string contentEncoding = null, string contentLanguage = null, string contentType = null);
Parameters
System.String version

System.Nullable<AccountSasServices> services

System.Nullable<AccountSasResourceTypes> resourceTypes

SasProtocol protocol

System.DateTimeOffset startsOn

System.DateTimeOffset expiresOn

SasIPRange ipRange

System.String identifier

System.String resource

System.String permissions

System.String signature

System.String cacheControl

System.String contentDisposition

System.String contentEncoding

System.String contentLanguage

System.String contentType

Returns
SasQueryParameters

ToString()

Convert the SAS query parameters into a URL encoded query string.

Declaration
public override string ToString ();
Returns
System.String

A URL encoded query string representing the SAS.

Back to top Azure SDK for .NET