Table of Contents

Class ShareClient

Namespace
Azure.Storage.Files.Shares
Assembly
Azure.Storage.Files.Shares.dll

The ShareClient allows you to manipulate Azure Storage shares and their directories and files.

public class ShareClient
Inheritance
ShareClient
Inherited Members
Extension Methods

Constructors

ShareClient()

Initializes a new instance of the ShareClient class for mocking.

protected ShareClient()

ShareClient(string, string)

Initializes a new instance of the ShareClient class.

public ShareClient(string connectionString, string shareName)

Parameters

connectionString string

A connection string includes the authentication information required for your application to access data in an Azure Storage account at runtime.

For more information, Configure Azure Storage connection strings

shareName string

The name of the share in the storage account to reference.

ShareClient(string, string, ShareClientOptions)

Initializes a new instance of the ShareClient class.

public ShareClient(string connectionString, string shareName, ShareClientOptions options)

Parameters

connectionString string

A connection string includes the authentication information required for your application to access data in an Azure Storage account at runtime.

For more information, Configure Azure Storage connection strings

shareName string

The name of the share in the storage account to reference.

options ShareClientOptions

Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

ShareClient(Uri, AzureSasCredential, ShareClientOptions)

Initializes a new instance of the ShareClient class.

Note that token credential authentication is only compatible with the GetPermission(string, CancellationToken), GetPermissionAsync(string, CancellationToken), CreatePermission(string, CancellationToken), and CreatePermissionAsync(string, CancellationToken) share-level operations.

public ShareClient(Uri shareUri, AzureSasCredential credential, ShareClientOptions options = null)

Parameters

shareUri Uri

A Uri referencing the share that includes the name of the account and the name of the share. Must not contain shared access signature, which should be passed in the second parameter.

credential AzureSasCredential

The shared access signature credential used to sign requests.

options ShareClientOptions

Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

Remarks

This constructor should only be used when shared access signature needs to be updated during lifespan of this client.

ShareClient(Uri, TokenCredential, ShareClientOptions)

Initializes a new instance of the ShareClient class.

Note that the only share-level operations that support token credential authentication are CreatePermission(string, CancellationToken), CreatePermissionAsync(string, CancellationToken), GetPermission(string, CancellationToken), and GetPermissionAsync(string, CancellationToken).

This constructor also allow the construction of a ShareServiceClient that can be used to derive a ShareClient that has token credential authentication.

Also note that ShareTokenIntent is currently required for token authentication.

public ShareClient(Uri shareUri, TokenCredential credential, ShareClientOptions options = null)

Parameters

shareUri Uri

A Uri referencing the share that includes the name of the account and the name of the share.

credential TokenCredential

The token credential used to sign requests.

options ShareClientOptions

Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

ShareClient(Uri, ShareClientOptions)

Initializes a new instance of the ShareClient class.

public ShareClient(Uri shareUri, ShareClientOptions options = null)

Parameters

shareUri Uri

A Uri referencing the share that includes the name of the account and the name of the share.

options ShareClientOptions

Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

ShareClient(Uri, StorageSharedKeyCredential, ShareClientOptions)

Initializes a new instance of the ShareClient class.

public ShareClient(Uri shareUri, StorageSharedKeyCredential credential, ShareClientOptions options = null)

Parameters

shareUri Uri

A Uri referencing the share that includes the name of the account and the name of the share.

credential StorageSharedKeyCredential

The shared key credential used to sign requests.

options ShareClientOptions

Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request.

Properties

AccountName

Gets the Storage account name corresponding to the share client.

public virtual string AccountName { get; }

Property Value

string

CanGenerateSasUri

Indicates whether the client is able to generate a SAS uri. Client can generate a SAS url if it is authenticated with a Azure.Storage.StorageSharedKeyCredential.

public virtual bool CanGenerateSasUri { get; }

Property Value

bool

Name

Gets the name of the share.

public virtual string Name { get; }

Property Value

string

Uri

Gets the share's primary Uri endpoint.

public virtual Uri Uri { get; }

Property Value

Uri

Methods

Create(ShareCreateOptions, CancellationToken)

The Create(ShareCreateOptions, CancellationToken) operation creates a new share under the specified account. If a share with the same name already exists, the operation fails.

For more information, see Create Share.

