Class BlobClient
The BlobClient allows you to manipulate Azure Storage blobs.
Inherited Members
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Storage.Blobs.dll
Syntax
public class BlobClient : Azure.Storage.Blobs.Specialized.BlobBaseClient
Constructors
BlobClient()
Initializes a new instance of the BlobClient class for mocking.
Declaration
protected BlobClient ();
BlobClient(Uri, BlobClientOptions)
Initializes a new instance of the BlobClient class.
Declaration
public BlobClient (Uri blobUri, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
|
System.Uri
blobUri
A System.Uri referencing the blob that includes the name of the account, the name of the container, and the name of the blob. This is likely to be similar to "https://{account_name}.blob.core.windows.net/{container_name}/{blob_name}". |
|
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
BlobClient(String, String, String)
Initializes a new instance of the BlobClient class.
Declaration
public BlobClient (string connectionString, string blobContainerName, string blobName);
Parameters
|
System.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, Configure Azure Storage connection strings. |
|
System.String
blobContainerName
The name of the container containing this blob. |
|
System.String
blobName
The name of this blob. |
BlobClient(Uri, AzureSasCredential, BlobClientOptions)
Initializes a new instance of the BlobClient class.
Declaration
public BlobClient (Uri blobUri, Azure.AzureSasCredential credential, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
|
System.Uri
blobUri
A System.Uri referencing the blob that includes the name of the account, the name of the container, and the name of the blob. This is likely to be similar to "https://{account_name}.blob.core.windows.net/{container_name}/{blob_name}". Must not contain shared access signature, which should be passed in the second parameter. |
|
Azure.AzureSasCredential
credential
The shared access signature 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. |
Remarks
This constructor should only be used when shared access signature needs to be updated during lifespan of this client.
BlobClient(Uri, TokenCredential, BlobClientOptions)
Initializes a new instance of the BlobClient class.
Declaration
public BlobClient (Uri blobUri, Azure.Core.TokenCredential credential, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
|
System.Uri
blobUri
A System.Uri referencing the blob that includes the name of the account, the name of the container, and the name of the blob. This is likely to be similar to "https://{account_name}.blob.core.windows.net/{container_name}/{blob_name}". |
|
Azure.Core.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. |
BlobClient(Uri, StorageSharedKeyCredential, BlobClientOptions)
BlobClient(String, String, String, BlobClientOptions)
Initializes a new instance of the BlobClient class.
Declaration
public BlobClient (string connectionString, string blobContainerName, string blobName, Azure.Storage.Blobs.BlobClientOptions options);
Parameters
|
System.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, Configure Azure Storage connection strings. |
|
System.String
blobContainerName
The name of the container containing this blob. |
|
System.String
blobName
The name of this blob. |
|
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
Methods
OpenWrite(Boolean, BlobOpenWriteOptions, CancellationToken)
Opens a stream for writing to the blob. If the blob exists, it will be overwritten.
Declaration
public virtual System.IO.Stream OpenWrite (bool overwrite, Azure.Storage.Blobs.Models.BlobOpenWriteOptions options = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.Boolean
overwrite
Whether an existing blob should be deleted and recreated. The only valid value for this operation is true. |
|
BlobOpenWriteOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.IO.Stream
A stream to write to the Append Blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
OpenWriteAsync(Boolean, BlobOpenWriteOptions, CancellationToken)
Opens a stream for writing to the blob. If the blob exists, it will be overwritten.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<System.IO.Stream> OpenWriteAsync (bool overwrite, Azure.Storage.Blobs.Models.BlobOpenWriteOptions options = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.Boolean
overwrite
Whether an existing blob should be deleted and recreated. The only valid value for this operation is true. |
|
BlobOpenWriteOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<System.IO.Stream>
A stream to write to the Append Blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(String, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken)
The Upload(String, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through BlobRequestConditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.ComponentModel.EditorBrowsable]
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (string path, Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, IProgress<long> progressHandler = null, Nullable<Azure.Storage.Blobs.Models.AccessTier> accessTier = null, Azure.Storage.StorageTransferOptions transferOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the block blob. |
|
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this block blob. |
|
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the creation of this new block blob. |
|
System.IProgress<System.Int64>
progressHandler
Optional System.IProgress to provide progress updates about data transfers. |
|
System.Nullable<AccessTier>
accessTier
Optional AccessTier Indicates the tier to be set on the blob. |
|
Azure.Storage.StorageTransferOptions
transferOptions
Optional Azure.Storage.StorageTransferOptions to configure parallel transfer behavior. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(Stream, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken)
The Upload(Stream, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through BlobRequestConditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, Put Blob.
Declaration
[System.ComponentModel.EditorBrowsable]
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (System.IO.Stream content, Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, IProgress<long> progressHandler = null, Nullable<Azure.Storage.Blobs.Models.AccessTier> accessTier = null, Azure.Storage.StorageTransferOptions transferOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the block blob. |
|
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this block blob. |
|
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the creation of this new block blob. |
|
System.IProgress<System.Int64>
progressHandler
Optional System.IProgress to provide progress updates about data transfers. |
|
System.Nullable<AccessTier>
accessTier
Optional AccessTier Indicates the tier to be set on the blob. |
|
Azure.Storage.StorageTransferOptions
transferOptions
Optional Azure.Storage.StorageTransferOptions to configure parallel transfer behavior. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(String, BlobUploadOptions, CancellationToken)
The Upload(String, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through Conditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (string path, Azure.Storage.Blobs.Models.BlobUploadOptions options, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
BlobUploadOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(Stream, Boolean, CancellationToken)
The Upload(Stream, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (System.IO.Stream content, bool overwrite = false, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
System.Boolean
overwrite
Whether the upload should overwrite any existing blobs. The default value is false. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(Stream, BlobUploadOptions, CancellationToken)
The Upload(Stream, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through Conditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (System.IO.Stream content, Azure.Storage.Blobs.Models.BlobUploadOptions options, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
BlobUploadOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(BinaryData, Boolean, CancellationToken)
The Upload(BinaryData, Boolean, CancellationToken) operation
creates a new block blob or throws if the blob already exists.
Setting overwrite to true allows updating the
content of an existing block blob. Updating an existing block blob
overwrites any existing metadata on the blob.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (BinaryData content, bool overwrite = false, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.BinaryData
content
A System.IO.Stream containing the content to upload. |
|
System.Boolean
overwrite
Whether the upload should overwrite any existing blobs. The default value is false. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(String, Boolean, CancellationToken)
The Upload(String, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (string path, bool overwrite = false, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
System.Boolean
overwrite
Whether the upload should overwrite any existing blobs. The default value is false. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(String, CancellationToken)
The Upload(String, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (string path, System.Threading.CancellationToken cancellationToken);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(Stream, CancellationToken)
The Upload(Stream, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (System.IO.Stream content, System.Threading.CancellationToken cancellationToken);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(BinaryData, CancellationToken)
The Upload(BinaryData, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (BinaryData content, System.Threading.CancellationToken cancellationToken);
Parameters
|
System.BinaryData
content
A System.BinaryData containing the content to upload. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(String)
The Upload(String) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (string path);
Parameters
|
System.String
path
A file path containing the content to upload. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(Stream)
The Upload(Stream) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (System.IO.Stream content);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(BinaryData)
The Upload(BinaryData) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (BinaryData content);
Parameters
|
System.BinaryData
content
A System.BinaryData containing the content to upload. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
Upload(BinaryData, BlobUploadOptions, CancellationToken)
The Upload(BinaryData, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through Conditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo> Upload (BinaryData content, Azure.Storage.Blobs.Models.BlobUploadOptions options, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.BinaryData
content
A System.BinaryData containing the content to upload. |
|
BlobUploadOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
Azure.Response<BlobContentInfo>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(String, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken)
The UploadAsync(String, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through BlobRequestConditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.ComponentModel.EditorBrowsable]
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (string path, Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, IProgress<long> progressHandler = null, Nullable<Azure.Storage.Blobs.Models.AccessTier> accessTier = null, Azure.Storage.StorageTransferOptions transferOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the block blob. |
|
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this block blob. |
|
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the creation of this new block blob. |
|
System.IProgress<System.Int64>
progressHandler
Optional System.IProgress to provide progress updates about data transfers. |
|
System.Nullable<AccessTier>
accessTier
Optional AccessTier Indicates the tier to be set on the blob. |
|
Azure.Storage.StorageTransferOptions
transferOptions
Optional Azure.Storage.StorageTransferOptions to configure parallel transfer behavior. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(Stream, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken)
The UploadAsync(Stream, BlobHttpHeaders, IDictionary<String,String>, BlobRequestConditions, IProgress<Int64>, Nullable<AccessTier>, StorageTransferOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through BlobRequestConditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.ComponentModel.EditorBrowsable]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (System.IO.Stream content, Azure.Storage.Blobs.Models.BlobHttpHeaders httpHeaders = null, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, IProgress<long> progressHandler = null, Nullable<Azure.Storage.Blobs.Models.AccessTier> accessTier = null, Azure.Storage.StorageTransferOptions transferOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
BlobHttpHeaders
httpHeaders
Optional standard HTTP header properties that can be set for the block blob. |
|
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this block blob. |
|
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the creation of this new block blob. |
|
System.IProgress<System.Int64>
progressHandler
Optional System.IProgress to provide progress updates about data transfers. |
|
System.Nullable<AccessTier>
accessTier
Optional AccessTier Indicates the tier to be set on the blob. |
|
Azure.Storage.StorageTransferOptions
transferOptions
Optional Azure.Storage.StorageTransferOptions to configure parallel transfer behavior. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(String, Boolean, CancellationToken)
The UploadAsync(String, CancellationToken) operation
creates a new block blob or throws if the blob already exists.
Setting overwrite to true allows updating the
content of an existing block blob. Updating an existing block blob
overwrites any existing metadata on the blob.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (string path, bool overwrite = false, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
System.Boolean
overwrite
Whether the upload should overwrite any existing blobs. The default value is false. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(String, BlobUploadOptions, CancellationToken)
The UploadAsync(Stream, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through Conditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob..
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (string path, Azure.Storage.Blobs.Models.BlobUploadOptions options, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
BlobUploadOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(Stream, Boolean, CancellationToken)
The UploadAsync(Stream, Boolean, CancellationToken) operation
creates a new block blob or throws if the blob already exists.
Setting overwrite to true allows updating the
content of an existing block blob. Updating an existing block blob
overwrites any existing metadata on the blob.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (System.IO.Stream content, bool overwrite = false, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
System.Boolean
overwrite
Whether the upload should overwrite any existing blobs. The default value is false. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(Stream, BlobUploadOptions, CancellationToken)
The UploadAsync(Stream, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through Conditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (System.IO.Stream content, Azure.Storage.Blobs.Models.BlobUploadOptions options, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
BlobUploadOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(BinaryData, Boolean, CancellationToken)
The UploadAsync(BinaryData, Boolean, CancellationToken) operation
creates a new block blob or throws if the blob already exists.
Setting overwrite to true allows updating the
content of an existing block blob. Updating an existing block blob
overwrites any existing metadata on the blob.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (BinaryData content, bool overwrite = false, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.BinaryData
content
A System.BinaryData containing the content to upload. |
|
System.Boolean
overwrite
Whether the upload should overwrite any existing blobs. The default value is false. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(String, CancellationToken)
The UploadAsync(String, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (string path, System.Threading.CancellationToken cancellationToken);
Parameters
|
System.String
path
A file path containing the content to upload. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(Stream, CancellationToken)
The UploadAsync(Stream, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (System.IO.Stream content, System.Threading.CancellationToken cancellationToken);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(BinaryData, CancellationToken)
The UploadAsync(BinaryData, CancellationToken) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (BinaryData content, System.Threading.CancellationToken cancellationToken);
Parameters
|
System.BinaryData
content
A System.BinaryData containing the content to upload. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(String)
The UploadAsync(String) operation creates a new block blob or throws if the blob already exists.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (string path);
Parameters
|
System.String
path
A file path containing the content to upload. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(Stream)
The UploadAsync(Stream) operation creates a new block blob or throws an exception if the blob already exists. Updating an existing block blob overwrites any existing metadata on the blob.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (System.IO.Stream content);
Parameters
|
System.IO.Stream
content
A System.IO.Stream containing the content to upload. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(BinaryData)
The UploadAsync(BinaryData) operation creates a new block blob or throws an exception if the blob already exists. Updating an existing block blob overwrites any existing metadata on the blob.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (BinaryData content);
Parameters
|
System.BinaryData
content
A System.BinaryData containing the content to upload. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
UploadAsync(BinaryData, BlobUploadOptions, CancellationToken)
The UploadAsync(BinaryData, BlobUploadOptions, CancellationToken) operation overwrites the contents of the blob, creating a new block blob if none exists. Overwriting an existing block blob replaces any existing metadata on the blob.
Set access conditions through Conditions to avoid overwriting existing data.
For partial block blob updates and other advanced features, please see BlockBlobClient. To create or modify page or append blobs, please see PageBlobClient or AppendBlobClient.
For more information, see Put Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContentInfo>> UploadAsync (BinaryData content, Azure.Storage.Blobs.Models.BlobUploadOptions options, System.Threading.CancellationToken cancellationToken = null);
Parameters
|
System.BinaryData
content
A System.BinaryData containing the content to upload. |
|
BlobUploadOptions
options
Optional parameters. |
|
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
|
System.Threading.Tasks.Task<Azure.Response<BlobContentInfo>>
A Azure.Response describing the state of the updated block blob. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If multiple failures occur, an System.AggregateException will be thrown, containing each failure instance.
WithClientSideEncryptionOptionsCore(ClientSideEncryptionOptions)
Creates a new instance of the BlobClient class, maintaining all the same internals but specifying new Azure.Storage.ClientSideEncryptionOptions.
Declaration
protected internal virtual Azure.Storage.Blobs.BlobClient WithClientSideEncryptionOptionsCore (Azure.Storage.ClientSideEncryptionOptions clientSideEncryptionOptions);
Parameters
|
Azure.Storage.ClientSideEncryptionOptions
clientSideEncryptionOptions
New encryption options. Setting this to will clear client-side encryption.
|
Returns
|
BlobClient
New instance with provided options and same internals otherwise. |
WithCustomerProvidedKey(Nullable<CustomerProvidedKey>)
Initializes a new instance of the BlobClient
class with an identical System.Uri source but the specified
customerProvidedKey.
Declaration
public Azure.Storage.Blobs.BlobClient WithCustomerProvidedKey (Nullable<Azure.Storage.Blobs.Models.CustomerProvidedKey> customerProvidedKey);
Parameters
|
System.Nullable<CustomerProvidedKey>
customerProvidedKey
The customer provided key. |
Returns
|
BlobClient
A new BlobClient instance. |
Remarks
Pass null to remove the customer provide key in the returned BlobClient.
WithEncryptionScope(String)
Initializes a new instance of the BlobClient
class with an identical System.Uri source but the specified
encryptionScope.
Declaration
public Azure.Storage.Blobs.BlobClient WithEncryptionScope (string encryptionScope);
Parameters
|
System.String
encryptionScope
The encryption scope. |
Returns
|
BlobClient
A new BlobClient instance. |
Remarks
Pass null to remove the encryption scope in the returned BlobClient.
WithSnapshot(String)
Initializes a new instance of the BlobClient
class with an identical System.Uri source but the specified
snapshot timestamp.
For more information, see Create a snapshot of a blob.
Declaration
public Azure.Storage.Blobs.BlobClient WithSnapshot (string snapshot);
Parameters
|
System.String
snapshot
The snapshot identifier. |
Returns
|
BlobClient
A new BlobClient instance. |
Remarks
Pass null or empty string to remove the snapshot returning a URL
to the base blob.
WithVersion(String)
Initializes a new instance of the BlobClient
class with an identical System.Uri source but the specified
versionId timestamp.
Declaration
public Azure.Storage.Blobs.BlobClient WithVersion (string versionId);
Parameters
|
System.String
versionId
The version identifier. |
Returns
|
BlobClient
A new BlobClient instance. |
Remarks
Pass null or empty string to remove the version returning a URL
to the base blob.