I
InsightNexus

Class BlobServiceClient | Azure SDK for Net

Author

Andrew Henderson

Published Feb 16, 2026

The BlobServiceClient allows you to manipulate Azure Storage service resources and blob containers. The storage account provides the top-level namespace for the Blob service.

Inheritance

BlobServiceClient

Namespace: Azure.Storage.Blobs
Assembly: Azure.Storage.Blobs.dll
Syntax
public class BlobServiceClient

Constructors

BlobServiceClient()

Declaration
protected BlobServiceClient ();

BlobServiceClient(String)

Declaration
public BlobServiceClient (string connectionString);
Parameters
String connectionString

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

For more information, .

BlobServiceClient(String, BlobClientOptions)

Declaration
public BlobServiceClient (string connectionString, Azure.Storage.Blobs.BlobClientOptions options);
Parameters
String connectionString

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

For more information, .

BlobClientOptions options

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

BlobServiceClient(Uri, BlobClientOptions)

Declaration
public BlobServiceClient (Uri serviceUri, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
Uri serviceUri

A Uri referencing the blob service.

BlobClientOptions options

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

BlobServiceClient(Uri, TokenCredential, BlobClientOptions)

Declaration
public BlobServiceClient (Uri serviceUri, Azure.Core.TokenCredential credential, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
Uri serviceUri

A Uri referencing the blob service.

TokenCredential credential

The token credential used to sign requests.

BlobClientOptions options

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

BlobServiceClient(Uri, StorageSharedKeyCredential, BlobClientOptions)

Declaration
public BlobServiceClient (Uri serviceUri, Azure.Storage.StorageSharedKeyCredential credential, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
Uri serviceUri

A Uri referencing the blob service.

StorageSharedKeyCredential credential

The shared key credential used to sign requests.

BlobClientOptions options

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 service client.

Declaration
public string AccountName { get; }
Property Value

Uri

Gets the blob service's primary Uri endpoint.

Declaration
public virtual Uri Uri { get; }
Property Value

Methods

CreateBlobContainer(String, PublicAccessType, IDictionary<String,String>, CancellationToken)

Declaration
[Azure.Core.ForwardsClientCalls]
public virtual Azure.Response<Azure.Storage.Blobs.BlobContainerClient> CreateBlobContainer (string blobContainerName, Azure.Storage.Blobs.Models.PublicAccessType publicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IDictionary<string,string> metadata = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
String blobContainerName

The name of the container to create.

PublicAccessType publicAccessType

Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainerspecifies full public read access for container and blob data. Clients can enumerate blobs within the container via anonymous request, but cannot enumerate containers within the storage account. Blob specifies public read access for blobs. Blob data within this container can be read via anonymous request, but container data is not available. Clients cannot enumerate blobs within the container via anonymous request. None specifies that the container data is private to the account owner.

IDictionary<String,String> metadata

Optional custom metadata to set for this container.

CancellationToken cancellationToken

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

Returns

CreateBlobContainerAsync(String, PublicAccessType, IDictionary<String,String>, CancellationToken)

Declaration
[Azure.Core.ForwardsClientCalls]
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.BlobContainerClient>> CreateBlobContainerAsync (string blobContainerName, Azure.Storage.Blobs.Models.PublicAccessType publicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IDictionary<string,string> metadata = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
String blobContainerName

The name of the container to create.

PublicAccessType publicAccessType

Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainerspecifies full public read access for container and blob data. Clients can enumerate blobs within the container via anonymous request, but cannot enumerate containers within the storage account. Blob specifies public read access for blobs. Blob data within this container can be read via anonymous request, but container data is not available. Clients cannot enumerate blobs within the container via anonymous request. None specifies that the container data is private to the account owner.

IDictionary<String,String> metadata

Optional custom metadata to set for this container.

CancellationToken cancellationToken

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

Returns

DeleteBlobContainer(String, BlobRequestConditions, CancellationToken)

Declaration
[Azure.Core.ForwardsClientCalls]
public virtual Azure.Response DeleteBlobContainer (string blobContainerName, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

DeleteBlobContainerAsync(String, BlobRequestConditions, CancellationToken)

Declaration
[Azure.Core.ForwardsClientCalls]
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteBlobContainerAsync (string blobContainerName, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

GetAccountInfo(CancellationToken)

Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.AccountInfo> GetAccountInfo (System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

GetAccountInfoAsync(CancellationToken)

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.AccountInfo>> GetAccountInfoAsync (System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

GetBlobContainerClient(String)

Declaration
public virtual Azure.Storage.Blobs.BlobContainerClient GetBlobContainerClient (string blobContainerName);
Parameters
String blobContainerName

The name of the blob container to reference.

Returns

GetBlobContainers(BlobContainerTraits, String, CancellationToken)

The GetBlobContainers(BlobContainerTraits, String, CancellationToken) operation returns an async sequence of blob containers in the storage account. Enumerating the blob containers may make multiple requests to the service while fetching all the values. Containers are ordered lexicographically by name.

For more information, see .

Declaration
public virtual Azure.Pageable<Azure.Storage.Blobs.Models.BlobContainerItem> GetBlobContainers (Azure.Storage.Blobs.Models.BlobContainerTraits traits = Azure.Storage.Blobs.Models.BlobContainerTraits.None, string prefix = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobContainerTraits traits

Specifies trait options for shaping the blob containers.

String prefix

Specifies a string that filters the results to return only containers whose name begins with the specified prefix.

CancellationToken cancellationToken

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

Returns

GetBlobContainersAsync(BlobContainerTraits, String, CancellationToken)

Declaration
public virtual Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobContainerItem> GetBlobContainersAsync (Azure.Storage.Blobs.Models.BlobContainerTraits traits = Azure.Storage.Blobs.Models.BlobContainerTraits.None, string prefix = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobContainerTraits traits

Specifies trait options for shaping the blob containers.

String prefix

Specifies a string that filters the results to return only containers whose name begins with the specified prefix.

CancellationToken cancellationToken

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

Returns

GetProperties(CancellationToken)

The GetProperties(CancellationToken) operation gets the properties of a storage account’s blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.

For more information, see .

Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobServiceProperties> GetProperties (System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

GetPropertiesAsync(CancellationToken)

The GetPropertiesAsync(CancellationToken) operation gets the properties of a storage account’s blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.

For more information, see .

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobServiceProperties>> GetPropertiesAsync (System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

GetStatistics(CancellationToken)

The GetStatistics(CancellationToken) operation retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication (StandardRagrs) is enabled for the storage account.

For more information, see .

Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobServiceStatistics> GetStatistics (System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

GetStatisticsAsync(CancellationToken)

The GetStatisticsAsync(CancellationToken) operation retrieves statistics related to replication for the Blob service. It is only available on the secondary location endpoint when read-access geo-redundant replication (StandardRagrs) is enabled for the storage account.

For more information, see .

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobServiceStatistics>> GetStatisticsAsync (System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

GetUserDelegationKey(Nullable<DateTimeOffset>, DateTimeOffset, CancellationToken)

Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.UserDelegationKey> GetUserDelegationKey (Nullable<DateTimeOffset> startsOn, DateTimeOffset expiresOn, System.Threading.CancellationToken cancellationToken = null);
Parameters
Nullable<DateTimeOffset> startsOn

Start time for the key's validity, with null indicating an immediate start. The time should be specified in UTC.

DateTimeOffset expiresOn

Expiration of the key's validity. The time should be specified in UTC.

CancellationToken cancellationToken

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

Returns

GetUserDelegationKeyAsync(Nullable<DateTimeOffset>, DateTimeOffset, CancellationToken)

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.UserDelegationKey>> GetUserDelegationKeyAsync (Nullable<DateTimeOffset> startsOn, DateTimeOffset expiresOn, System.Threading.CancellationToken cancellationToken = null);
Parameters
Nullable<DateTimeOffset> startsOn

Start time for the key's validity, with null indicating an immediate start. The time should be specified in UTC.

DateTimeOffset expiresOn

Expiration of the key's validity. The time should be specified in UTC.

CancellationToken cancellationToken

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

Returns

SetProperties(BlobServiceProperties, CancellationToken)

The SetProperties(BlobServiceProperties, CancellationToken) operation sets properties for a storage account’s Blob service endpoint, including properties for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. You can also use this operation to set the default request version for all incoming requests to the Blob service that do not have a version specified.

For more information, see .

Declaration
public virtual Azure.Response SetProperties (Azure.Storage.Blobs.Models.BlobServiceProperties properties, System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns

SetPropertiesAsync(BlobServiceProperties, CancellationToken)

The SetPropertiesAsync(BlobServiceProperties, CancellationToken) operation sets properties for a storage account’s Blob service endpoint, including properties for Storage Analytics, CORS (Cross-Origin Resource Sharing) rules and soft delete settings. You can also use this operation to set the default request version for all incoming requests to the Blob service that do not have a version specified.

For more information, see .

Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response> SetPropertiesAsync (Azure.Storage.Blobs.Models.BlobServiceProperties properties, System.Threading.CancellationToken cancellationToken = null);
Parameters
Returns