BlobServiceClientBuilder Class


This class provides a fluent builder API to help aid the configuration and instantiation of BlobServiceClient and BlobServiceAsyncClient, call buildClient() and buildAsyncClient() respectively to construct an instance of the desired client.

The following information must be provided on this builder:

  • the endpoint through .endpoint(), in the format of https://{accountName}
  • the credential through .credential() or .connectionString() if the container is not publicly accessible.
public final class BlobServiceClientBuilder

Inherited Members

java.lang.Object.clone() java.lang.Object.equals(java.lang.Object) java.lang.Object.finalize() java.lang.Object.getClass() java.lang.Object.hashCode() java.lang.Object.notify() java.lang.Object.notifyAll() java.lang.Object.toString() java.lang.Object.wait() java.lang.Object.wait(long) java.lang.Object.wait(long,int)



Creates a builder instance that is able to configure and construct BlobServiceClient and BlobServiceAsyncClient.


addPolicy(HttpPipelinePolicy pipelinePolicy)

Adds a pipeline policy to apply on each request sent. The policy will be added after the retry policy. If the method is called multiple times, all policies will be added and their order preserved.

blobContainerEncryptionScope(BlobContainerEncryptionScope blobContainerEncryptionScope)

Sets the BlobContainerEncryptionScope that is used to determine how blob contents are encrypted on the server.

clientOptions(ClientOptions clientOptions)

Sets the client options for all the requests made through the client.

configuration(Configuration configuration)

Sets the configuration object used to retrieve environment configuration values during building of the client.

connectionString(String connectionString)

Sets the connection string to connect to the service.

credential(AzureSasCredential credential)

Sets the AzureSasCredential used to authorize requests sent to the service.

credential(TokenCredential credential)

Sets the TokenCredential used to authorize requests sent to the service.

credential(StorageSharedKeyCredential credential)

Sets the StorageSharedKeyCredential used to authorize requests sent to the service.

customerProvidedKey(CustomerProvidedKey customerProvidedKey)

Sets the CustomerProvidedKey that is used to encrypt blob contents on the server.

encryptionScope(String encryptionScope)

Sets the encryption scope that is used to encrypt blob contents on the server.

endpoint(String endpoint)

Sets the blob service endpoint, additionally parses it for information (SAS token)


Gets the default Storage whitelist log headers and query parameters.

httpClient(HttpClient httpClient)

Sets the HttpClient to use for sending a receiving requests to and from the service.

httpLogOptions(HttpLogOptions logOptions)

Sets the HttpLogOptions for service requests.

pipeline(HttpPipeline httpPipeline)

Sets the HttpPipeline to use for the service client. If pipeline is set, all other settings are ignored, aside from endpoint(String endpoint).

retryOptions(RequestRetryOptions retryOptions)

Sets the request retry options for all the requests made through the client.

sasToken(String sasToken)

Sets the SAS token used to authorize requests sent to the service.

serviceVersion(BlobServiceVersion version)

Sets the BlobServiceVersion that is used when making API requests.

If a service version is not provided, the service version that will be used will be the latest known service version based on the version of the client library being used. If no service version is specified, updating to a newer version of the client library will have the result of potentially moving to a newer service version.

Targeting a specific service version may also mean that the service will return an error for newer APIs.

Applies to