您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

az storage

Manage Azure Cloud Storage resources.

Commands

az storage account

Manage storage accounts.

az storage account blob-service-properties

Manage the properties of a storage account's blob service.

az storage account blob-service-properties show

Show the properties of a storage account's blob service.

az storage account blob-service-properties update

Update the properties of a storage account's blob service.

az storage account check-name

Check that the storage account name is valid and is not already in use.

az storage account create

Create a storage account.

az storage account delete

Delete a storage account.

az storage account encryption-scope

Manage encryption scope for a storage account.

az storage account encryption-scope create

Create an encryption scope within storage account.

az storage account encryption-scope list

List encryption scopes within storage account.

az storage account encryption-scope show

Show properties for specified encryption scope within storage account.

az storage account encryption-scope update

Update properties for specified encryption scope within storage account.

az storage account failover

Failover request can be triggered for a storage account in case of availability issues.

az storage account file-service-properties

Manage the properties of file service in storage account.

az storage account file-service-properties show

Show the properties of file service in storage account.

az storage account file-service-properties update

Update the properties of file service in storage account.

az storage account generate-sas

Generates a shared access signature for the account.

az storage account keys

Manage storage account keys.

az storage account keys list

List the access keys or Kerberos keys (if active directory enabled) for a storage account.

az storage account keys renew

Regenerate one of the access keys or Kerberos keys (if active directory enabled) for a storage account.

az storage account list

List storage accounts.

az storage account management-policy

Manage storage account management policies.

az storage account management-policy create

Create the data policy rules associated with the specified storage account.

az storage account management-policy delete

Delete the data policy rules associated with the specified storage account.

az storage account management-policy show

Get the data policy rules associated with the specified storage account.

az storage account management-policy update

Update the data policy rules associated with the specified storage account.

az storage account network-rule

Manage network rules.

az storage account network-rule add

Add a network rule.

az storage account network-rule list

List network rules.

az storage account network-rule remove

Remove a network rule.

az storage account or-policy

Manage storage account Object Replication Policy.

az storage account or-policy create

Create Object Replication Service Policy for storage account.

az storage account or-policy delete

Delete specified Object Replication Service Policy associated with the specified storage account.

az storage account or-policy list

List Object Replication Service Policies associated with the specified storage account.

az storage account or-policy rule

Manage Object Replication Service Policy Rules.

az storage account or-policy rule add

Add rule to the specified Object Replication Service Policy.

az storage account or-policy rule list

List all the rules in the specified Object Replication Service Policy.

az storage account or-policy rule remove

Remove the specified rule from the specified Object Replication Service Policy.

az storage account or-policy rule show

Show the properties of specified rule in Object Replication Service Policy.

az storage account or-policy rule update

Update rule properties to Object Replication Service Policy.

az storage account or-policy show

Show the properties of specified Object Replication Service Policy for storage account.

az storage account or-policy update

Update Object Replication Service Policy properties for storage account.

az storage account private-endpoint-connection

Manage storage account private endpoint connection.

az storage account private-endpoint-connection approve

Approve a private endpoint connection request for storage account.

az storage account private-endpoint-connection delete

Delete a private endpoint connection request for storage account.

az storage account private-endpoint-connection reject

Reject a private endpoint connection request for storage account.

az storage account private-endpoint-connection show

Show details of a private endpoint connection request for storage account.

az storage account private-link-resource

Manage storage account private link resources.

az storage account private-link-resource list

Get the private link resources that need to be created for a storage account.

az storage account revoke-delegation-keys

Revoke all user delegation keys for a storage account.

az storage account show

Show storage account properties.

az storage account show-connection-string

Get the connection string for a storage account.

az storage account show-usage

Show the current count and limit of the storage accounts under the subscription.

az storage account update

Update the properties of a storage account.

az storage blob

Manage object storage for unstructured data (blobs).

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 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 container

Manage blob storage containers.

az storage container create

Create a container in a storage account.

az storage container delete

Marks the specified container for deletion.

az storage container exists

Check for the existence of a storage container.

az storage container generate-sas

Generate a SAS token for a storage container.

az storage container immutability-policy

Manage container immutability policies.

az storage container immutability-policy create

Create or update an unlocked immutability policy.

az storage container immutability-policy delete

Aborts an unlocked immutability policy.

az storage container immutability-policy extend

Extend the immutabilityPeriodSinceCreationInDays of a locked immutabilityPolicy.

az storage container immutability-policy lock

Sets the ImmutabilityPolicy to Locked state.