public virtual Response<ShareInfo> Create(ShareCreateOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareCreateOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareInfo>

A Azure.Response<> describing the newly created share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreateAsync(ShareCreateOptions, CancellationToken)

The CreateAsync(ShareCreateOptions, CancellationToken) operation creates a new share under the specified account. If a share with the same name already exists, the operation fails.

For more information, see Create Share.

public virtual Task<Response<ShareInfo>> CreateAsync(ShareCreateOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareCreateOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareInfo>>

A Azure.Response<> describing the newly created share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreateDirectory(string, IDictionary<string, string>, FileSmbProperties, string, CancellationToken)

The CreateDirectory(string, IDictionary<string, string>, FileSmbProperties, string, CancellationToken) operation creates a new directory in this share.

For more information, see Create Directory.

public virtual Response<ShareDirectoryClient> CreateDirectory(string directoryName, IDictionary<string, string> metadata = null, FileSmbProperties smbProperties = null, string filePermission = null, CancellationToken cancellationToken = default)

Parameters

directoryName string

T The name of the directory to create.

metadata IDictionary<string, string>

Optional custom metadata to set for the directory.

smbProperties FileSmbProperties

Optional SMB properties to set for the directory.

filePermission string

Optional file permission to set on the directory.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareDirectoryClient>

A Azure.Response<> referencing the newly created directory.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreateDirectoryAsync(string, IDictionary<string, string>, FileSmbProperties, string, CancellationToken)

The CreateDirectoryAsync(string, IDictionary<string, string>, FileSmbProperties, string, CancellationToken) operation creates a new directory in this share.

For more information, see Create Directory.

public virtual Task<Response<ShareDirectoryClient>> CreateDirectoryAsync(string directoryName, IDictionary<string, string> metadata = null, FileSmbProperties smbProperties = null, string filePermission = null, CancellationToken cancellationToken = default)

Parameters

directoryName string

T The name of the directory to create.

metadata IDictionary<string, string>

Optional custom metadata to set for the directory.

smbProperties FileSmbProperties

Optional SMB properties to set for the directory.

filePermission string

Optional file permission to set on the directory.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareDirectoryClient>>

A Azure.Response<> referencing the newly created directory.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreateIfNotExists(ShareCreateOptions, CancellationToken)

The CreateIfNotExists(ShareCreateOptions, CancellationToken) operation creates a new share under the specified account. If a share with the same name already exists, it is not changed.

For more information, see Create Share.

public virtual Response<ShareInfo> CreateIfNotExists(ShareCreateOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareCreateOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareInfo>

A Azure.Response<> describing the newly created share. If the share already exists, null.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreateIfNotExistsAsync(ShareCreateOptions, CancellationToken)

The CreateIfNotExistsAsync(IDictionary<string, string>, int?, CancellationToken) operation creates a new share under the specified account. If a share with the same name already exists, it is not changed.

For more information, see Create Share.

public virtual Task<Response<ShareInfo>> CreateIfNotExistsAsync(ShareCreateOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareCreateOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareInfo>>

A Azure.Response<> describing the newly created share. If the share already exists, null.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreateIfNotExistsAsync(IDictionary<string, string>, int?, CancellationToken)

The CreateIfNotExistsAsync(IDictionary<string, string>, int?, CancellationToken) operation creates a new share under the specified account. If a share with the same name already exists, it is not changed.

For more information, see Create Share.

public virtual Task<Response<ShareInfo>> CreateIfNotExistsAsync(IDictionary<string, string> metadata = null, int? quotaInGB = null, CancellationToken cancellationToken = default)

Parameters

metadata IDictionary<string, string>

Optional custom metadata to set for this share.

quotaInGB int?

Optional. Maximum size of the share in bytes. If unspecified, use the service's default value.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareInfo>>

A Azure.Response<> describing the newly created share. If the share already exists, null.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreatePermission(string, CancellationToken)

Creates a permission (a security descriptor) at the share level. The created security descriptor can be used for the files/directories in the share.

public virtual Response<PermissionInfo> CreatePermission(string permission, CancellationToken cancellationToken = default)

Parameters

permission string

File permission in the Security Descriptor Definition Language (SDDL). SDDL must have an owner, group, and discretionary access control list (DACL). The provided SDDL string format of the security descriptor should not have domain relative identifier (like 'DU', 'DA', 'DD' etc) in it.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<PermissionInfo>

A Azure.Response<> with ID of the newly created file permission.

CreatePermissionAsync(string, CancellationToken)

Creates a permission (a security descriptor) at the share level. The created security descriptor can be used for the files/directories in the share.

public virtual Task<Response<PermissionInfo>> CreatePermissionAsync(string permission, CancellationToken cancellationToken = default)

Parameters

permission string

File permission in the Security Descriptor Definition Language (SDDL). SDDL must have an owner, group, and discretionary access control list (DACL). The provided SDDL string format of the security descriptor should not have domain relative identifier (like 'DU', 'DA', 'DD' etc) in it.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<PermissionInfo>>

A Azure.Response<> with ID of the newly created file permission.

CreateSnapshot(IDictionary<string, string>, CancellationToken)

Creates a read-only snapshot of a share.

For more information, see Snapshot Share.

public virtual Response<ShareSnapshotInfo> CreateSnapshot(IDictionary<string, string> metadata = null, CancellationToken cancellationToken = default)

Parameters

metadata IDictionary<string, string>

Optional custom metadata to set for this share.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareSnapshotInfo>

A Azure.Response<> describing the newly created snapshot.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

CreateSnapshotAsync(IDictionary<string, string>, CancellationToken)

Creates a read-only snapshot of a share.

For more information, see Snapshot Share.

public virtual Task<Response<ShareSnapshotInfo>> CreateSnapshotAsync(IDictionary<string, string> metadata = null, CancellationToken cancellationToken = default)

Parameters

metadata IDictionary<string, string>

Optional custom metadata to set for this share.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareSnapshotInfo>>

A Azure.Response<> describing the newly created snapshot.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

Delete(ShareDeleteOptions, CancellationToken)

Marks the specified share or share snapshot for deletion. The share or share snapshot and any files contained within it are later deleted during garbage collection which could take several minutes.

For more information, see Delete Share.

public virtual Response Delete(ShareDeleteOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareDeleteOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response

A Azure.Response on successfully marking for deletion.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

DeleteAsync(ShareDeleteOptions, CancellationToken)

Marks the specified share or share snapshot for deletion. The share or share snapshot and any files contained within it are later deleted during garbage collection which could take several minutes.

For more information, see Delete Share.

public virtual Task<Response> DeleteAsync(ShareDeleteOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareDeleteOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response>

A Azure.Response on successfully marking for deletion.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

DeleteDirectory(string, CancellationToken)

The DeleteDirectory(string, CancellationToken) operation removes the specified empty directory.

For more information, see Delete Directory.

public virtual Response DeleteDirectory(string directoryName, CancellationToken cancellationToken = default)

Parameters

directoryName string

T The name of the directory to delete.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response

A Azure.Response if successful.

Remarks

Note that the directory must be empty before it can be deleted.

DeleteDirectoryAsync(string, CancellationToken)

The DeleteDirectoryAsync(string, CancellationToken) operation removes the specified empty directory.

For more information, see Delete Directory.

public virtual Task<Response> DeleteDirectoryAsync(string directoryName, CancellationToken cancellationToken = default)

Parameters

directoryName string

T The name of the directory to delete.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response>

A Azure.Response if successful.

Remarks

Note that the directory must be empty before it can be deleted.

DeleteIfExists(ShareDeleteOptions, CancellationToken)

Marks the specified share or share snapshot for deletion, if it exists.

For more information, see Delete Share.

public virtual Response<bool> DeleteIfExists(ShareDeleteOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareDeleteOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<bool>

A Azure.Response on successfully deleting.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

DeleteIfExistsAsync(ShareDeleteOptions, CancellationToken)

Marks the specified share or share snapshot for deletion, if it exists.

For more information, see Delete Share.

public virtual Task<Response<bool>> DeleteIfExistsAsync(ShareDeleteOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareDeleteOptions

Optional parameters.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<bool>>

A Azure.Response on successfully deleting.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

Exists(CancellationToken)

The Exists(CancellationToken) operation can be called on a ShareClient to see if the associated share exists on the storage account in the storage service.

public virtual Response<bool> Exists(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<bool>

Returns true if the share exists.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

ExistsAsync(CancellationToken)

The ExistsAsync(CancellationToken) operation can be called on a ShareClient to see if the associated share exists on the storage account in the storage service.

public virtual Task<Response<bool>> ExistsAsync(CancellationToken cancellationToken = default)

Parameters

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<bool>>

Returns true if the share exists.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

GenerateSasUri(ShareSasBuilder)

The GenerateSasUri(ShareSasBuilder) returns a Uri that generates a Blob Container Service Shared Access Signature (SAS) Uri based on the Client properties and builder passed. The SAS is signed by the shared key credential of the client.

To check if the client is able to sign a Service Sas see CanGenerateSasUri.

For more information, see Constructing a Service SAS.

public virtual Uri GenerateSasUri(ShareSasBuilder builder)

Parameters

builder ShareSasBuilder

Used to generate a Shared Access Signature (SAS)

Returns

Uri

A Uri containing the SAS Uri.

Remarks

A Exception will be thrown if a failure occurs.

GenerateSasUri(ShareSasPermissions, DateTimeOffset)

The GenerateSasUri(ShareSasPermissions, DateTimeOffset) returns a Uri that generates a Share Service Shared Access Signature (SAS) Uri based on the Client properties and parameters passed. The SAS is signed by the shared key credential of the client.

To check if the client is able to sign a Service Sas see CanGenerateSasUri.

For more information, see Constructing a service SAS.

public virtual Uri GenerateSasUri(ShareSasPermissions permissions, DateTimeOffset expiresOn)

Parameters

permissions ShareSasPermissions

Required. Specifies the list of permissions to be associated with the SAS. See ShareSasPermissions.

expiresOn DateTimeOffset

Required. Specifies the time at which the SAS becomes invalid. This field must be omitted if it has been specified in an associated stored access policy.

Returns

Uri

A Uri containing the SAS Uri.

Remarks

A Exception will be thrown if a failure occurs.

GetAccessPolicy(ShareFileRequestConditions, CancellationToken)

The GetAccessPolicy(ShareFileRequestConditions, CancellationToken) operation gets the permissions for this share. The permissions indicate whether share data may be accessed publicly.

For more information, see Get Share ACL.

public virtual Response<IEnumerable<ShareSignedIdentifier>> GetAccessPolicy(ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on getting share access policy.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<IEnumerable<ShareSignedIdentifier>>

A Azure.Response<> of IEnumerable<T> describing the share's access policy.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

GetAccessPolicyAsync(ShareFileRequestConditions, CancellationToken)

The GetAccessPolicyAsync(ShareFileRequestConditions, CancellationToken) operation gets the permissions for this share. The permissions indicate whether share data may be accessed publicly.

For more information, see Get Share ACL.

public virtual Task<Response<IEnumerable<ShareSignedIdentifier>>> GetAccessPolicyAsync(ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on getting share access policy.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<IEnumerable<ShareSignedIdentifier>>>

A Azure.Response<> of IEnumerable<T> describing the share's access policy.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

GetDirectoryClient(string)

Create a new ShareDirectoryClient object by appending directoryName to the end of Uri. The new ShareDirectoryClient uses the same request policy pipeline as the ShareClient.

public virtual ShareDirectoryClient GetDirectoryClient(string directoryName)

Parameters

directoryName string

The name of the directory.

Returns

ShareDirectoryClient

A new ShareDirectoryClient instance.

GetParentServiceClientCore()

Create a new ShareServiceClient that pointing to this ShareClient's parent container. The new ShareServiceClient uses the same request policy pipeline as the ShareClient.

protected virtual ShareServiceClient GetParentServiceClientCore()

Returns

ShareServiceClient

A new ShareServiceClient instance.

GetPermission(string, CancellationToken)

Gets the file permission in Security Descriptor Definition Language (SDDL). Note that this API is not applicable for Share Snapshots.

public virtual Response<string> GetPermission(string filePermissionKey = null, CancellationToken cancellationToken = default)

Parameters

filePermissionKey string

The file permission key.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<string>

A Azure.Response<> file permission.

GetPermissionAsync(string, CancellationToken)

Gets the file permission in Security Descriptor Definition Language (SDDL). Note that this API is not applicable for Share Snapshots.

public virtual Task<Response<string>> GetPermissionAsync(string filePermissionKey = null, CancellationToken cancellationToken = default)

Parameters

filePermissionKey string

The file permission key.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<string>>

A Azure.Response<> file permission.

GetProperties(ShareFileRequestConditions, CancellationToken)

The GetProperties(ShareFileRequestConditions, CancellationToken) operation returns all user-defined metadata, standard HTTP properties, and system properties for the share.

For more information, see Get Share Properties.

public virtual Response<ShareProperties> GetProperties(ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on getting share properties.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareProperties>

A Azure.Response<> describing the share's properties.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

GetPropertiesAsync(ShareFileRequestConditions, CancellationToken)

The GetPropertiesAsync(ShareFileRequestConditions, CancellationToken) operation returns all user-defined metadata, standard HTTP properties, and system properties for the share.

For more information, see Get Share Properties.

public virtual Task<Response<ShareProperties>> GetPropertiesAsync(ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on getting share properties.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareProperties>>

A Azure.Response<> describing the share's properties.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

GetRootDirectoryClient()

Create a ShareDirectoryClient object for the root of the share. The new ShareDirectoryClient uses the same request policy pipeline as the ShareClient.

public virtual ShareDirectoryClient GetRootDirectoryClient()

Returns

ShareDirectoryClient

A new ShareDirectoryClient instance.

GetStatistics(ShareFileRequestConditions, CancellationToken)

Retrieves statistics related to the share.

For more information, see Get Share Stats.

public virtual Response<ShareStatistics> GetStatistics(ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on getting share stats.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareStatistics>

A Azure.Response<> describing the share statistics.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

GetStatisticsAsync(ShareFileRequestConditions, CancellationToken)

Retrieves statistics related to the share.

For more information, see Get Share Stats.

public virtual Task<Response<ShareStatistics>> GetStatisticsAsync(ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on getting share stats.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareStatistics>>

A Azure.Response<> describing the share statistics.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

SetAccessPolicy(IEnumerable<ShareSignedIdentifier>, ShareFileRequestConditions, CancellationToken)

The SetAccessPolicy(IEnumerable<ShareSignedIdentifier>, ShareFileRequestConditions, CancellationToken) operation sets the permissions for the specified share. The permissions indicate whether share data may be accessed publicly.

For more information, see Set Share ACL.

public virtual Response<ShareInfo> SetAccessPolicy(IEnumerable<ShareSignedIdentifier> permissions, ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

permissions IEnumerable<ShareSignedIdentifier>

Stored access policies that you can use to provide fine grained control over share permissions.

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on setting the access policy.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareInfo>

A Azure.Response<> describing the updated share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

SetAccessPolicyAsync(IEnumerable<ShareSignedIdentifier>, ShareFileRequestConditions, CancellationToken)

The SetAccessPolicyAsync(IEnumerable<ShareSignedIdentifier>, ShareFileRequestConditions, CancellationToken) operation sets the permissions for the specified share. The permissions indicate whether share data may be accessed publicly.

For more information, see Set Share ACL.

public virtual Task<Response<ShareInfo>> SetAccessPolicyAsync(IEnumerable<ShareSignedIdentifier> permissions, ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

permissions IEnumerable<ShareSignedIdentifier>

Stored access policies that you can use to provide fine grained control over share permissions.

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on setting the access policy.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareInfo>>

A Azure.Response<> describing the updated share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

SetMetadata(IDictionary<string, string>, ShareFileRequestConditions, CancellationToken)

The SetMetadata(IDictionary<string, string>, ShareFileRequestConditions, CancellationToken) operation sets user-defined metadata for the specified share as one or more name-value pairs.

For more information, see Set Share Metadata.

public virtual Response<ShareInfo> SetMetadata(IDictionary<string, string> metadata, ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

metadata IDictionary<string, string>

Custom metadata to set for this share.

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on setting share metadata.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareInfo>

A Azure.Response<> describing the updated share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

SetMetadataAsync(IDictionary<string, string>, ShareFileRequestConditions, CancellationToken)

The SetMetadataAsync(IDictionary<string, string>, ShareFileRequestConditions, CancellationToken) operation sets user-defined metadata for the specified share as one or more name-value pairs.

For more information, see Set Share Metadata.

public virtual Task<Response<ShareInfo>> SetMetadataAsync(IDictionary<string, string> metadata, ShareFileRequestConditions conditions = null, CancellationToken cancellationToken = default)

Parameters

metadata IDictionary<string, string>

Custom metadata to set for this share.

conditions ShareFileRequestConditions

Optional ShareFileRequestConditions to add conditions on setting share metadata.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareInfo>>

A Azure.Response<> describing the updated share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

SetProperties(ShareSetPropertiesOptions, CancellationToken)

Sets properties of the share.

For more information, see Set Share Properties.

public virtual Response<ShareInfo> SetProperties(ShareSetPropertiesOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareSetPropertiesOptions

Properties to set on the share.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Response<ShareInfo>

A Azure.Response<> describing the updated share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

SetPropertiesAsync(ShareSetPropertiesOptions, CancellationToken)

Sets properties of the share.

For more information, see Set Share Properties.

public virtual Task<Response<ShareInfo>> SetPropertiesAsync(ShareSetPropertiesOptions options, CancellationToken cancellationToken = default)

Parameters

options ShareSetPropertiesOptions

Properties to set on the share.

cancellationToken CancellationToken

Optional CancellationToken to propagate notifications that the operation should be cancelled.

Returns

Task<Response<ShareInfo>>

A Azure.Response<> describing the updated share.

Remarks

A Azure.RequestFailedException will be thrown if a failure occurs.

WithSnapshot(string)

Initializes a new instance of the ShareClient class with an identical Uri source but the specified snapshot timestamp.

For more information, see Snapshot Share.

public virtual ShareClient WithSnapshot(string snapshot)

Parameters

snapshot string

The snapshot identifier.

Returns

ShareClient

A new ShareClient instance.

Remarks

Pass null or empty string to remove the snapshot returning a URL to the base share.