az storage blob

Manage object storage for unstructured data (blobs).

Please specify one of the following authentication parameters for your commands: --auth-mode, --account-key, --connection-string, --sas-token. You also can use corresponding environment variables to store your authentication credentials, e.g. AZURE_STORAGE_KEY, AZURE_STORAGE_CONNECTION_STRING and AZURE_STORAGE_SAS_TOKEN.

Commands

az storage blob copy

Manage blob copy operations. Use az storage blob show to check the status of the blobs.

az storage blob copy cancel

Aborts a pending copy_blob operation, and leaves a destination blob with zero length and full metadata.

az storage blob copy start

Copies a blob asynchronously. Use az storage blob show to check the status of the blobs.

az storage blob copy start-batch

Copy multiple blobs to a blob container. Use az storage blob show to check the status of the blobs.

az storage blob delete

Mark a blob or snapshot for deletion.

az storage blob delete-batch

Delete blobs from a blob container recursively.

az storage blob download

Downloads a blob to a file path, with automatic chunking and progress notifications.

az storage blob download-batch

Download blobs from a blob container recursively.

az storage blob exists

Check for the existence of a blob in a container.

az storage blob generate-sas

Generate a shared access signature for the blob.

az storage blob incremental-copy

Manage blob incremental copy operations.

az storage blob incremental-copy cancel

Aborts a pending copy_blob operation, and leaves a destination blob with zero length and full metadata.

az storage blob incremental-copy start

Copies an incremental copy of a blob asynchronously.

az storage blob lease

Manage storage blob leases.

az storage blob lease acquire

Request a new lease.

az storage blob lease break

Break the lease, if the container or blob has an active lease.

az storage blob lease change

Change the lease ID of an active lease.

az storage blob lease release

Release the lease.

az storage blob lease renew

Renew the lease.

az storage blob list

List blobs in a given container.

az storage blob metadata

Manage blob metadata.

az storage blob metadata show

Returns all user-defined metadata for the specified blob or snapshot.

az storage blob metadata update

Sets user-defined metadata for the specified blob as one or more name-value pairs.

az storage blob restore

Restore blobs in the specified blob ranges.

az storage blob rewrite

Create a new Block Blob where the content of the blob is read from a given URL.

az storage blob service-properties

Manage storage blob service properties.

az storage blob service-properties delete-policy

Manage storage blob delete-policy service properties.

az storage blob service-properties delete-policy show

Show the storage blob delete-policy.

az storage blob service-properties delete-policy update

Update the storage blob delete-policy.

az storage blob service-properties show

Gets the properties of a storage account's Blob service, including Azure Storage Analytics.

az storage blob service-properties update

Update storage blob service properties.

az storage blob set-tier

Set the block or page tiers on the blob.

az storage blob show

Get the details of a blob.

az storage blob snapshot

Creates a read-only snapshot of a blob.

az storage blob sync

Sync blobs recursively to a storage blob container.

az storage blob undelete

The undelete Blob operation restores the contents and metadata of soft deleted blob or snapshot.

az storage blob update

Sets system properties on the blob.

az storage blob upload

Upload a file to a storage blob.

az storage blob upload-batch

Upload files from a local directory to a blob container.

az storage blob url

Create the url to access a blob.

az storage blob filter

List blobs across all containers whose tags match a given search expression.

az storage blob tag

Manage blob tags.

az storage blob tag list

Get tags on a blob or specific blob version, or snapshot.

az storage blob tag set

Set tags on a blob or specific blob version, but not snapshot.

az storage blob access

Manage the access control properties of a blob when Hierarchical Namespace is enabled.

az storage blob access set

Set the access control properties of a blob.

az storage blob access show

Show the access control properties of a blob.

az storage blob access update

Update the access control properties of a blob.

az storage blob directory

Manage blob directories in storage account container.

az storage blob directory access

Manage the access control properties of a directory when Hierarchical Namespace is enabled.

az storage blob directory access set

Set the access control properties of a directory.

az storage blob directory access show

Show the access control properties of a directory.

az storage blob directory access update

Update the access control properties of a directory.

az storage blob directory create

Create a storage blob directory in a storage container.

az storage blob directory delete

Delete a storage blob directory in a storage container.

az storage blob directory download

Download blobs to a local file path.

az storage blob directory exists

Check for the existence of a blob directory in a storage container.

