Class BlobContainerClient
The BlobContainerClient allows you to manipulate Azure Storage containers and their blobs.
Inheritance
Namespace: System.Dynamic.ExpandoObject
Assembly: Azure.Storage.Blobs.dll
Syntax
public class BlobContainerClient
Constructors
BlobContainerClient()
Initializes a new instance of the BlobContainerClient class for mocking.
Declaration
protected BlobContainerClient ();
BlobContainerClient(String, String)
Initializes a new instance of the BlobContainerClient class.
Declaration
public BlobContainerClient (string connectionString, string blobContainerName);
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 blob container in the storage account to reference. |
BlobContainerClient(Uri, BlobClientOptions)
Initializes a new instance of the BlobContainerClient class.
Declaration
public BlobContainerClient (Uri blobContainerUri, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
System.Uri
blobContainerUri
A Uri referencing the blob container that includes the name of the account and the name of the container. This is likely to be similar to "https://{account_name}.blob.core.windows.net/{container_name}". |
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
BlobContainerClient(String, String, BlobClientOptions)
Initializes a new instance of the BlobContainerClient class.
Declaration
public BlobContainerClient (string connectionString, string blobContainerName, 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 in the storage account to reference. |
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
BlobContainerClient(Uri, AzureSasCredential, BlobClientOptions)
Initializes a new instance of the BlobContainerClient class.
Declaration
public BlobContainerClient (Uri blobContainerUri, Azure.AzureSasCredential credential, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
System.Uri
blobContainerUri
A Uri referencing the blob container that includes the name of the account and the name of the container. This is likely to be similar to "https://{account_name}.blob.core.windows.net/{container_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.
BlobContainerClient(Uri, TokenCredential, BlobClientOptions)
Initializes a new instance of the BlobContainerClient class.
Declaration
public BlobContainerClient (Uri blobContainerUri, Azure.Core.TokenCredential credential, Azure.Storage.Blobs.BlobClientOptions options = null);
Parameters
System.Uri
blobContainerUri
A Uri referencing the blob container that includes the name of the account and the name of the container. This is likely to be similar to "https://{account_name}.blob.core.windows.net/{container_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. |
BlobContainerClient(Uri, StorageSharedKeyCredential, BlobClientOptions)
Fields
LogsBlobContainerName
The Azure Storage name used to identify a storage account's logs container.
Declaration
public static readonly string LogsBlobContainerName;
Field Value
System.String
|
RootBlobContainerName
The Azure Storage name used to identify a storage account's root container.
Declaration
public static readonly string RootBlobContainerName;
Field Value
System.String
|
WebBlobContainerName
The Azure Storage name used to identify a storage account's web content container.
Declaration
public static readonly string WebBlobContainerName;
Field Value
System.String
|
Properties
AccountName
Gets the Storage account name corresponding to the container client.
Declaration
public virtual string AccountName { get; }
Property Value
System.String
|
CanGenerateSasUri
Determines whether the client is able to generate a SAS. If the client is authenticated with a Azure.Storage.StorageSharedKeyCredential.
Declaration
public bool CanGenerateSasUri { get; }
Property Value
System.Boolean
|
Name
Gets the name of the container.
Declaration
public virtual string Name { get; }
Property Value
System.String
|
Uri
Gets the container's primary Uri endpoint.
Declaration
public virtual Uri Uri { get; }
Property Value
System.Uri
|
Methods
Create(PublicAccessType, IDictionary<String,String>, CancellationToken)
The Create(PublicAccessType, IDictionary<String,String>, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, the operation fails.
For more information, see Create Container.
Declaration
[System.ComponentModel.EditorBrowsable]
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo> Create (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType, System.Collections.Generic.IDictionary<string,string> metadata, System.Threading.CancellationToken cancellationToken);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerInfo>
A Azure.Response describing the newly created blob container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
Create(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)
The Create(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, the operation fails.
For more information, see Create Container.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo> Create (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobContainerEncryptionScopeOptions encryptionScopeOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
BlobContainerEncryptionScopeOptions
encryptionScopeOptions
Optional encryption scope options to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerInfo>
A Azure.Response describing the newly created blob container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
CreateAsync(PublicAccessType, IDictionary<String,String>, CancellationToken)
The CreateAsync(PublicAccessType, IDictionary<String,String>, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, the operation fails.
For more information, see Create Container.
Declaration
[System.ComponentModel.EditorBrowsable]
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>> CreateAsync (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType, System.Collections.Generic.IDictionary<string,string> metadata, System.Threading.CancellationToken cancellationToken);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerInfo>>
A Azure.Response describing the newly created container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
CreateAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)
The CreateAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, the operation fails.
For more information, see Create Container.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>> CreateAsync (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobContainerEncryptionScopeOptions encryptionScopeOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
BlobContainerEncryptionScopeOptions
encryptionScopeOptions
Optional encryption scope options to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerInfo>>
A Azure.Response describing the newly created container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
CreateClient(Uri, BlobClientOptions, HttpPipeline)
Initializes a new instance of the BlobContainerClient class.
Declaration
protected static Azure.Storage.Blobs.BlobContainerClient CreateClient (Uri containerUri, Azure.Storage.Blobs.BlobClientOptions options, Azure.Core.Pipeline.HttpPipeline pipeline);
Parameters
System.Uri
containerUri
A Uri referencing the block blob that includes the name of the account, the name of the container, and the name of the blob. |
BlobClientOptions
options
Optional client options that define the transport pipeline policies for authentication, retries, etc., that are applied to every request. |
Azure.Core.Pipeline.HttpPipeline
pipeline
The transport pipeline used to send every request. |
Returns
BlobContainerClient
New instance of the BlobContainerClient class. |
CreateIfNotExists(PublicAccessType, IDictionary<String,String>, CancellationToken)
The CreateIfNotExists(PublicAccessType, IDictionary<String,String>, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, it is not changed.
For more information, see Create Container.
Declaration
[System.ComponentModel.EditorBrowsable]
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo> CreateIfNotExists (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType, System.Collections.Generic.IDictionary<string,string> metadata, System.Threading.CancellationToken cancellationToken);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerInfo>
If the container does not already exist, a Azure.Response
describing the newly created container. If the container already exists, |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
CreateIfNotExists(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)
The CreateIfNotExists(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, it is not changed.
For more information, see Create Container.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo> CreateIfNotExists (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobContainerEncryptionScopeOptions encryptionScopeOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
BlobContainerEncryptionScopeOptions
encryptionScopeOptions
Optional encryption scope options to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerInfo>
If the container does not already exist, a Azure.Response
describing the newly created container. If the container already exists, |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
CreateIfNotExistsAsync(PublicAccessType, IDictionary<String,String>, CancellationToken)
The CreateIfNotExists(PublicAccessType, IDictionary<String,String>, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, it is not changed.
For more information, see Create Container.
Declaration
[System.ComponentModel.EditorBrowsable]
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>> CreateIfNotExistsAsync (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType, System.Collections.Generic.IDictionary<string,string> metadata, System.Threading.CancellationToken cancellationToken);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerInfo>>
A Azure.Response describing the newly created container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
CreateIfNotExistsAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken)
The CreateIfNotExistsAsync(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) operation creates a new container under the specified account. If the container with the same name already exists, it is not changed.
For more information, see Create Container.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>> CreateIfNotExistsAsync (Azure.Storage.Blobs.Models.PublicAccessType publicAccessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IDictionary<string,string> metadata = null, Azure.Storage.Blobs.Models.BlobContainerEncryptionScopeOptions encryptionScopeOptions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
PublicAccessType
publicAccessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Optional custom metadata to set for this container. |
BlobContainerEncryptionScopeOptions
encryptionScopeOptions
Optional encryption scope options to set for this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerInfo>>
A Azure.Response describing the newly created container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
Delete(BlobRequestConditions, CancellationToken)
The Delete(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.
For more information, see Delete Container.
Declaration
public virtual Azure.Response Delete (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the deletion of this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response
A Azure.Response if successful. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
DeleteAsync(BlobRequestConditions, CancellationToken)
The DeleteAsync(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion. The container and any blobs contained within it are later deleted during garbage collection.
For more information, see Delete Container.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteAsync (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the deletion of this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response>
A Azure.Response if successful. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
DeleteBlob(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)
The DeleteBlob(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection.
Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.
For more information, see Delete Blob.
Declaration
public virtual Azure.Response DeleteBlob (string blobName, Azure.Storage.Blobs.Models.DeleteSnapshotsOption snapshotsOption = Azure.Storage.Blobs.Models.DeleteSnapshotsOption.None, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String
blobName
The name of the blob to delete. |
DeleteSnapshotsOption
snapshotsOption
Specifies options for deleting blob snapshots. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on deleting this blob. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response
A Azure.Response on successfully deleting. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
DeleteBlobAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)
The DeleteBlobAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion. The blob is later deleted during garbage collection.
Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.
For more information, see Delete Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response> DeleteBlobAsync (string blobName, Azure.Storage.Blobs.Models.DeleteSnapshotsOption snapshotsOption = Azure.Storage.Blobs.Models.DeleteSnapshotsOption.None, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String
blobName
The name of the blob to delete. |
DeleteSnapshotsOption
snapshotsOption
Specifies options for deleting blob snapshots. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on deleting this blob. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response>
A Azure.Response on successfully deleting. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
DeleteBlobIfExists(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)
The DeleteBlobIfExists(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion, if the blob or snapshot exists. The blob is later deleted during garbage collection.
Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.
For more information, see Delete Blob.
Declaration
public virtual Azure.Response<bool> DeleteBlobIfExists (string blobName, Azure.Storage.Blobs.Models.DeleteSnapshotsOption snapshotsOption = Azure.Storage.Blobs.Models.DeleteSnapshotsOption.None, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String
blobName
The name of the blob to delete. |
DeleteSnapshotsOption
snapshotsOption
Specifies options for deleting blob snapshots. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on deleting this blob. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<System.Boolean>
A Azure.Response on successfully deleting. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
DeleteBlobIfExistsAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken)
The DeleteBlobIfExistsAsync(String, DeleteSnapshotsOption, BlobRequestConditions, CancellationToken) operation marks the specified blob or snapshot for deletion, if the blob or snapshot exists. The blob is later deleted during garbage collection.
Note that in order to delete a blob, you must delete all of its snapshots. You can delete both at the same time using IncludeSnapshots.
For more information, see Delete Blob.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> DeleteBlobIfExistsAsync (string blobName, Azure.Storage.Blobs.Models.DeleteSnapshotsOption snapshotsOption = Azure.Storage.Blobs.Models.DeleteSnapshotsOption.None, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String
blobName
The name of the blob to delete. |
DeleteSnapshotsOption
snapshotsOption
Specifies options for deleting blob snapshots. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on deleting this blob. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<System.Boolean>>
A Azure.Response on successfully deleting. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
DeleteIfExists(BlobRequestConditions, CancellationToken)
The DeleteIfExists(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion if it exists. The container and any blobs contained within it are later deleted during garbage collection.
For more information, see Delete Container.
Declaration
public virtual Azure.Response<bool> DeleteIfExists (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the deletion of this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<System.Boolean>
A Azure.Response Returns true if container exists and was deleted, return false otherwise. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
DeleteIfExistsAsync(BlobRequestConditions, CancellationToken)
The DeleteIfExistsAsync(BlobRequestConditions, CancellationToken) operation marks the specified container for deletion if it exists. The container and any blobs contained within it are later deleted during garbage collection.
For more information, see Delete Container.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> DeleteIfExistsAsync (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the deletion of this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<System.Boolean>>
A Azure.Response Returns true if container exists and was deleted, return false otherwise. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
Exists(CancellationToken)
The Exists(CancellationToken) operation can be called on a BlobContainerClient to see if the associated container exists on the storage account in the storage service.
Declaration
public virtual Azure.Response<bool> Exists (System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<System.Boolean>
Returns true if the container exists. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If you want to create the container if it doesn't exist, use CreateIfNotExists(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) instead.
ExistsAsync(CancellationToken)
The ExistsAsync(CancellationToken) operation can be called on a BlobContainerClient to see if the associated container exists on the storage account in the storage service.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<bool>> ExistsAsync (System.Threading.CancellationToken cancellationToken = null);
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<System.Boolean>>
Returns true if the container exists. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs. If you want to create the container if it doesn't exist, use CreateIfNotExists(PublicAccessType, IDictionary<String,String>, BlobContainerEncryptionScopeOptions, CancellationToken) instead.
GenerateSasUri(BlobSasBuilder)
The GenerateSasUri(BlobSasBuilder) 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.
Declaration
public virtual Uri GenerateSasUri (Azure.Storage.Sas.BlobSasBuilder builder);
Parameters
BlobSasBuilder
builder
Used to generate a Shared Access Signature (SAS). |
Returns
System.Uri
A Uri containing the SAS Uri. |
Remarks
A System.Exception will be thrown if a failure occurs.
GenerateSasUri(BlobContainerSasPermissions, DateTimeOffset)
The GenerateSasUri(BlobContainerSasPermissions, DateTimeOffset) returns a Uri that generates a Blob Container 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.
Declaration
public virtual Uri GenerateSasUri (Azure.Storage.Sas.BlobContainerSasPermissions permissions, DateTimeOffset expiresOn);
Parameters
BlobContainerSasPermissions
permissions
Required. Specifies the list of permissions to be associated with the SAS. See BlobContainerSasPermissions. |
System.DateTimeOffset
expiresOn
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
System.Uri
A Uri containing the SAS Uri. |
Remarks
A System.Exception will be thrown if a failure occurs.
GetAccessPolicy(BlobRequestConditions, CancellationToken)
The GetAccessPolicy(BlobRequestConditions, CancellationToken) operation gets the permissions for this container. The permissions indicate whether container data may be accessed publicly.
For more information, see Get Container ACL.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerAccessPolicy> GetAccessPolicy (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on getting the blob container's access policy. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerAccessPolicy>
A Azure.Response describing the container's access policy. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
GetAccessPolicyAsync(BlobRequestConditions, CancellationToken)
The GetAccessPolicyAsync(BlobRequestConditions, CancellationToken) operation gets the permissions for this container. The permissions indicate whether container data may be accessed publicly.
For more information, see Get Container ACL.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerAccessPolicy>> GetAccessPolicyAsync (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on getting the blob container's access policy. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerAccessPolicy>>
A Azure.Response describing the container's access policy. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
GetAppendBlobClientCore(String)
Create a new AppendBlobClient object by
concatenating blobName
to
the end of the Uri. The new
AppendBlobClient
uses the same request policy pipeline as the
BlobContainerClient.
Declaration
protected internal virtual Azure.Storage.Blobs.Specialized.AppendBlobClient GetAppendBlobClientCore (string blobName);
Parameters
System.String
blobName
The name of the append blob. |
Returns
AppendBlobClient
A new AppendBlobClient instance. |
GetBlobBaseClientCore(String)
Create a new BlobBaseClient object by appending
blobName
to the end of Uri. The
new BlobBaseClient uses the same request policy
pipeline as the BlobContainerClient.
Declaration
protected internal virtual Azure.Storage.Blobs.Specialized.BlobBaseClient GetBlobBaseClientCore (string blobName);
Parameters
System.String
blobName
The name of the blob. |
Returns
BlobBaseClient
A new BlobBaseClient instance. |
GetBlobClient(String)
Create a new BlobClient object by appending
blobName
to the end of Uri. The
new BlobClient uses the same request policy
pipeline as the BlobContainerClient.
Declaration
public virtual Azure.Storage.Blobs.BlobClient GetBlobClient (string blobName);
Parameters
System.String
blobName
The name of the blob. |
Returns
BlobClient
A new BlobClient instance. |
GetBlobLeaseClientCore(String)
Initializes a new instance of the BlobLeaseClient class.
Declaration
protected internal virtual Azure.Storage.Blobs.Specialized.BlobLeaseClient GetBlobLeaseClientCore (string leaseId);
Parameters
System.String
leaseId
An optional lease ID. If no lease ID is provided, a random lease ID will be created. |
Returns
BlobLeaseClient
|
GetBlobs(BlobTraits, BlobStates, String, CancellationToken)
The GetBlobs(BlobTraits, BlobStates, String, CancellationToken) operation returns an async sequence of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name.
For more information, see List Blobs.
Declaration
public virtual Azure.Pageable<Azure.Storage.Blobs.Models.BlobItem> GetBlobs (Azure.Storage.Blobs.Models.BlobTraits traits = Azure.Storage.Blobs.Models.BlobTraits.None, Azure.Storage.Blobs.Models.BlobStates states = Azure.Storage.Blobs.Models.BlobStates.None, string prefix = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobTraits
traits
Specifies trait options for shaping the blobs. |
BlobStates
states
Specifies state options for filtering the blobs. |
System.String
prefix
Specifies a string that filters the results to return only blobs
whose name begins with the specified |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Pageable<BlobItem>
An Azure.Pageable of BlobItem describing the blobs in the container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
GetBlobsAsync(BlobTraits, BlobStates, String, CancellationToken)
The GetBlobsAsync(BlobTraits, BlobStates, String, CancellationToken) operation returns an async sequence of blobs in this container. Enumerating the blobs may make multiple requests to the service while fetching all the values. Blobs are ordered lexicographically by name.
For more information, see List Blobs.
Declaration
public virtual Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobItem> GetBlobsAsync (Azure.Storage.Blobs.Models.BlobTraits traits = Azure.Storage.Blobs.Models.BlobTraits.None, Azure.Storage.Blobs.Models.BlobStates states = Azure.Storage.Blobs.Models.BlobStates.None, string prefix = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobTraits
traits
Specifies trait options for shaping the blobs. |
BlobStates
states
Specifies state options for filtering the blobs. |
System.String
prefix
Specifies a string that filters the results to return only blobs
whose name begins with the specified |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.AsyncPageable<BlobItem>
An Azure.AsyncPageable describing the blobs in the container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
GetBlobsByHierarchy(BlobTraits, BlobStates, String, String, CancellationToken)
The GetBlobsByHierarchy(BlobTraits, BlobStates, String, String, CancellationToken) operation returns
an async collection of blobs in this container. Enumerating the
blobs may make multiple requests to the service while fetching all
the values. Blobs are ordered lexicographically by name. A
delimiter
can be used to traverse a virtual
hierarchy of blobs as though it were a file system.
For more information, see List Blobs.
Declaration
public virtual Azure.Pageable<Azure.Storage.Blobs.Models.BlobHierarchyItem> GetBlobsByHierarchy (Azure.Storage.Blobs.Models.BlobTraits traits = Azure.Storage.Blobs.Models.BlobTraits.None, Azure.Storage.Blobs.Models.BlobStates states = Azure.Storage.Blobs.Models.BlobStates.None, string delimiter = null, string prefix = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobTraits
traits
Specifies trait options for shaping the blobs. |
BlobStates
states
Specifies state options for filtering the blobs. |
System.String
delimiter
A Note that each BlobPrefix element returned counts toward the maximum result, just as each Blob element does. |
System.String
prefix
Specifies a string that filters the results to return only blobs
whose name begins with the specified |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Pageable<BlobHierarchyItem>
An Azure.Pageable of BlobHierarchyItem describing the blobs in the container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
GetBlobsByHierarchyAsync(BlobTraits, BlobStates, String, String, CancellationToken)
The GetBlobsByHierarchyAsync(BlobTraits, BlobStates, String, String, CancellationToken) operation returns
an async collection of blobs in this container. Enumerating the
blobs may make multiple requests to the service while fetching all
the values. Blobs are ordered lexicographically by name. A
delimiter
can be used to traverse a virtual
hierarchy of blobs as though it were a file system.
For more information, see List Blobs.
Declaration
public virtual Azure.AsyncPageable<Azure.Storage.Blobs.Models.BlobHierarchyItem> GetBlobsByHierarchyAsync (Azure.Storage.Blobs.Models.BlobTraits traits = Azure.Storage.Blobs.Models.BlobTraits.None, Azure.Storage.Blobs.Models.BlobStates states = Azure.Storage.Blobs.Models.BlobStates.None, string delimiter = null, string prefix = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobTraits
traits
Specifies trait options for shaping the blobs. |
BlobStates
states
Specifies state options for filtering the blobs. |
System.String
delimiter
A Note that each BlobPrefix element returned counts toward the maximum result, just as each Blob element does. |
System.String
prefix
Specifies a string that filters the results to return only blobs
whose name begins with the specified |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.AsyncPageable<BlobHierarchyItem>
An Azure.AsyncPageable describing the blobs in the container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
GetBlockBlobClientCore(String)
Create a new BlockBlobClient object by
concatenating blobName
to
the end of the Uri. The new
BlockBlobClient
uses the same request policy pipeline as the
BlobContainerClient.
Declaration
protected internal virtual Azure.Storage.Blobs.Specialized.BlockBlobClient GetBlockBlobClientCore (string blobName);
Parameters
System.String
blobName
The name of the block blob. |
Returns
BlockBlobClient
A new BlockBlobClient instance. |
GetPageBlobClientCore(String)
Create a new PageBlobClient object by
concatenating blobName
to
the end of the Uri. The new
PageBlobClient
uses the same request policy pipeline as the
BlobContainerClient.
Declaration
protected internal virtual Azure.Storage.Blobs.Specialized.PageBlobClient GetPageBlobClientCore (string blobName);
Parameters
System.String
blobName
The name of the page blob. |
Returns
PageBlobClient
A new PageBlobClient instance. |
GetParentBlobServiceClientCore()
Create a new BlobServiceClient that pointing to this BlobContainerClient's blob service. The new BlobServiceClient uses the same request policy pipeline as the BlobContainerClient.
Declaration
protected internal virtual Azure.Storage.Blobs.BlobServiceClient GetParentBlobServiceClientCore ();
Returns
BlobServiceClient
A new BlobServiceClient instance. |
GetProperties(BlobRequestConditions, CancellationToken)
The GetProperties(BlobRequestConditions, CancellationToken) operation returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs.
For more information, see Get Container Properties.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerProperties> GetProperties (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on getting the blob container's properties. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerProperties>
A Azure.Response describing the container and its properties. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
GetPropertiesAsync(BlobRequestConditions, CancellationToken)
The GetPropertiesAsync(BlobRequestConditions, CancellationToken) operation returns all user-defined metadata and system properties for the specified container. The data returned does not include the container's list of blobs.
For more information, see Get Container Properties.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerProperties>> GetPropertiesAsync (Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on getting the blob container's properties. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerProperties>>
A Azure.Response describing the container and its properties. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
SetAccessPolicy(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken)
The SetAccessPolicy(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken) operation sets the permissions for the specified container. The permissions indicate whether blob container data may be accessed publicly.
For more information, see Set Container ACL.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo> SetAccessPolicy (Azure.Storage.Blobs.Models.PublicAccessType accessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IEnumerable<Azure.Storage.Blobs.Models.BlobSignedIdentifier> permissions = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
PublicAccessType
accessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IEnumerable<BlobSignedIdentifier>
permissions
Stored access policies that you can use to provide fine grained control over container permissions. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on setting this blob container's access policy. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerInfo>
A Azure.Response describing the updated container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
SetAccessPolicyAsync(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken)
The SetAccessPolicyAsync(PublicAccessType, IEnumerable<BlobSignedIdentifier>, BlobRequestConditions, CancellationToken) operation sets the permissions for the specified container. The permissions indicate whether blob container data may be accessed publicly.
For more information, see Set Container ACL.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>> SetAccessPolicyAsync (Azure.Storage.Blobs.Models.PublicAccessType accessType = Azure.Storage.Blobs.Models.PublicAccessType.None, System.Collections.Generic.IEnumerable<Azure.Storage.Blobs.Models.BlobSignedIdentifier> permissions = null, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
PublicAccessType
accessType
Optionally specifies whether data in the container may be accessed publicly and the level of access. BlobContainer specifies 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. |
System.Collections.Generic.IEnumerable<BlobSignedIdentifier>
permissions
Stored access policies that you can use to provide fine grained control over container permissions. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on setting this blob container's access policy. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerInfo>>
A Azure.Response describing the updated container. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
SetMetadata(IDictionary<String,String>, BlobRequestConditions, CancellationToken)
The SetMetadata(IDictionary<String,String>, BlobRequestConditions, CancellationToken) operation sets one or more user-defined name-value pairs for the specified container.
For more information, see Set Container Metadata.
Declaration
public virtual Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo> SetMetadata (System.Collections.Generic.IDictionary<string,string> metadata, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Custom metadata to set for this container. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the deletion of this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
Azure.Response<BlobContainerInfo>
A Azure.Response if successful. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
SetMetadataAsync(IDictionary<String,String>, BlobRequestConditions, CancellationToken)
The SetMetadataAsync(IDictionary<String,String>, BlobRequestConditions, CancellationToken) operation sets one or more user-defined name-value pairs for the specified container.
For more information, see Set Container Metadata.
Declaration
[System.Diagnostics.DebuggerStepThrough]
public virtual System.Threading.Tasks.Task<Azure.Response<Azure.Storage.Blobs.Models.BlobContainerInfo>> SetMetadataAsync (System.Collections.Generic.IDictionary<string,string> metadata, Azure.Storage.Blobs.Models.BlobRequestConditions conditions = null, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.Collections.Generic.IDictionary<System.String,System.String>
metadata
Custom metadata to set for this container. |
BlobRequestConditions
conditions
Optional BlobRequestConditions to add conditions on the deletion of this container. |
System.Threading.CancellationToken
cancellationToken
Optional System.Threading.CancellationToken to propagate notifications that the operation should be cancelled. |
Returns
System.Threading.Tasks.Task<Azure.Response<BlobContainerInfo>>
A Azure.Response if successful. |
Remarks
A Azure.RequestFailedException will be thrown if a failure occurs.
UploadBlob(String, Stream, CancellationToken)
The UploadBlobAsync(String, Stream, CancellationToken) operation creates a new block 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> UploadBlob (string blobName, System.IO.Stream content, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String
blobName
The name of the blob to upload. |
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 the blob already exists. To overwrite an existing block blob, get a BlobClient by calling GetBlobClient(String), and then call UploadAsync(Stream, Boolean, CancellationToken) with the override parameter set to true.
UploadBlobAsync(String, Stream, CancellationToken)
The UploadBlob(String, Stream, CancellationToken) operation creates a new block 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>> UploadBlobAsync (string blobName, System.IO.Stream content, System.Threading.CancellationToken cancellationToken = null);
Parameters
System.String
blobName
The name of the blob to upload. |
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 the blob already exists. To overwrite an existing block blob, get a BlobClient by calling GetBlobClient(String), and then call Upload(Stream, Boolean, CancellationToken) with the override parameter set to true.