az storage container immutability-policy show

Gets the existing immutability policy along with the corresponding ETag in response headers and body.

az storage container lease

Manage blob storage container leases.

az storage container lease acquire

Requests a new lease.

az storage container lease break

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

az storage container lease change

Change the lease ID of an active lease.

az storage container lease release

Release the lease.

az storage container lease renew

Renews the lease.

az storage container legal-hold

Manage container legal holds.

az storage container legal-hold clear

Clear legal hold tags.

az storage container legal-hold set

Set legal hold tags.

az storage container legal-hold show

Get the legal hold properties of a container.

az storage container list

List containers in a storage account.

az storage container metadata

Manage container metadata.

az storage container metadata show

Returns all user-defined metadata for the specified container.

az storage container metadata update

Sets one or more user-defined name-value pairs for the specified container.

az storage container policy

Manage container stored access policies.

az storage container policy create

Create a stored access policy on the containing object.

az storage container policy delete

Delete a stored access policy on a containing object.

az storage container policy list

List stored access policies on a containing object.

az storage container policy show

Show a stored access policy on a containing object.

az storage container policy update

Set a stored access policy on a containing object.

az storage container set-permission

Sets the permissions for the specified container or stored access policies that may be used with Shared Access Signatures.

az storage container show

Returns all user-defined metadata and system properties for the specified container.

az storage container show-permission

Gets the permissions for the specified container.

az storage container-rm

Manage Azure containers using the Microsoft.Storage resource provider.

az storage container-rm create

Create a new container under the specified storage account.

az storage container-rm delete

Delete the specified container under its account.

az storage container-rm exists

Check for the existence of a container.

az storage container-rm list

List all containers under the specified storage account.

az storage container-rm show

Show the properties for a specified container.

az storage container-rm update

Update the properties for a container.

az storage copy

Copy files or directories to or from Azure storage.

az storage cors

Manage storage service Cross-Origin Resource Sharing (CORS).

az storage cors add

Add a CORS rule to a storage account.

az storage cors clear

Remove all CORS rules from a storage account.

az storage cors list

List all CORS rules for a storage account.

az storage directory

Manage file storage directories.

az storage directory create

Creates a new directory under the specified share or parent directory.

az storage directory delete

Deletes the specified empty directory.

az storage directory exists

Check for the existence of a storage directory.

az storage directory list

List directories in a share.

az storage directory metadata

Manage file storage directory metadata.

az storage directory metadata show

Returns all user-defined metadata for the specified directory.

az storage directory metadata update

Sets one or more user-defined name-value pairs for the specified directory.

az storage directory show

Returns all user-defined metadata and system properties for the specified directory.

az storage entity

Manage table storage entities.

az storage entity delete

Deletes an existing entity in a table.

az storage entity insert

Insert an entity into a table.

az storage entity merge

Updates an existing entity by merging the entity's properties.

az storage entity query

List entities which satisfy a query.

az storage entity replace

Updates an existing entity in a table.

az storage entity show

Get an entity from the specified table.

az storage file

Manage file shares that use the SMB 3.0 protocol.

az storage file copy

Manage file copy operations.

az storage file copy cancel

Aborts a pending copy_file operation, and leaves a destination file with zero length and full metadata.

az storage file copy start

Copy a file asynchronously.

az storage file copy start-batch

Copy multiple files or blobs to a file share.

az storage file delete

Marks the specified file for deletion.

az storage file delete-batch

Delete files from an Azure Storage File Share.

az storage file download

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

az storage file download-batch

Download files from an Azure Storage File Share to a local directory in a batch operation.

az storage file exists

Check for the existence of a file.

az storage file generate-sas

Generates a shared access signature for the file.

az storage file list

List files and directories in a share.

az storage file metadata

Manage file metadata.

az storage file metadata show

Returns all user-defined metadata for the specified file.

az storage file metadata update

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

az storage file resize

Resizes a file to the specified size.

az storage file show

Returns all user-defined metadata, standard HTTP properties, and system properties for the file.

az storage file update

Sets system properties on the file.

az storage file upload

Upload a file to a share that uses the SMB 3.0 protocol.

az storage file upload-batch

Upload files from a local directory to an Azure Storage File Share in a batch operation.

az storage file url

Create the url to access a file.

az storage fs

Manage file systems in Azure Data Lake Storage Gen2 account.

az storage fs access

Manage file system access and permissions for Azure Data Lake Storage Gen2 account.

az storage fs access remove-recursive

Remove the Access Control on a path and sub-paths in Azure Data Lake Storage Gen2 account.

