Bagikan melalui


ShareClient Constructors

Definition

Overloads

ShareClient()

Initializes a new instance of the ShareClient class for mocking.

ShareClient(String, String)

Initializes a new instance of the ShareClient class.

ShareClient(Uri, ShareClientOptions)

Initializes a new instance of the ShareClient class.

ShareClient(String, String, ShareClientOptions)

Initializes a new instance of the ShareClient class.

ShareClient(Uri, AzureSasCredential, ShareClientOptions)

Initializes a new instance of the ShareClient class.

Note that token credential authentication is only compatible with the Azure.Storage.Files.Shares.ShareClient.GetPermission(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.GetPermissionAsync(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.CreatePermission(System.String,System.Threading.CancellationToken), and Azure.Storage.Files.Shares.ShareClient.CreatePermissionAsync(System.String,System.Threading.CancellationToken) share-level operations.

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 Azure.Storage.Files.Shares.ShareClient.CreatePermission(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.CreatePermissionAsync(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.GetPermission(System.String,System.Threading.CancellationToken), and Azure.Storage.Files.Shares.ShareClient.GetPermissionAsync(System.String,System.Threading.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.

ShareClient(Uri, StorageSharedKeyCredential, ShareClientOptions)

Initializes a new instance of the ShareClient class.

ShareClient()

Source:
ShareClient.cs
Source:
ShareClient.cs

Initializes a new instance of the ShareClient class for mocking.

protected ShareClient ();
Protected Sub New ()

Applies to

ShareClient(String, String)

Source:
ShareClient.cs
Source:
ShareClient.cs

Initializes a new instance of the ShareClient class.

public ShareClient (string connectionString, string shareName);
new Azure.Storage.Files.Shares.ShareClient : string * string -> Azure.Storage.Files.Shares.ShareClient
Public Sub New (connectionString As String, shareName As String)

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.

Applies to

ShareClient(Uri, ShareClientOptions)

Source:
ShareClient.cs
Source:
ShareClient.cs

Initializes a new instance of the ShareClient class.

public ShareClient (Uri shareUri, Azure.Storage.Files.Shares.ShareClientOptions options = default);
new Azure.Storage.Files.Shares.ShareClient : Uri * Azure.Storage.Files.Shares.ShareClientOptions -> Azure.Storage.Files.Shares.ShareClient
Public Sub New (shareUri As Uri, Optional options As ShareClientOptions = Nothing)

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.

Applies to

ShareClient(String, String, ShareClientOptions)

Source:
ShareClient.cs
Source:
ShareClient.cs

Initializes a new instance of the ShareClient class.

public ShareClient (string connectionString, string shareName, Azure.Storage.Files.Shares.ShareClientOptions options);
new Azure.Storage.Files.Shares.ShareClient : string * string * Azure.Storage.Files.Shares.ShareClientOptions -> Azure.Storage.Files.Shares.ShareClient
Public Sub New (connectionString As String, shareName As String, options As ShareClientOptions)

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.

Applies to

ShareClient(Uri, AzureSasCredential, ShareClientOptions)

Source:
ShareClient.cs
Source:
ShareClient.cs

Initializes a new instance of the ShareClient class.

Note that token credential authentication is only compatible with the Azure.Storage.Files.Shares.ShareClient.GetPermission(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.GetPermissionAsync(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.CreatePermission(System.String,System.Threading.CancellationToken), and Azure.Storage.Files.Shares.ShareClient.CreatePermissionAsync(System.String,System.Threading.CancellationToken) share-level operations.

public ShareClient (Uri shareUri, Azure.AzureSasCredential credential, Azure.Storage.Files.Shares.ShareClientOptions options = default);
new Azure.Storage.Files.Shares.ShareClient : Uri * Azure.AzureSasCredential * Azure.Storage.Files.Shares.ShareClientOptions -> Azure.Storage.Files.Shares.ShareClient
Public Sub New (shareUri As Uri, credential As AzureSasCredential, Optional options As ShareClientOptions = Nothing)

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.

Applies to

ShareClient(Uri, TokenCredential, ShareClientOptions)

Source:
ShareClient.cs
Source:
ShareClient.cs

Initializes a new instance of the ShareClient class.

Note that the only share-level operations that support token credential authentication are Azure.Storage.Files.Shares.ShareClient.CreatePermission(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.CreatePermissionAsync(System.String,System.Threading.CancellationToken), Azure.Storage.Files.Shares.ShareClient.GetPermission(System.String,System.Threading.CancellationToken), and Azure.Storage.Files.Shares.ShareClient.GetPermissionAsync(System.String,System.Threading.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, Azure.Core.TokenCredential credential, Azure.Storage.Files.Shares.ShareClientOptions options = default);
new Azure.Storage.Files.Shares.ShareClient : Uri * Azure.Core.TokenCredential * Azure.Storage.Files.Shares.ShareClientOptions -> Azure.Storage.Files.Shares.ShareClient
Public Sub New (shareUri As Uri, credential As TokenCredential, Optional options As ShareClientOptions = Nothing)

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.

Applies to

ShareClient(Uri, StorageSharedKeyCredential, ShareClientOptions)

Source:
ShareClient.cs
Source:
ShareClient.cs

Initializes a new instance of the ShareClient class.

public ShareClient (Uri shareUri, Azure.Storage.StorageSharedKeyCredential credential, Azure.Storage.Files.Shares.ShareClientOptions options = default);
new Azure.Storage.Files.Shares.ShareClient : Uri * Azure.Storage.StorageSharedKeyCredential * Azure.Storage.Files.Shares.ShareClientOptions -> Azure.Storage.Files.Shares.ShareClient
Public Sub New (shareUri As Uri, credential As StorageSharedKeyCredential, Optional options As ShareClientOptions = Nothing)

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.

Applies to