az storage

Manage Azure Cloud Storage resources.

Commands

az storage account

Manage storage accounts.

az storage account blob-inventory-policy

Manage storage account Blob Inventory Policy.

az storage account blob-inventory-policy create

Create Blob Inventory Policy for storage account.

az storage account blob-inventory-policy delete

Delete Blob Inventory Policy associated with the specified storage account.

az storage account blob-inventory-policy show

Show Blob Inventory Policy properties associated with the specified storage account.

az storage account blob-inventory-policy update

Update Blob Inventory Policy associated with the specified storage account.

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

Generate a shared access signature for the storage account.

az storage account hns-migration

Manage storage account migration to enable hierarchical namespace.

az storage account hns-migration start

Validate/Begin migrating a storage account to enable hierarchical namespace.

az storage account hns-migration stop

Stop the enabling hierarchical namespace migration of a storage 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 local-user

Manage storage account local users.

az storage account local-user create

Create a local user for a given storage account.

az storage account local-user delete

Delete a local user.

az storage account local-user list

List local users for a storage account.

az storage account local-user list-keys

List sharedkeys and sshAuthorizedKeys for a local user.

az storage account local-user regenerate-password

Regenerate sshPassword for a local user.

az storage account local-user show

Show info for a local user.

az storage account local-user update

Update properties for a local user.

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 azcopy

[EXPERIMENTAL] Manage storage operations utilizing AzCopy.

az storage azcopy blob

Manage object storage for unstructured data (blobs) using AzCopy.

az storage azcopy blob delete

Delete blobs from a storage blob container using AzCopy.

az storage azcopy blob download

Download blobs from a storage blob container using AzCopy.

az storage azcopy blob sync

Sync blobs recursively to a storage blob container using AzCopy.

az storage azcopy blob upload

Upload blobs to a storage blob container using AzCopy.

az storage azcopy run-command

Run a command directly using the AzCopy CLI. Please use SAS tokens for authentication.

az storage blob

Manage object storage for unstructured data (blobs).

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 copy

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

az storage blob copy cancel

Abort an ongoing copy operation.

az storage blob copy start

Copy 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 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 download

Download a blob to a file path.

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 filter

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

az storage blob generate-sas

Generate a shared access signature for the blob.

az storage blob immutability-policy

Manage blob immutability policy.

az storage blob immutability-policy delete

Delete blob's immutability policy.

az storage blob immutability-policy set

Set blob's immutability policy.

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

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

az storage blob metadata update

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

az storage blob move

Move a blob in a storage container.

az storage blob query

Enable users to select/project on blob or blob snapshot data by providing simple query expressions.

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-legal-hold

Set blob legal hold.

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 snapshot of the blob.

az storage blob sync

Sync blobs recursively to a storage blob container.

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 undelete

Restore 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

Mark 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

Request 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

Renew 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

Return all user-defined metadata for the specified container.

az storage container metadata update

Set 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 restore

Restore soft-deleted container.

az storage container set-permission

Set the permissions for the specified container.

az storage container show

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

az storage container show-permission

Get 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 migrate-vlw

Migrate a blob container from container level WORM to object level immutability enabled container.

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

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

az storage directory delete

Delete 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

Get all user-defined metadata for the specified directory.

az storage directory metadata update

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

az storage directory show

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

az storage entity

Manage table storage entities.

az storage entity delete

Delete an existing entity in a table.

az storage entity insert

Insert an entity into a table.

az storage entity merge

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

az storage entity query

List entities which satisfy a query.

az storage entity replace

Update an existing entity in a table.

az storage entity show

Get a single entity in a 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

Abort an ongoing copy operation.

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

Mark the specified file for deletion.

az storage file delete-batch

Delete files from an Azure Storage File Share.

az storage file download

Download 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

Generate 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

Return all user-defined metadata for the file.

az storage file metadata update

Update file metadata.

az storage file resize

Resize a file to the specified size.

az storage file show

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

az storage file update

Set 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 download

Download files from the directory in ADLS Gen2 file system to a local file path.

az storage fs directory exists

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

az storage fs directory generate-sas

Generate a SAS token for directory in ADLS Gen2 account.

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 directory upload

Upload files or subdirectories to 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

Return all user-defined metadata for the specified 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 set-expiry

Sets the time a file will expire and be deleted.

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 generate-sas

Generate a SAS token for file system in ADLS Gen2 account.

az storage fs list

List file systems in ADLS Gen2 account.

az storage fs list-deleted-path

List the deleted (file or directory) paths under the specified file system.

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 service-properties

Manage storage datalake service properties.

az storage fs service-properties show

Show the properties of a storage account's datalake service, including Azure Storage Analytics.

az storage fs service-properties update

Update the properties of a storage account's datalake service, including Azure Storage Analytics.

az storage fs show

Show properties of file system in ADLS Gen2 account.

az storage fs undelete-path

Restore soft-deleted path.

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

Delete all messages from the specified queue.

az storage message delete

Delete the specified message.

az storage message get

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

az storage message peek

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

az storage message put

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

az storage message update

Update 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

Create a queue under the given account.

az storage queue delete

Delete the specified queue and any messages it contains.

az storage queue exists

Return a boolean indicating whether the queue exists.

az storage queue generate-sas

Generate a shared access signature for the queue.Use the returned signature with the sas_token parameter of QueueService.

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

Return all user-defined metadata for the specified queue.

az storage queue metadata update

Set 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

Retrieve statistics related to replication for the Queue service. It is only available when read-access geo-redundant replication is enabled for the storage account.

az storage remove

Delete blobs or files from Azure Storage.

az storage share

Manage file shares.

az storage share close-handle

Close file handles of a file share.

az storage share create

Creates a new share under the specified account.

az storage share delete

Mark the specified share for deletion.

az storage share exists

Check for the existence of a file share.

az storage share generate-sas

Generate a shared access signature for the share.

az storage share list

List the file shares in a storage account.

az storage share list-handle

List file handles of a file share.

az storage share metadata

Manage the metadata of a file share.

az storage share metadata show

Return all user-defined metadata for the specified share.

az storage share metadata update

Set 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

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

az storage share snapshot

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

az storage share stats

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

az storage share update

Set 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 or share snapshot.

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 or share snapshot.

az storage share-rm snapshot

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

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

Create a new table in the storage account.

az storage table delete

Delete the specified table and any data it contains.

az storage table exists

Return a boolean indicating whether the table exists.

az storage table generate-sas

Generate 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}]
                [--cap-mbps]
                [--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]
                [<EXTRA_OPTIONS>]

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

Upload a single file to Azure Blob using url with azcopy options pass-through.

az storage copy -s /path/to/file.txt -d https://[account].blob.core.windows.net/[container]/[path/to/blob] -- --block-size-mb=0.25 --check-length

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
--cap-mbps

Caps the transfer rate, in megabits per second. Moment-by-moment throughput might vary slightly from the cap. If this option is set to zero, or it is omitted, the throughput isn't capped.

--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/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.

<EXTRA_OPTIONS>

Other options which will be passed through to azcopy as it is. Please put all the extra options after a --.

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]

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.