az storage fs access set

Set the access control properties of a path(directory or file) in Azure Data Lake Storage Gen2 account.

az storage fs access set-recursive

Set the Access Control on a path and sub-paths in Azure Data Lake Storage Gen2 account.

az storage fs access show

Show the access control properties of a path (directory or file) in Azure Data Lake Storage Gen2 account.

az storage fs access update-recursive

Modify the Access Control on a path and sub-paths in Azure Data Lake Storage Gen2 account.

az storage fs create

Create file system for Azure Data Lake Storage Gen2 account.

az storage fs delete

Delete a file system in ADLS Gen2 account.

az storage fs directory

Manage directories in Azure Data Lake Storage Gen2 account.

az storage fs directory create

Create a directory in ADLS Gen2 file system.

az storage fs directory delete

Delete a directory in ADLS Gen2 file system.

az storage fs directory exists

Check for the existence of a directory in ADLS Gen2 file system.

az storage fs directory list

List directories in ADLS Gen2 file system.

az storage fs directory metadata

Manage the metadata for directory in file system.

az storage fs directory metadata show

Return all user-defined metadata for the specified directory.

az storage fs directory metadata update

Sets one or more user-defined name-value pairs for the specified file system.

az storage fs directory move

Move a directory in ADLS Gen2 file system.

az storage fs directory show

Show properties of a directory in ADLS Gen2 file system.

az storage fs exists

Check for the existence of a file system in ADLS Gen2 account.

az storage fs file

Manage files in Azure Data Lake Storage Gen2 account.

az storage fs file append

Append content to a file in ADLS Gen2 file system.

az storage fs file create

Create a new file in ADLS Gen2 file system.

az storage fs file delete

Delete a file in ADLS Gen2 file system.

az storage fs file download

Download a file from the specified path in ADLS Gen2 file system.

az storage fs file exists

Check for the existence of a file in ADLS Gen2 file system.

az storage fs file list

List files and directories in ADLS Gen2 file system.

az storage fs file metadata

Manage the metadata for file in file system.

az storage fs file metadata show

Returns all user-defined metadata, standard HTTP properties, and system properties for the file.

az storage fs file metadata update

Sets one or more user-defined name-value pairs for the specified file system.

az storage fs file move

Move a file in ADLS Gen2 Account.

az storage fs file show

Show properties of file in ADLS Gen2 file system.

az storage fs file upload

Upload a file to a file path in ADLS Gen2 file system.

az storage fs list

List file systems in ADLS Gen2 account.

az storage fs metadata

Manage the metadata for file system.

az storage fs metadata show

Return all user-defined metadata for the specified file system.

az storage fs metadata update

Sets one or more user-defined name-value pairs for the specified file system.

az storage fs show

Show properties of file system in ADLS Gen2 account.

az storage logging

Manage storage service logging information.

az storage logging off

Turn off logging for a storage account.

az storage logging show

Show logging settings for a storage account.

az storage logging update

Update logging settings for a storage account.

az storage message

Manage queue storage messages.

az storage message clear

Deletes all messages from the specified queue.

az storage message delete

Deletes the specified message.

az storage message get

Retrieves one or more messages from the front of the queue.

az storage message peek

Retrieves one or more messages from the front of the queue, but does not alter the visibility of the message.

az storage message put

Adds a new message to the back of the message queue.

az storage message update

Updates the visibility timeout of a message.

az storage metrics

Manage storage service metrics.

az storage metrics show

Show metrics settings for a storage account.

az storage metrics update

Update metrics settings for a storage account.

az storage queue

Manage storage queues.

az storage queue create

Creates a queue under the given account.

az storage queue delete

Deletes the specified queue and any messages it contains.

az storage queue exists

Returns a boolean indicating whether the queue exists.

az storage queue generate-sas

Generates a shared access signature for the queue.

az storage queue list

List queues in a storage account.

az storage queue metadata

Manage the metadata for a storage queue.

az storage queue metadata show

Retrieves user-defined metadata and queue properties on the specified queue.

az storage queue metadata update

Sets user-defined metadata on the specified queue.

az storage queue policy

Manage shared access policies for a storage queue.

az storage queue policy create

Create a stored access policy on the containing object.

az storage queue policy delete

Delete a stored access policy on a containing object.

az storage queue policy list

List stored access policies on a containing object.

az storage queue policy show

Show a stored access policy on a containing object.

az storage queue policy update

Set a stored access policy on a containing object.

az storage queue stats

