<PackageReference Include="Microsoft.Azure.Storage.Common" Version="11.1.2" />

Microsoft.Azure.Storage.Auth.StorageCredentials

public sealed class StorageCredentials
Represents a set of credentials used to authenticate access to a Microsoft Azure storage account.
public string AccountName { get; }

Gets the associated account name for the credentials.

public bool IsAnonymous { get; }

Gets a value indicating whether the credentials are for anonymous access.

public bool IsSAS { get; }

Gets a value indicating whether the credentials are a shared access signature token.

public bool IsSharedKey { get; }

Gets a value indicating whether the credentials are a shared key.

public bool IsToken { get; }

Gets a value indicating whether the credentials are a bearer token.

public string KeyName { get; }

Gets the associated key name for the credentials.

public string SASSignature { get; }

Gets the value of the shared access signature token's sig parameter.

public string SASToken { get; }

Gets the associated shared access signature token for the credentials.

Initializes a new instance of the StorageCredentials class.

public StorageCredentials(string accountName, string keyValue)

Initializes a new instance of the StorageCredentials class with the specified account name and key value.

public StorageCredentials(string accountName, byte[] keyValue)

Initializes a new instance of the StorageCredentials class with the specified account name and key value.

public StorageCredentials(string accountName, string keyValue, string keyName)

Initializes a new instance of the StorageCredentials class with the specified account name, key value, and key name.

public StorageCredentials(string accountName, byte[] keyValue, string keyName)

Initializes a new instance of the StorageCredentials class with the specified account name, key value, and key name.

public StorageCredentials(string sasToken)

Initializes a new instance of the StorageCredentials class with the specified shared access signature token.

public StorageCredentials(TokenCredential tokenCredential)

Initializes a new instance of the StorageCredentials class with the specified bearer token.

public bool Equals(StorageCredentials other)

Determines whether an other StorageCredentials object is equal to this one by comparing their SAS tokens, account names, key names, and key values.

public string ExportBase64EncodedKey()

Exports the value of the account access key to a Base64-encoded string.

public byte[] ExportKey()

Returns the account key for the credentials.

public Uri TransformUri(Uri resourceUri)

Transforms a resource URI into a shared access signature URI, by appending a shared access token.

public StorageUri TransformUri(StorageUri resourceUri)

Transforms a resource URI into a shared access signature URI, by appending a shared access token.

public void UpdateKey(string keyValue)

Updates the key value for the credentials.

public void UpdateKey(byte[] keyValue)

Updates the key value for the credentials.

public void UpdateKey(string keyValue, string keyName)

Updates the key value and key name for the credentials.

public void UpdateKey(byte[] keyValue, string keyName)

Updates the key value and key name for the credentials.

public void UpdateSASToken(string sasToken)

Updates the shared access signature (SAS) token value for storage credentials created with a shared access signature.