az storage blob directory list

List blobs and blob subdirectories in a storage directory.

az storage blob directory metadata

Manage directory metadata.

az storage blob directory metadata show

Show all user-defined metadata for the specified blob directory.

az storage blob directory metadata update

Set user-defined metadata for the specified blob directory as one or more name-value pairs.

az storage blob directory move

Move a storage directory to another storage blob directory in a storage container.

az storage blob directory show

Show a storage blob directory properties in a storage container.

az storage blob directory upload

Upload blobs or subdirectories to a storage blob directory.

az storage blob move

Move a blob in a storage container.

az storage blob delete

Mark a blob or snapshot for deletion.

The blob is marked for later deletion during garbage collection. In order to delete a blob, all of its snapshots must also be deleted. Both can be removed at the same time.

az storage blob delete --container-name
                       --name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--connection-string]
                       [--delete-snapshots {include, only}]
                       [--if-match]
                       [--if-modified-since]
                       [--if-none-match]
                       [--if-unmodified-since]
                       [--lease-id]
                       [--sas-token]
                       [--snapshot]
                       [--subscription]
                       [--timeout]

Examples

Delete a blob.

az storage blob delete -c mycontainer -n MyBlob

Delete a blob using login credentials.

az storage blob delete -c mycontainer -n MyBlob --account-name mystorageaccount --auth-mode login

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--delete-snapshots

Required if the blob has associated snapshots.

accepted values: include, only
--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

Required if the blob has an active lease.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--snapshot

The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to delete.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob delete-batch

Delete blobs from a blob container recursively.

az storage blob delete-batch --source
                             [--account-key]
                             [--account-name]
                             [--auth-mode {key, login}]
                             [--connection-string]
                             [--delete-snapshots {include, only}]
                             [--dryrun]
                             [--if-match]
                             [--if-modified-since]
                             [--if-none-match]
                             [--if-unmodified-since]
                             [--lease-id]
                             [--pattern]
                             [--sas-token]
                             [--subscription]
                             [--timeout]

Examples

Delete all blobs ending with ".py" in a container that have not been modified for 10 days.

date=`date -d "10 days ago" '+%Y-%m-%dT%H:%MZ'`
az storage blob delete-batch -s mycontainer --account-name mystorageaccount --pattern *.py --if-unmodified-since $date --auth-mode login

Delete all the blobs in a directory named "dir" in a container named "mycontainer".