Retrieves statistics related to replication for the Queue service.

az storage remove

Delete blobs or files from Azure Storage.

az storage share

Manage file shares.

az storage share create

Creates a new share under the specified account.

az storage share delete

Marks the specified share for deletion.

az storage share exists

Check for the existence of a file share.

az storage share generate-sas

Generates a shared access signature for the share.

az storage share list

List the file shares in a storage account.

az storage share metadata

Manage the metadata of a file share.

az storage share metadata show

Returns all user-defined metadata for the specified share.

az storage share metadata update

Sets one or more user-defined name-value pairs for the specified share.

az storage share policy

Manage shared access policies of a storage file share.

az storage share policy create

Create a stored access policy on the containing object.

az storage share policy delete

Delete a stored access policy on a containing object.

az storage share policy list

List stored access policies on a containing object.

az storage share policy show

Show a stored access policy on a containing object.

az storage share policy update

Set a stored access policy on a containing object.

az storage share show

Returns all user-defined metadata and system properties for the specified share.

az storage share snapshot

Creates a snapshot of an existing share under the specified account.

az storage share stats

Gets the approximate size of the data stored on the share, rounded up to the nearest gigabyte.

az storage share update

Sets service-defined properties for the specified share.

az storage share url

Create a URI to access a file share.

az storage share-rm

Manage Azure file shares using the Microsoft.Storage resource provider.

az storage share-rm create

Create a new Azure file share under the specified storage account.

az storage share-rm delete

Delete the specified Azure file share.

az storage share-rm exists

Check for the existence of an Azure file share.

az storage share-rm list

List the Azure file shares under the specified storage account.

az storage share-rm restore

Restore a file share within a valid retention days if share soft delete is enabled.

az storage share-rm show

Show the properties for a specified Azure file share.

az storage share-rm stats

Get the usage bytes of the data stored on the share.

az storage share-rm update

Update the properties for an Azure file share.

az storage table

Manage NoSQL key-value storage.

az storage table create

Creates a new table in the storage account.

az storage table delete

Deletes the specified table and any data it contains.

az storage table exists

Returns a boolean indicating whether the table exists.

az storage table generate-sas

Generates a shared access signature for the table.

az storage table list

List tables in a storage account.

az storage table policy

Manage shared access policies of a storage table.

az storage table policy create

Create a stored access policy on the containing object.

az storage table policy delete

Delete a stored access policy on a containing object.

az storage table policy list

List stored access policies on a containing object.

az storage table policy show

Show a stored access policy on a containing object.

az storage table policy update

Set a stored access policy on a containing object.

az storage table stats

Retrieves statistics related to replication for the Table service.

az storage copy

Copy files or directories to or from Azure storage.

az storage copy [--account-key]
                [--account-name]
                [--blob-type {AppendBlob, BlockBlob, PageBlob}]
                [--connection-string]
                [--content-type]
                [--destination]
                [--destination-account-name]
                [--destination-blob]
                [--destination-container]
                [--destination-file-path]
                [--destination-local-path]
                [--destination-share]
                [--exclude-path]
                [--exclude-pattern]
                [--follow-symlinks]
                [--include-path]
                [--include-pattern]
                [--preserve-s2s-access-tier {false, true}]
                [--put-md5]
                [--recursive]
                [--sas-token]
                [--source]
                [--source-account-key]
                [--source-account-name]
                [--source-blob]
                [--source-connection-string]
                [--source-container]
                [--source-file-path]
                [--source-local-path]
                [--source-sas]
                [--source-share]
                [--subscription]

Examples

Upload a single file to Azure Blob using url.

az storage copy -s /path/to/file.txt -d https://[account].blob.core.windows.net/[container]/[path/to/blob]

Upload a single file to Azure Blob using account name and container name.

az storage copy -s /path/to/file.txt --destination-account-name mystorageaccount --destination-container mycontainer

Upload a single file to Azure Blob with MD5 hash of the file content and save it as the blob's Content-MD5 property.

az storage copy -s /path/to/file.txt -d https://[account].blob.core.windows.net/[container]/[path/to/blob] --put-md5

Upload an entire directory to Azure Blob using url.

az storage copy -s /path/to/dir -d https://[account].blob.core.windows.net/[container]/[path/to/directory] --recursive

Upload an entire directory to Azure Blob using account name and container name.

az storage copy -s /path/to/dir --destination-account-name mystorageaccount --destination-container mycontainer --recursive

Upload a set of files to Azure Blob using wildcards with url.

az storage copy -s /path/*foo/*bar/*.pdf -d https://[account].blob.core.windows.net/[container]/[path/to/directory]

Upload a set of files to Azure Blob using wildcards with account name and container name.

az storage copy -s /path/*foo/*bar/*.pdf --destination-account-name mystorageaccount --destination-container mycontainer

Upload files and directories to Azure Blob using wildcards with url.

az storage copy -s /path/*foo/*bar* -d https://[account].blob.core.windows.net/[container]/[path/to/directory] --recursive

Upload files and directories to Azure Blob using wildcards with account name and container name.

az storage copy -s /path/*foo/*bar* --destination-account-name mystorageaccount --destination-container mycontainer --recursive

Download a single file from Azure Blob using url, and you can also specify your storage account and container information as above.

az storage copy -s https://[account].blob.core.windows.net/[container]/[path/to/blob] -d /path/to/file.txt

Download an entire directory from Azure Blob, and you can also specify your storage account and container information as above.

az storage copy -s https://[account].blob.core.windows.net/[container]/[path/to/directory] -d /path/to/dir --recursive

Download a subset of containers within a storage account by using a wildcard symbol (*) in the container name, and you can also specify your storage account and container information as above.

az storage copy -s https://[account].blob.core.windows.net/[container*name] -d /path/to/dir --recursive

Download a subset of files from Azure Blob. (Only jpg files and file names don't start with test will be included.)

az storage copy -s https://[account].blob.core.windows.net/[container] --include-pattern "*.jpg" --exclude-pattern test* -d /path/to/dir --recursive

Copy a single blob to another blob, and you can also specify the storage account and container information of source and destination as above.

az storage copy -s https://[srcaccount].blob.core.windows.net/[container]/[path/to/blob] -d https://[destaccount].blob.core.windows.net/[container]/[path/to/blob]

Copy an entire account data from blob account to another blob account, and you can also specify the storage account and container information of source and destination as above.

az storage copy -s https://[srcaccount].blob.core.windows.net -d https://[destaccount].blob.core.windows.net --recursive

Copy a single object from S3 with access key to blob, and you can also specify your storage account and container information as above.

az storage copy -s https://s3.amazonaws.com/[bucket]/[object] -d https://[destaccount].blob.core.windows.net/[container]/[path/to/blob]

Copy an entire directory from S3 with access key to blob virtual directory, and you can also specify your storage account and container information as above.

az storage copy -s https://s3.amazonaws.com/[bucket]/[folder] -d https://[destaccount].blob.core.windows.net/[container]/[path/to/directory] --recursive

Copy all buckets in S3 service with access key to blob account, and you can also specify your storage account information as above.

az storage copy -s https://s3.amazonaws.com/ -d https://[destaccount].blob.core.windows.net --recursive

Copy all buckets in a S3 region with access key to blob account, and you can also specify your storage account information as above.

az storage copy -s https://s3-[region].amazonaws.com/ -d https://[destaccount].blob.core.windows.net --recursive

Upload a single file to Azure File Share using url.

az storage copy -s /path/to/file.txt -d https://[account].file.core.windows.net/[share]/[path/to/file]

Upload a single file to Azure File Share using account name and share name.

az storage copy -s /path/to/file.txt --destination-account-name mystorageaccount --destination-share myshare

Upload an entire directory to Azure File Share using url.

az storage copy -s /path/to/dir -d https://[account].file.core.windows.net/[share]/[path/to/directory] --recursive

Upload an entire directory to Azure File Share using account name and container name.

az storage copy -s /path/to/dir --destination-account-name mystorageaccount --destination-share myshare --recursive

Upload a set of files to Azure File Share using wildcards with account name and share name.

az storage copy -s /path/*foo/*bar/*.pdf --destination-account-name mystorageaccount --destination-share myshare

Upload files and directories to Azure File Share using wildcards with url.

az storage copy -s /path/*foo/*bar* -d https://[account].file.core.windows.net/[share]/[path/to/directory] --recursive

Upload files and directories to Azure File Share using wildcards with account name and share name.

az storage copy -s /path/*foo/*bar* --destination-account-name mystorageaccount --destination-share myshare --recursive

Download a single file from Azure File Share using url, and you can also specify your storage account and share information as above.

az storage copy -s https://[account].file.core.windows.net/[share]/[path/to/file] -d /path/to/file.txt

Download an entire directory from Azure File Share, and you can also specify your storage account and share information as above.

az storage copy -s https://[account].file.core.windows.net/[share]/[path/to/directory] -d /path/to/dir --recursive

Download a set of files from Azure File Share using wildcards, and you can also specify your storage account and share information as above.

az storage copy -s https://[account].file.core.windows.net/[share]/ --include-pattern foo* -d /path/to/dir --recursive

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 of copy destination.

--blob-type

The type of blob at the destination.

accepted values: AppendBlob, BlockBlob, PageBlob
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--content-type

Specify content type of the file.

--destination -d

The path/url of copy destination. It can be a local path, an url to azure storage server. If you provide destination parameter here, you do not need to provide arguments in copy destination arguments group and copy destination arguments will be deprecated in future.

--destination-account-name

Storage account name of copy destination.

--destination-blob

Blob name in blob container of copy destination storage account.

--destination-container

Container name of copy destination storage account.

--destination-file-path

File path in file share of copy destination storage account.

--destination-local-path

The path/url of copy destination. It can be a local path, an url to azure storage server. If you provide destination parameter here, you do not need to provide arguments in copy destination arguments group and copy destination arguments will be deprecated in future.

--destination-share

File share name of copy destination storage account.

--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 (*).

--follow-symlinks

Follow symbolic links when uploading from local file system.

--include-path

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

--include-pattern

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

--preserve-s2s-access-tier

Preserve access tier during service to service copy. Please refer to https://docs.microsoft.com/en-us/azure/storage/blobs/storage-blob-storage-tiers to ensure destination storage account support setting access tier. In the cases that setting access tier is not supported, please use --preserve-s2s-access-tier false to bypass copying access tier. (Default true).

accepted values: false, true
--put-md5

Create an MD5 hash of each file, and save the hash as the Content-MD5 property of the destination blob/file.Only available when uploading.

--recursive -r

Look into sub-directories recursively.

--sas-token

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

--source -s

The path/url of copy source. It can be a local path, an url to azure storage server or AWS S3 buckets. If you provide source parameter here, you do not need to provide arguments in copy source arguments group and copy source arguments will be deprecated in future.

--source-account-key

Account key of copy source storage account. Must be used in conjunction with source storage account name.

--source-account-name

Account name of copy source storage account.

--source-blob

Blob name in blob container of copy source storage account.

--source-connection-string --src-conn

Connection string of source storage account.

--source-container

Container name of copy source storage account.

--source-file-path

File path in file share of copy source storage account.

--source-local-path

The path/url of copy source. It can be a local path, an url to azure storage server or AWS S3 buckets. If you provide source parameter here, you do not need to provide arguments in copy source arguments group and copy source arguments will be deprecated in future.

--source-sas

Shared Access Signature (SAS) token of copy source. Must be used in conjunction with source storage account name.

--source-share

File share name of copy source storage account.

--subscription

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

az storage remove

Delete blobs or files from Azure Storage.

az storage remove [--account-key]
                  [--account-name]
                  [--connection-string]
                  [--container-name]
                  [--exclude-path]
                  [--exclude-pattern]
                  [--include-path]
                  [--include-pattern]
                  [--name]
                  [--path]
                  [--recursive]
                  [--sas-token]
                  [--share-name]
                  [--subscription]

Examples

Remove a single blob.

az storage remove -c MyContainer -n MyBlob

Remove an entire virtual directory.

az storage remove -c MyContainer -n path/to/directory --recursive

Remove only the top blobs inside a virtual directory but not its sub-directories.

az storage remove -c MyContainer --recursive

Remove all the blobs in a Storage Container.

az storage remove -c MyContainer -n path/to/directory

Remove a subset of blobs in a virtual directory (For example, only jpg and pdf files, or if the blob name is "exactName" and file names don't start with "test").

az storage remove -c MyContainer --include-path path/to/directory --include-pattern "*.jpg;*.pdf;exactName" --exclude-pattern "test*" --recursive

Remove an entire virtual directory but exclude certain blobs from the scope (For example, every blob that starts with foo or ends with bar).

az storage remove -c MyContainer --include-path path/to/directory --exclude-pattern "foo*;*bar" --recursive

Remove a single file.

az storage remove -s MyShare -p MyFile

Remove an entire directory.

az storage remove -s MyShare -p path/to/directory --recursive

Remove all the files in a Storage File Share.

az storage remove -s MyShare --recursive

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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--container-name -c

The container 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-path

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

--include-pattern

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

--name -n

The blob name.

--path -p

The path to the file within the file share.

--recursive -r

Look into sub-directories recursively.

--sas-token

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

--share-name -s

The file share name.

--subscription

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