az storage blob delete-batch -s mycontainer --pattern dir/*

Delete the blobs with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in a container.

az storage blob delete-batch -s mycontainer --pattern cli-201[89]-??-??.txt

Delete all blobs with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in a container.

az storage blob delete-batch -s mycontainer --pattern cli-201[!89]-??-??.txt

Required Parameters

--source -s

The blob container from where the files will be deleted.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--delete-snapshots

Required if the blob has associated snapshots.

accepted values: include, only
--dryrun

Show the summary of the operations to be taken instead of actually deleting the file(s).

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*).

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

The active lease id for the blob.

--pattern

The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3.7/library/fnmatch.html.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob download

Downloads a blob to a file path, with automatic chunking and progress notifications.

Returns an instance of Blob with properties and metadata.

az storage blob download --container-name
                         --file
                         --name
                         [--account-key]
                         [--account-name]
                         [--auth-mode {key, login}]
                         [--connection-string]
                         [--end-range]
                         [--if-match]
                         [--if-modified-since]
                         [--if-none-match]
                         [--if-unmodified-since]
                         [--lease-id]
                         [--max-connections]
                         [--no-progress]
                         [--open-mode]
                         [--sas-token]
                         [--snapshot]
                         [--socket-timeout]
                         [--start-range]
                         [--subscription]
                         [--timeout]
                         [--validate-content]

Required Parameters

--container-name -c

The container name.

--file -f

Path of file to write out to.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--end-range

End of byte range to use for downloading a section of the blob. If end_range is given, start_range must be provided. The start_range and end_range params are inclusive. Ex: start_range=0, end_range=511 will download first 512 bytes of blob.

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

Required if the blob has an active lease.

--max-connections

If set to 2 or greater, an initial get will be done for the first self.MAX_SINGLE_GET_SIZE bytes of the blob. If this is the entire blob, the method returns at this point. If it is not, it will download the remaining data parallel using the number of threads equal to max_connections. Each chunk will be of size self.MAX_CHUNK_GET_SIZE. If set to 1, a single large get request will be done. This is not generally recommended but available if very few threads should be used, network requests are very expensive, or a non-seekable stream prevents parallel download. This may also be useful if many blobs are expected to be empty as an extra request is required for empty blobs if max_connections is greater than 1.

default value: 2
--no-progress

Include this flag to disable progress reporting for the command.

--open-mode

Mode to use when opening the file. Note that specifying append only open_mode prevents parallel download. So, max_connections must be set to 1 if this open_mode is used.

default value: wb
--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--snapshot

The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve.

--socket-timeout

The socket timeout(secs), used by the service to regulate data flow.

--start-range

Start of byte range to use for downloading a section of the blob. If no end_range is given, all bytes after the start_range will be downloaded. The start_range and end_range params are inclusive. Ex: start_range=0, end_range=511 will download first 512 bytes of blob.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

--validate-content

If set to true, validates an MD5 hash for each retrieved portion of the blob. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. Note that the service will only return transactional MD5s for chunks 4MB or less so the first get request will be of size self.MAX_CHUNK_GET_SIZE instead of self.MAX_SINGLE_GET_SIZE. If self.MAX_CHUNK_GET_SIZE was set to greater than 4MB an error will be thrown. As computing the MD5 takes processing time and more requests will need to be done due to the reduced chunk size there may be some increase in latency.

az storage blob download-batch

Download blobs from a blob container recursively.

az storage blob download-batch --destination
                               --source
                               [--account-key]
                               [--account-name]
                               [--auth-mode {key, login}]
                               [--connection-string]
                               [--dryrun]
                               [--max-connections]
                               [--no-progress]
                               [--pattern]
                               [--sas-token]
                               [--socket-timeout]
                               [--subscription]

Examples

Download all blobs that end with .py

az storage blob download-batch -d . --pattern *.py -s mycontainer --account-name mystorageaccount --account-key 00000000

Download all blobs in a directory named "dir" from container named "mycontainer".

az storage blob download-batch -d . -s mycontainer --pattern dir/*

Download all blobs with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in container to current path.

az storage blob download-batch -d . -s mycontainer --pattern cli-201[89]-??-??.txt

Download all blobs with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in container to current path.

az storage blob download-batch -d . -s mycontainer --pattern cli-201[!89]-??-??.txt

Required Parameters

--destination -d

The existing destination folder for this download operation.

--source -s

The blob container from where the files will be downloaded.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--dryrun

Show the summary of the operations to be taken instead of actually downloading the file(s).

--max-connections

Maximum number of parallel connections to use when the blob size exceeds 64MB.

default value: 2
--no-progress

Include this flag to disable progress reporting for the command.

--pattern

The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3.7/library/fnmatch.html.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--socket-timeout

The socket timeout(secs), used by the service to regulate data flow.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az storage blob exists

Check for the existence of a blob in a container.

az storage blob exists --container-name
                       --name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--connection-string]
                       [--sas-token]
                       [--snapshot]
                       [--subscription]
                       [--timeout]

Examples

Check for the existence of a blob in a container. (autogenerated)

az storage blob exists --account-key 00000000 --account-name MyAccount --container-name mycontainer --name MyBlob

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--snapshot

The snapshot parameter is an opaque DateTime value that, when present, specifies the snapshot.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob generate-sas

Generate a shared access signature for the blob.

az storage blob generate-sas --container-name
                             --name
                             [--account-key]
                             [--account-name]
                             [--as-user]
                             [--auth-mode {key, login}]
                             [--cache-control]
                             [--connection-string]
                             [--content-disposition]
                             [--content-encoding]
                             [--content-language]
                             [--content-type]
                             [--expiry]
                             [--full-uri]
                             [--https-only]
                             [--ip]
                             [--permissions]
                             [--policy-name]
                             [--start]
                             [--subscription]

Examples

Generate a sas token for a blob with read-only permissions.

end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage blob generate-sas -c myycontainer -n MyBlob --permissions r --expiry $end --https-only

Generate a sas token for a blob with ip range specified.

end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage blob generate-sas -c myycontainer -n MyBlob --ip "176.134.171.0-176.134.171.255" --permissions r --expiry $end --https-only

Generate a shared access signature for the blob. (autogenerated)

az storage blob generate-sas --account-key 00000000 --account-name MyStorageAccount --container-name mycontainer --expiry 2018-01-01T00:00:00Z --name MyBlob --permissions r

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--as-user

Indicates that this command return the SAS signed with the user delegation key. The expiry parameter and '--auth-mode login' are required if this argument is specified.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--cache-control

Response header value for Cache-Control when resource is accessedusing this shared access signature.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--content-disposition

Response header value for Content-Disposition when resource is accessedusing this shared access signature.

--content-encoding

Response header value for Content-Encoding when resource is accessedusing this shared access signature.

--content-language

Response header value for Content-Language when resource is accessedusing this shared access signature.

--content-type

Response header value for Content-Type when resource is accessedusing this shared access signature.

--expiry

Specifies the UTC datetime (Y-m-d'T'H:M'Z') at which the SAS becomes invalid. Do not use if a stored access policy is referenced with --id that specifies this value.

--full-uri

Indicates that this command return the full blob URI and the shared access signature token.

--https-only

Only permit requests made with the HTTPS protocol. If omitted, requests from both the HTTP and HTTPS protocol are permitted.

--ip

Specifies the IP address or range of IP addresses from which to accept requests. Supports only IPv4 style addresses.

--permissions

The permissions the SAS grants. Allowed values: (a)dd (c)reate (d)elete (r)ead (w)rite. Do not use if a stored access policy is referenced with --id that specifies this value. Can be combined.

--policy-name

The name of a stored access policy within the container's ACL.

--start

Specifies the UTC datetime (Y-m-d'T'H:M'Z') at which the SAS becomes valid. Do not use if a stored access policy is referenced with --id that specifies this value. Defaults to the time of the request.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az storage blob list

List blobs in a given container.

az storage blob list --container-name
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--connection-string]
                     [--delimiter]
                     [--include]
                     [--marker]
                     [--num-results]
                     [--prefix]
                     [--query-examples]
                     [--sas-token]
                     [--show-next-marker]
                     [--subscription]
                     [--timeout]

Examples

List all storage blobs in a container whose names start with 'foo'; will match names such as 'foo', 'foobar', and 'foo/bar'

az storage blob list -c mycontainer --prefix foo

Required Parameters

--container-name -c

The container name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--delimiter

When the request includes this parameter, the operation returns a BlobPrefix element in the result list that acts as a placeholder for all blobs whose names begin with the same substring up to the appearance of the delimiter character. The delimiter may be a single character or a string.

--include

Specify one or more additional datasets to include in the response. Options include: (c)opy, (d)eleted, (m)etadata, (s)napshots, (v)ersions, (t)ags. Can be combined.

--marker

A string value that identifies the portion of the list of containers to be returned with the next listing operation. The operation returns the NextMarker value within the response body if the listing operation did not return all containers remaining to be listed with the current page. If specified, this generator will begin returning results from the point where the previous generator stopped.

--num-results

Specify the maximum number to return. If the request does not specify num_results, or specifies a value greater than 5000, the server will return up to 5000 items. Note that if the listing operation crosses a partition boundary, then the service will return a continuation token for retrieving the remaining of the results. Provide "*" to return all.

default value: 5000
--prefix

Filter the results to return only blobs whose name begins with the specified prefix.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--show-next-marker

Show nextMarker in result when specified.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob restore

Restore blobs in the specified blob ranges.

az storage blob restore --account-name
                        --time-to-restore
                        [--blob-range]
                        [--no-wait]
                        [--resource-group]
                        [--subscription]

Examples

Restore blobs in two specified blob ranges. For examples, (container1/blob1, container2/blob2) and (container2/blob3..container2/blob4).

az storage blob restore --account-name mystorageaccount -g MyResourceGroup -t 2020-02-27T03:59:59Z -r container1/blob1 container2/blob2 -r container2/blob3 container2/blob4

Restore blobs in the specified blob ranges from account start to account end.

az storage blob restore --account-name mystorageaccount -g MyResourceGroup -t 2020-02-27T03:59:59Z -r "" ""

Restore blobs in the specified blob range.

time=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage blob restore --account-name mystorageaccount -g MyResourceGroup -t $time -r container0/blob1 container0/blob2

Restore blobs in the specified blob range without wait and query blob restore status with 'az storage account show'.

time=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage blob restore --account-name mystorageaccount -g MyResourceGroup -t $time -r container0/blob1 container0/blob2 --no-wait

Required Parameters

--account-name -n

The storage account name.

--time-to-restore -t

Restore blob to the specified time, which should be UTC datetime in (Y-m-d'T'H:M:S'Z').

Optional Parameters

--blob-range -r

Blob ranges to restore. You need to two values to specify start_range and end_range for each blob range, e.g. -r blob1 blob2. Note: Empty means account start as start range value, and means account end for end range.

--no-wait

Do not wait for the long-running operation to finish.

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az storage blob rewrite

Create a new Block Blob where the content of the blob is read from a given URL.

The content of an existing blob is overwritten with the new blob.

az storage blob rewrite --container-name
                        --name
                        --source-uri
                        [--account-key]
                        [--account-name]
                        [--auth-mode {key, login}]
                        [--connection-string]
                        [--encryption-scope]
                        [--if-match]
                        [--if-modified-since]
                        [--if-none-match]
                        [--if-unmodified-since]
                        [--lease-id]
                        [--sas-token]
                        [--subscription]
                        [--tags-condition]
                        [--tier {Archive, Cool, Hot, P10, P15, P20, P30, P4, P40, P50, P6, P60, P70, P80}]
                        [--timeout]

Examples

Update encryption scope for existing blob.

az storage blob rewrite --source-uri https://srcaccount.blob.core.windows.net/mycontainer/myblob?<sastoken> --encryption-scope newscope -c mycontainer -n myblob --account-name mystorageaccount --account-key 0000-0000

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

--source-uri -u

A URL of up to 2 KB in length that specifies a file or blob. The value should be URL-encoded as it would appear in a request URI. If the source is in another account, the source must either be public or must be authenticated via a shared access signature. If the source is public, no authentication is required.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--encryption-scope

A predefined encryption scope used to encrypt the data on the service. An encryption scope can be created using the Management API and referenced here by name. If a default encryption scope has been defined at the container, this value will override it if the container-level scope is configured to allow overrides. Otherwise an error will be raised.

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

Required if the blob has an active lease. Value can be a BlobLeaseClient object or the lease ID as a string.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags-condition

Specify a SQL where clause on blob tags to operate only on blobs with a matching value.

--tier

A standard blob tier value to set the blob to. For this version of the library, this is only applicable to block blobs on standard storage accounts.

accepted values: Archive, Cool, Hot, P10, P15, P20, P30, P4, P40, P50, P6, P60, P70, P80
--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob set-tier

Set the block or page tiers on the blob.

For block blob this command only supports block blob on standard storage accounts. For page blob, this command only supports for page blobs on premium accounts.

az storage blob set-tier --container-name
                         --name
                         --tier
                         [--account-key]
                         [--account-name]
                         [--auth-mode {key, login}]
                         [--connection-string]
                         [--rehydrate-priority {High, Standard}]
                         [--sas-token]
                         [--subscription]
                         [--timeout]
                         [--type {block, page}]

Examples

Set the block or page tiers on the blob. (autogenerated)

az storage blob set-tier --account-key 00000000 --account-name MyAccount --container-name mycontainer --name MyBlob --tier P10

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

--tier

The tier value to set the blob to.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--rehydrate-priority -r

Indicate the priority with which to rehydrate an archived blob. The priority can be set on a blob only once, default value is Standard.

accepted values: High, Standard
--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

The timeout parameter is expressed in seconds. This method may make multiple calls to the Azure service and the timeout will apply to each call individually.

--type -t

The blob type.

accepted values: block, page
default value: block

az storage blob show

Get the details of a blob.

az storage blob show --container-name
                     --name
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--connection-string]
                     [--if-match]
                     [--if-modified-since]
                     [--if-none-match]
                     [--if-unmodified-since]
                     [--lease-id]
                     [--query-examples]
                     [--sas-token]
                     [--snapshot]
                     [--subscription]
                     [--tags-condition]
                     [--timeout]

Examples

Show all properties of a blob.

az storage blob show -c mycontainer -n MyBlob

Get the details of a blob (autogenerated)

az storage blob show --account-name mystorageccount --account-key 00000000 --container-name mycontainer --name MyBlob

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

Required if the blob has an active lease.

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--snapshot

The snapshot parameter is an opaque DateTime value that, when present, specifies the blob snapshot to retrieve.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tags-condition

Specify a SQL where clause on blob tags to operate only on blobs with a matching value.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob snapshot

Creates a read-only snapshot of a blob.

az storage blob snapshot --container-name
                         --name
                         [--account-key]
                         [--account-name]
                         [--auth-mode {key, login}]
                         [--connection-string]
                         [--if-match]
                         [--if-modified-since]
                         [--if-none-match]
                         [--if-unmodified-since]
                         [--lease-id]
                         [--metadata]
                         [--sas-token]
                         [--subscription]
                         [--timeout]

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

Required if the blob has an active lease.

--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob sync

Sync blobs recursively to a storage blob container.

az storage blob sync --container
                     --source
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--connection-string]
                     [--destination]
                     [--exclude-path]
                     [--exclude-pattern]
                     [--include-pattern]
                     [--sas-token]
                     [--subscription]

Examples

Sync a single blob to a container.

az storage blob sync -c mycontainer -s "path/to/file" -d NewBlob

Sync a directory to a container.

az storage blob sync -c mycontainer --account-name mystorageccount --account-key 00000000 -s "path/to/directory"

Required Parameters

--container -c

The sync destination container.

--source -s

The source file path to sync from.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--destination -d

The destination path that will be prepended to the blob name.

--exclude-path

Exclude these paths. This option does not support wildcard characters (*). Checks relative path prefix. For example: myFolder;myFolder/subDirName/file.pdf.

--exclude-pattern

Exclude these files where the name matches the pattern list. For example: *.jpg;*.pdf;exactName. This option supports wildcard characters (*).

--include-pattern

Include only these files where the name matches the pattern list. For example: *.jpg;*.pdf;exactName. This option supports wildcard characters (*).

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az storage blob undelete

The undelete Blob operation restores the contents and metadata of soft deleted blob or snapshot.

Attempting to undelete a blob or snapshot that is not soft deleted will succeed without any changes.

az storage blob undelete --container-name
                         --name
                         [--account-key]
                         [--account-name]
                         [--auth-mode {key, login}]
                         [--connection-string]
                         [--sas-token]
                         [--subscription]
                         [--timeout]

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob update

Sets system properties on the blob.

If one property is set for the content_settings, all properties will be overriden.

az storage blob update --container-name
                       --name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--clear-content-settings {false, true}]
                       [--connection-string]
                       [--content-cache]
                       [--content-disposition]
                       [--content-encoding]
                       [--content-language]
                       [--content-md5]
                       [--content-type]
                       [--if-match]
                       [--if-modified-since]
                       [--if-none-match]
                       [--if-unmodified-since]
                       [--lease-id]
                       [--sas-token]
                       [--subscription]
                       [--timeout]

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--clear-content-settings

If this flag is set, then if any one or more of the following properties (--content-cache-control, --content-disposition, --content-encoding, --content-language, --content-md5, --content-type) is set, then all of these properties are set together. If a value is not provided for a given property when at least one of the properties listed below is set, then that property will be cleared.

accepted values: false, true
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--content-cache --content-cache-control

The cache control string.

--content-disposition

Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.

--content-encoding

The content encoding type.

--content-language

The content language.

--content-md5

The content's MD5 hash.

--content-type

The content MIME type.

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

Required if the blob has an active lease.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

az storage blob upload

Upload a file to a storage blob.

Creates a new blob from a file path, or updates the content of an existing blob with automatic chunking and progress notifications.

az storage blob upload --container-name
                       --file
                       --name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--connection-string]
                       [--content-cache]
                       [--content-disposition]
                       [--content-encoding]
                       [--content-language]
                       [--content-md5]
                       [--content-type]
                       [--encryption-scope]
                       [--if-match]
                       [--if-modified-since]
                       [--if-none-match]
                       [--if-unmodified-since]
                       [--lease-id]
                       [--max-connections]
                       [--maxsize-condition]
                       [--metadata]
                       [--no-progress]
                       [--sas-token]
                       [--socket-timeout]
                       [--subscription]
                       [--tier {P10, P20, P30, P4, P40, P50, P6, P60}]
                       [--timeout]
                       [--type {append, block, page}]
                       [--validate-content]

Examples

Upload to a blob.

az storage blob upload -f /path/to/file -c mycontainer -n MyBlob

Upload a file to a storage blob. (autogenerated)

az storage blob upload --account-name mystorageaccount --account-key 0000-0000 --container-name mycontainer --file /path/to/file --name myblob

Required Parameters

--container-name -c

The container name.

--file -f

Path of the file to upload as the blob content.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--content-cache --content-cache-control

The cache control string.

--content-disposition

Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.

--content-encoding

The content encoding type.

--content-language

The content language.

--content-md5

The content's MD5 hash.

--content-type

The content MIME type.

--encryption-scope

A predefined encryption scope used to encrypt the data on the service.

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag does not match the value specified. Specify the wildcard character (*) to perform the operation only if the resource does not exist, and fail the operation if it does exist.

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

Required if the blob has an active lease.

--max-connections

Maximum number of parallel connections to use when the blob size exceeds 64MB.

default value: 2
--maxsize-condition

The max length in bytes permitted for an append blob.

--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--no-progress

Include this flag to disable progress reporting for the command.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--socket-timeout

The socket timeout(secs), used by the service to regulate data flow.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--tier

A page blob tier value to set the blob to. The tier correlates to the size of the blob and number of allowed IOPS. This is only applicable to page blobs on premium storage accounts.

accepted values: P10, P20, P30, P4, P40, P50, P6, P60
--timeout

Request timeout in seconds. Applies to each call to the service.

--type -t

Defaults to 'page' for *.vhd files, or 'block' otherwise.

accepted values: append, block, page
--validate-content

Specifies that an MD5 hash shall be calculated for each chunk of the blob and verified by the service when the chunk has arrived.

az storage blob upload-batch

Upload files from a local directory to a blob container.

az storage blob upload-batch --destination
                             --source
                             [--account-key]
                             [--account-name]
                             [--auth-mode {key, login}]
                             [--connection-string]
                             [--content-cache]
                             [--content-disposition]
                             [--content-encoding]
                             [--content-language]
                             [--content-md5]
                             [--content-type]
                             [--destination-path]
                             [--dryrun]
                             [--if-match]
                             [--if-modified-since]
                             [--if-none-match]
                             [--if-unmodified-since]
                             [--lease-id]
                             [--max-connections]
                             [--maxsize-condition]
                             [--metadata]
                             [--no-progress]
                             [--pattern]
                             [--sas-token]
                             [--socket-timeout]
                             [--subscription]
                             [--timeout]
                             [--type {append, block, page}]
                             [--validate-content]

Examples

Upload all files that end with .py unless blob exists and has been modified since given date.

az storage blob upload-batch -d mycontainer --account-name mystorageaccount --account-key 00000000 -s <path-to-directory> --pattern *.py --if-unmodified-since 2018-08-27T20:51Z

Upload all files from local path directory to a container named "mycontainer".

az storage blob upload-batch -d mycontainer -s <path-to-directory>

Upload all files with the format 'cli-2018-xx-xx.txt' or 'cli-2019-xx-xx.txt' in local path directory.

az storage blob upload-batch -d mycontainer -s <path-to-directory> --pattern cli-201[89]-??-??.txt

Upload all files with the format 'cli-201x-xx-xx.txt' except cli-2018-xx-xx.txt' and 'cli-2019-xx-xx.txt' in a container.

az storage blob upload-batch -d mycontainer -s <path-to-directory> --pattern cli-201[!89]-??-??.txt

Required Parameters

--destination -d

The blob container where the files will be uploaded.

--source -s

The directory where the files to be uploaded are located.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--content-cache --content-cache-control

The cache control string.

--content-disposition

Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.

--content-encoding

The content encoding type.

--content-language

The content language.

--content-md5

The content's MD5 hash.

--content-type

The content MIME type.

--destination-path

The destination path that will be prepended to the blob name.

--dryrun

Show the summary of the operations to be taken instead of actually uploading the file(s).

--if-match

An ETag value, or the wildcard character (*). Specify this header to perform the operation only if the resource's ETag matches the value specified.

--if-modified-since

Commence only if modified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--if-none-match

An ETag value, or the wildcard character (*).

--if-unmodified-since

Commence only if unmodified since supplied UTC datetime (Y-m-d'T'H:M'Z').

--lease-id

The active lease id for the blob.

--max-connections

Maximum number of parallel connections to use when the blob size exceeds 64MB.

default value: 2
--maxsize-condition

The max length in bytes permitted for an append blob.

--metadata

Metadata in space-separated key=value pairs. This overwrites any existing metadata.

--no-progress

Include this flag to disable progress reporting for the command.

--pattern

The pattern used for globbing files or blobs in the source. The supported patterns are '*', '?', '[seq]', and '[!seq]'. For more information, please refer to https://docs.python.org/3.7/library/fnmatch.html.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--socket-timeout

The socket timeout(secs), used by the service to regulate data flow.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

--timeout

Request timeout in seconds. Applies to each call to the service.

--type -t

Defaults to 'page' for *.vhd files, or 'block' otherwise. The setting will override blob types for every file.

accepted values: append, block, page
--validate-content

Specifies that an MD5 hash shall be calculated for each chunk of the blob and verified by the service when the chunk has arrived.

az storage blob url

Create the url to access a blob.

az storage blob url --container-name
                    --name
                    [--account-key]
                    [--account-name]
                    [--auth-mode {key, login}]
                    [--connection-string]
                    [--protocol {http, https}]
                    [--sas-token]
                    [--snapshot]
                    [--subscription]

Examples

Create the url to access a blob (autogenerated)

az storage blob url --connection-string $connectionString --container-name container1 --name blob1

Create the url to access a blob (autogenerated)

az storage blob url --account-name storageacct --account-key 00000000 --container-name container1 --name blob1

Required Parameters

--container-name -c

The container name.

--name -n

The blob name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--protocol

Protocol to use.

accepted values: http, https
default value: https
--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--snapshot

An string value that uniquely identifies the snapshot. The value ofthis query parameter indicates the snapshot version.

--subscription

Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID.

az storage blob filter

List blobs across all containers whose tags match a given search expression.

Filter blobs searches across all containers within a storage account but can be scoped within the expression to a single container.

az storage blob filter --tag-filter
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--connection-string]
                       [--sas-token]

Required Parameters

--tag-filter

The expression to find blobs whose tags matches the specified condition. eg. ""yourtagname"='firsttag' and "yourtagname2"='secondtag'" To specify a container, eg. "@container='containerName' and "Name"='C'".

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

az storage blob move

Move a blob in a storage container.

az storage blob move --container-name
                     --destination-blob
                     --source-blob
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--connection-string]
                     [--lease-id]
                     [--sas-token]
                     [--source-if-match]
                     [--source-if-modified-since]
                     [--source-if-none-match]
                     [--source-if-unmodified-since]
                     [--source-lease-id]
                     [--timeout]

Examples

Move a blob in a storage container.

az storage blob move -c MyContainer -d DestinationBlobPath -s SourceBlobPath --account-name MyStorageAccount

Required Parameters

--container-name -c

The container name.

--destination-blob -d

The destination blob name. It should be an absolute path under the container. e.g.'topdir1/dirbar'.

--source-blob -s

The source blob name. It should be an absolute path under the container. e.g.'topdir1/dirsubfoo'.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.

--account-name

Storage account name. Related environment variable: AZURE_STORAGE_ACCOUNT. Must be used in conjunction with either storage account key or a SAS token. If neither are present, the command will try to query the storage account key using the authenticated Azure account. If a large number of storage commands are executed the API quota may be hit.

--auth-mode

The mode in which to run the command. "login" mode will directly use your login credentials for the authentication. The legacy "key" mode will attempt to query for an account key if no authentication parameters for the account are provided. Environment variable: AZURE_STORAGE_AUTH_MODE.

accepted values: key, login
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--lease-id

Optional. A lease ID for the new_path. The new_path must have an active lease and the lease ID must match.

--sas-token

A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--source-if-match

Optional. An ETag value. Specify this header to perform the rename operation only if the source's ETag matches the value specified.

--source-if-modified-since

Optional. A date and time value. Specify this header to perform the rename operation only if the source has been modified since the specified date and time.

--source-if-none-match

Optional. An ETag value or the special wildcard ("*") value. Specify this header to perform the rename operation only if the source's ETag does not match the value specified.

--source-if-unmodified-since

Optional. A date and time value. Specify this header to perform the rename operation only if the source has not been modified since the specified date and time.

--source-lease-id

Optional. A lease ID for the source_path. The source_path must have an active lease and the lease ID must match.

--timeout

Request timeout in seconds. Applies to each call to the service.