Share via


az storage file

Note

This command group has commands that are defined in both Azure CLI and at least one extension. Install each extension to benefit from its extended capabilities. Learn more about extensions.

Manage file shares that use the SMB 3.0 protocol.

Commands

Name Description Type Status
az storage file copy

Manage file copy operations.

Core and Extension GA
az storage file copy cancel

Abort an ongoing copy operation.

Core GA
az storage file copy cancel (storage-preview extension)

Abort an ongoing copy operation.

Extension GA
az storage file copy start

Copy a file asynchronously.

Core GA
az storage file copy start (storage-preview extension)

Copy a file asynchronously.

Extension GA
az storage file copy start-batch

Copy multiple files or blobs to a file share.

Core GA
az storage file copy start-batch (storage-preview extension)

Copy multiple files or blobs to a file share.

Extension GA
az storage file delete

Mark the specified file for deletion.

Core GA
az storage file delete (storage-preview extension)

Mark the specified file for deletion.

Extension GA
az storage file delete-batch

Delete files from an Azure Storage File Share.

Core GA
az storage file delete-batch (storage-preview extension)

Delete files from an Azure Storage File Share.

Extension GA
az storage file download

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

Core GA
az storage file download (storage-preview extension)

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

Extension GA
az storage file download-batch

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

Core GA
az storage file download-batch (storage-preview extension)

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

Extension GA
az storage file exists

Check for the existence of a file.

Core GA
az storage file exists (storage-preview extension)

Check for the existence of a file.

Extension GA
az storage file generate-sas

Generate a shared access signature for the file.

Core GA
az storage file generate-sas (storage-preview extension)

Generate a shared access signature for the file.

Extension GA
az storage file list

List files and directories in a share.

Core GA
az storage file list (storage-preview extension)

List files and directories in a share.

Extension GA
az storage file metadata

Manage file metadata.

Core and Extension GA
az storage file metadata show

Return all user-defined metadata for the file.

Core GA
az storage file metadata show (storage-preview extension)

Return all user-defined metadata for the file.

Extension GA
az storage file metadata update

Update file metadata.

Core GA
az storage file metadata update (storage-preview extension)

Update file metadata.

Extension GA
az storage file resize

Resize a file to the specified size.

Core GA
az storage file resize (storage-preview extension)

Resize a file to the specified size.

Extension GA
az storage file show

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

Core GA
az storage file show (storage-preview extension)

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

Extension GA
az storage file update

Set system properties on the file.

Core GA
az storage file update (storage-preview extension)

Set system properties on the file.

Extension GA
az storage file upload

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

Core GA
az storage file upload (storage-preview extension)

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

Extension GA
az storage file upload-batch

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

Core GA
az storage file upload-batch (storage-preview extension)

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

Extension GA
az storage file url

Create the url to access a file.

Core GA
az storage file url (storage-preview extension)

Create the url to access a file.

Extension GA

az storage file delete

Mark the specified file for deletion.

The file is later deleted during garbage collection.

az storage file delete --path
                       --share-name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--disallow-trailing-dot {false, true}]
                       [--file-endpoint]
                       [--sas-token]
                       [--timeout]

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file delete (storage-preview extension)

Mark the specified file for deletion.

The file is later deleted during garbage collection.

az storage file delete --path
                       --share-name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--disallow-trailing-dot {false, true}]
                       [--sas-token]
                       [--timeout]

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file delete-batch

Delete files from an Azure Storage File Share.

az storage file delete-batch --source
                             [--account-key]
                             [--account-name]
                             [--auth-mode {key, login}]
                             [--backup-intent]
                             [--connection-string]
                             [--disallow-trailing-dot {false, true}]
                             [--dryrun]
                             [--file-endpoint]
                             [--pattern]
                             [--sas-token]
                             [--timeout]

Examples

Delete files from an Azure Storage File Share. (autogenerated)

az storage file delete-batch --account-key 00000000 --account-name MyAccount --source /path/to/file

Delete files from an Azure Storage File Share. (autogenerated)

az storage file delete-batch --account-key 00000000 --account-name MyAccount --pattern "*.py" --source /path/to/file

Required Parameters

--source -s

The source of the file delete operation. The source can be the file share URL or the share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--dryrun

List the files and blobs to be deleted. No actual data deletion will occur.

Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--pattern

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

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file delete-batch (storage-preview extension)

Delete files from an Azure Storage File Share.

az storage file delete-batch --source
                             [--account-key]
                             [--account-name]
                             [--auth-mode {key, login}]
                             [--backup-intent]
                             [--connection-string]
                             [--disallow-trailing-dot {false, true}]
                             [--dryrun]
                             [--pattern]
                             [--sas-token]
                             [--timeout]

Examples

Delete files from an Azure Storage File Share. (autogenerated)

az storage file delete-batch --account-key 00000000 --account-name MyAccount --source /path/to/file

Delete files from an Azure Storage File Share. (autogenerated)

az storage file delete-batch --account-key 00000000 --account-name MyAccount --pattern *.py --source /path/to/file

Required Parameters

--source -s

The source of the file delete operation. The source can be the file share URL or the share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--dryrun

List the files and blobs to be deleted. No actual data deletion will occur.

Default value: False
--pattern

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

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file download

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

Return an instance of File with properties and metadata.

az storage file download --path
                         --share-name
                         [--account-key]
                         [--account-name]
                         [--auth-mode {key, login}]
                         [--backup-intent]
                         [--connection-string]
                         [--dest]
                         [--disallow-trailing-dot {false, true}]
                         [--end-range]
                         [--file-endpoint]
                         [--max-connections]
                         [--no-progress]
                         [--open-mode]
                         [--sas-token]
                         [--snapshot]
                         [--start-range]
                         [--timeout]
                         [--validate-content]

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--dest

Path of the file to write to. The source filename will be used if not specified.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--end-range

End of byte range to use for downloading a section of the file. 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 file.

--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--max-connections

Maximum number of parallel connections to use.

Default value: 2
--no-progress

Include this flag to disable progress reporting for the command.

Default value: False
--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 or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.

--snapshot

A string that represents the snapshot version, if applicable.

--start-range

Start of byte range to use for downloading a section of the file. 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 file.

--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 file. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. 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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file download (storage-preview extension)

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

Return an instance of File with properties and metadata.

az storage file download --path
                         --share-name
                         [--account-key]
                         [--account-name]
                         [--auth-mode {key, login}]
                         [--backup-intent]
                         [--connection-string]
                         [--dest]
                         [--disallow-trailing-dot {false, true}]
                         [--end-range]
                         [--max-connections]
                         [--no-progress]
                         [--open-mode]
                         [--sas-token]
                         [--snapshot]
                         [--start-range]
                         [--timeout]
                         [--validate-content]

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--dest

Path of the file to write to. The source filename will be used if not specified.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--end-range

End of byte range to use for downloading a section of the file. 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 file.

--max-connections

Maximum number of parallel connections to use.

Default value: 2
--no-progress

Include this flag to disable progress reporting for the command.

Default value: False
--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

A string that represents the snapshot version, if applicable.

--start-range

Start of byte range to use for downloading a section of the file. 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 file.

--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 file. This is primarily valuable for detecting bitflips on the wire if using http instead of https as https (the default) will already validate. 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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file download-batch

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

az storage file download-batch --destination
                               --source
                               [--account-key]
                               [--account-name]
                               [--connection-string]
                               [--disallow-trailing-dot {false, true}]
                               [--dryrun]
                               [--file-endpoint]
                               [--max-connections]
                               [--no-progress]
                               [--pattern]
                               [--sas-token]
                               [--snapshot]
                               [--validate-content]

Examples

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

az storage file download-batch --account-key 00000000 --account-name MyAccount --destination . --no-progress --source /path/to/file

Required Parameters

--destination -d

The local directory where the files are downloaded to. This directory must already exist.

--source -s

The source of the file download operation. The source can be the file share URL or the share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--dryrun

List the files and blobs to be downloaded. No actual data transfer will occur.

Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--max-connections

The maximum number of parallel connections to use. Default value is 1.

Default value: 1
--no-progress

Include this flag to disable progress reporting for the command.

Default value: False
--pattern

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

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--validate-content

If set, calculates an MD5 hash for each range of the file for validation.

The storage service checks the hash of the content that has arrived is identical to the hash that was sent. This is mostly valuable for detecting bitflips during transfer if using HTTP instead of HTTPS. This hash is not stored.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file download-batch (storage-preview extension)

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

az storage file download-batch --destination
                               --source
                               [--account-key]
                               [--account-name]
                               [--connection-string]
                               [--disallow-trailing-dot {false, true}]
                               [--dryrun]
                               [--max-connections]
                               [--no-progress]
                               [--pattern]
                               [--sas-token]
                               [--snapshot]
                               [--validate-content]

Examples

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

az storage file download-batch --account-key 00000000 --account-name MyAccount --destination . --no-progress --source /path/to/file

Required Parameters

--destination -d

The local directory where the files are downloaded to. This directory must already exist.

--source -s

The source of the file download operation. The source can be the file share URL or the share 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.

--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--dryrun

List the files and blobs to be downloaded. No actual data transfer will occur.

Default value: False
--max-connections

The maximum number of parallel connections to use. Default value is 1.

Default value: 1
--no-progress

Include this flag to disable progress reporting for the command.

Default value: False
--pattern

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

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--validate-content

If set, calculates an MD5 hash for each range of the file for validation.

The storage service checks the hash of the content that has arrived is identical to the hash that was sent. This is mostly valuable for detecting bitflips during transfer if using HTTP instead of HTTPS. This hash is not stored.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file exists

Check for the existence of a file.

az storage file exists --path
                       --share-name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--disallow-trailing-dot {false, true}]
                       [--file-endpoint]
                       [--sas-token]
                       [--snapshot]
                       [--timeout]

Examples

Check for the existence of a file. (autogenerated)

az storage file exists --account-key 00000000 --account-name MyAccount --path path/file.txt --share-name MyShare

Check for the existence of a file. (autogenerated)

az storage file exists --connection-string $connectionString --path path/file.txt --share-name MyShare

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file exists (storage-preview extension)

Check for the existence of a file.

az storage file exists --path
                       --share-name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--disallow-trailing-dot {false, true}]
                       [--sas-token]
                       [--snapshot]
                       [--timeout]

Examples

Check for the existence of a file. (autogenerated)

az storage file exists --account-key 00000000 --account-name MyAccount --path path/file.txt --share-name MyShare

Check for the existence of a file. (autogenerated)

az storage file exists --connection-string $connectionString --path path/file.txt --share-name MyShare

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file generate-sas

Generate a shared access signature for the file.

az storage file generate-sas --path
                             --share-name
                             [--account-key]
                             [--account-name]
                             [--cache-control]
                             [--connection-string]
                             [--content-disposition]
                             [--content-encoding]
                             [--content-language]
                             [--content-type]
                             [--disallow-trailing-dot {false, true}]
                             [--expiry]
                             [--file-endpoint]
                             [--https-only]
                             [--ip]
                             [--permissions]
                             [--policy-name]
                             [--start]

Examples

Generate a sas token for a file.

end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage file generate-sas -p path/file.txt -s MyShare --account-name MyStorageAccount --permissions rcdw --https-only --expiry $end

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

az storage file generate-sas --account-name MyStorageAccount --expiry 2037-12-31T23:59:00Z --path path/file.txt --permissions rcdw --share-name MyShare --start 2019-01-01T12:20Z

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

az storage file generate-sas --account-key 00000000 --account-name mystorageaccount --expiry 2037-12-31T23:59:00Z --https-only --path path/file.txt --permissions rcdw --share-name myshare

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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.

--cache-control

Response header value for Cache-Control when resource is accessed using 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 accessed using this shared access signature.

--content-encoding

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

--content-language

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

--content-type

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

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--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 --policy-name that specifies this value.

--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--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: (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 --policy-name that specifies this value. Defaults to the time of the request.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file generate-sas (storage-preview extension)

Generate a shared access signature for the file.

az storage file generate-sas --path
                             --share-name
                             [--account-key]
                             [--account-name]
                             [--cache-control]
                             [--connection-string]
                             [--content-disposition]
                             [--content-encoding]
                             [--content-language]
                             [--content-type]
                             [--disallow-trailing-dot {false, true}]
                             [--expiry]
                             [--https-only]
                             [--ip]
                             [--permissions]
                             [--policy-name]
                             [--start]

Examples

Generate a sas token for a file.

end=`date -u -d "30 minutes" '+%Y-%m-%dT%H:%MZ'`
az storage file generate-sas -p path/file.txt -s MyShare --account-name MyStorageAccount --permissions rcdw --https-only --expiry $end

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

az storage file generate-sas --account-name MyStorageAccount --expiry 2037-12-31T23:59:00Z --path path/file.txt --permissions rcdw --share-name MyShare --start 2019-01-01T12:20Z

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

az storage file generate-sas --account-key 00000000 --account-name mystorageaccount --expiry 2037-12-31T23:59:00Z --https-only --path path/file.txt --permissions rcdw --share-name myshare

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share 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.

--cache-control

Response header value for Cache-Control when resource is accessed using 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 accessed using this shared access signature.

--content-encoding

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

--content-language

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

--content-type

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

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--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 --policy-name that specifies this value.

--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: (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 --policy-name that specifies this value. Defaults to the time of the request.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file list

List files and directories in a share.

az storage file list --share-name
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--backup-intent]
                     [--connection-string]
                     [--disallow-trailing-dot {false, true}]
                     [--exclude-dir]
                     [--exclude-extended-info]
                     [--file-endpoint]
                     [--marker]
                     [--num-results]
                     [--path]
                     [--sas-token]
                     [--snapshot]
                     [--timeout]

Examples

List files and directories in a share. (autogenerated)

az storage file list --share-name MyShare

Required Parameters

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--exclude-dir

List only files in the given share.

Default value: False
--exclude-extended-info

Specify to exclude "timestamps", "Etag", "Attributes", "PermissionKey" info from response.

Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--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
--path -p

The directory path within the file share.

--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file list (storage-preview extension)

List files and directories in a share.

az storage file list --share-name
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--backup-intent]
                     [--connection-string]
                     [--disallow-trailing-dot {false, true}]
                     [--exclude-dir]
                     [--exclude-extended-info]
                     [--marker]
                     [--num-results]
                     [--path]
                     [--sas-token]
                     [--snapshot]
                     [--timeout]

Examples

List files and directories in a share. (autogenerated)

az storage file list --share-name MyShare

Required Parameters

--share-name -s

The file share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--exclude-dir

List only files in the given share.

Default value: False
--exclude-extended-info

Specify to exclude "timestamps", "Etag", "Attributes", "PermissionKey" info from response.

Default value: False
--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

Specifies the maximum number of results to return. Provide "*" to return all.

Default value: 5000
--path -p

The directory path within the file share.

--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file resize

Resize a file to the specified size.

If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared.

az storage file resize --path
                       --share-name
                       --size
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--disallow-trailing-dot {false, true}]
                       [--file-endpoint]
                       [--sas-token]
                       [--timeout]

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

--size

Size to resize file to (in bytes).

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file resize (storage-preview extension)

Resize a file to the specified size.

If the specified byte value is less than the current size of the file, then all ranges above the specified byte value are cleared.

az storage file resize --path
                       --share-name
                       --size
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--disallow-trailing-dot {false, true}]
                       [--sas-token]
                       [--timeout]

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

--size

Size to resize file to (in bytes).

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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file show

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

az storage file show --path
                     --share-name
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--backup-intent]
                     [--connection-string]
                     [--disallow-trailing-dot {false, true}]
                     [--file-endpoint]
                     [--sas-token]
                     [--snapshot]
                     [--timeout]

Examples

Show properties of file in file share.

az storage file show -p dir/a.txt -s sharename --account-name myadlsaccount --account-key 0000-0000

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file show (storage-preview extension)

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

az storage file show --path
                     --share-name
                     [--account-key]
                     [--account-name]
                     [--auth-mode {key, login}]
                     [--backup-intent]
                     [--connection-string]
                     [--disallow-trailing-dot {false, true}]
                     [--sas-token]
                     [--snapshot]
                     [--timeout]

Examples

Show properties of file in file share.

az storage file show -p dir/a.txt -s sharename --account-name myadlsaccount --account-key 0000-0000

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--sas-token

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

--snapshot

A string that represents the snapshot version, if applicable.

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file update

Set system properties on the file.

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

az storage file update --path
                       --share-name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--clear-content-settings {false, true}]
                       [--connection-string]
                       [--content-cache]
                       [--content-disposition]
                       [--content-encoding]
                       [--content-language]
                       [--content-md5]
                       [--content-type]
                       [--disallow-trailing-dot {false, true}]
                       [--file-endpoint]
                       [--sas-token]
                       [--timeout]

Examples

Set system properties on the file.

az storage file update -p dir/a.txt -s sharename --account-name myadlsaccount --account-key 0000-0000 --content-type test/type

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--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.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file update (storage-preview extension)

Set system properties on the file.

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

az storage file update --path
                       --share-name
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--clear-content-settings {false, true}]
                       [--connection-string]
                       [--content-cache]
                       [--content-disposition]
                       [--content-encoding]
                       [--content-language]
                       [--content-md5]
                       [--content-type]
                       [--disallow-trailing-dot {false, true}]
                       [--sas-token]
                       [--timeout]

Examples

Set system properties on the file.

az storage file update -p dir/a.txt -s sharename --account-name myadlsaccount --account-key 0000-0000 --content-type test/type

Required Parameters

--path -p

The path to the file within the file share.

--share-name -s

The file share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--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.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--sas-token

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

--timeout

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

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file upload

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

Creates or updates an Azure file from a source path with automatic chunking and progress notifications.

az storage file upload --source
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--content-cache]
                       [--content-disposition]
                       [--content-encoding]
                       [--content-language]
                       [--content-md5]
                       [--content-type]
                       [--disallow-trailing-dot {false, true}]
                       [--file-endpoint]
                       [--file-url]
                       [--max-connections]
                       [--metadata]
                       [--no-progress]
                       [--path]
                       [--sas-token]
                       [--share-name]
                       [--timeout]
                       [--validate-content]

Examples

Upload to a local file to a share.

az storage file upload -s MyShare --source /path/to/file

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

az storage file upload --account-key 00000000 --account-name MyStorageAccount --path path/file.txt --share-name MyShare --source /path/to/file

Required Parameters

--source

Path of the local file to upload as the file content.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--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.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--file-url

The full endpoint URL to the File, including SAS token if used.

--max-connections

Maximum number of parallel connections to use.

Default value: 2
--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.

Default value: False
--path -p

The path to the file within the file share. If the file name is omitted, the source file name will be used.

--sas-token

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

--share-name -s

The file share name.

--timeout

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

--validate-content

If true, calculates an MD5 hash for each range of the file. The storage service checks the hash of the content that has arrived with the hash that was sent. 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 this MD5 hash is not stored with the file.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file upload (storage-preview extension)

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

Creates or updates an Azure file from a source path with automatic chunking and progress notifications.

az storage file upload --share-name
                       --source
                       [--account-key]
                       [--account-name]
                       [--auth-mode {key, login}]
                       [--backup-intent]
                       [--connection-string]
                       [--content-cache]
                       [--content-disposition]
                       [--content-encoding]
                       [--content-language]
                       [--content-md5]
                       [--content-type]
                       [--disallow-trailing-dot {false, true}]
                       [--max-connections]
                       [--metadata]
                       [--no-progress]
                       [--path]
                       [--sas-token]
                       [--timeout]
                       [--validate-content]

Examples

Upload to a local file to a share.

az storage file upload -s MyShare --source /path/to/file

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

az storage file upload --account-key 00000000 --account-name MyStorageAccount --path path/file.txt --share-name MyShare --source /path/to/file

Required Parameters

--share-name -s

The file share name.

--source

Path of the local file to upload as the file content.

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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--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.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--max-connections

Maximum number of parallel connections to use.

Default value: 2
--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.

Default value: False
--path -p

The path to the file within the file share. If the file name is omitted, the source file name will be used.

--sas-token

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

--timeout

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

--validate-content

If true, calculates an MD5 hash for each range of the file. The storage service checks the hash of the content that has arrived with the hash that was sent. 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 this MD5 hash is not stored with the file.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file upload-batch

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

az storage file upload-batch --destination
                             --source
                             [--account-key]
                             [--account-name]
                             [--connection-string]
                             [--content-cache]
                             [--content-disposition]
                             [--content-encoding]
                             [--content-language]
                             [--content-md5]
                             [--content-type]
                             [--destination-path]
                             [--disallow-trailing-dot {false, true}]
                             [--dryrun]
                             [--file-endpoint]
                             [--max-connections]
                             [--metadata]
                             [--no-progress]
                             [--pattern]
                             [--sas-token]
                             [--validate-content]

Examples

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

az storage file upload-batch --destination myshare --source . --account-name myaccount --account-key 00000000

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

az storage file upload-batch --destination https://myaccount.file.core.windows.net/myshare --source . --account-key 00000000

Required Parameters

--destination -d

The destination of the upload operation.

The destination can be the file share URL or the share name. When the destination is the share URL, the storage account name is parsed from the URL.

--source -s

The directory to upload files from.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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.

--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 directory where the source data is copied to. If omitted, data is copied to the root directory.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--dryrun

List the files and blobs to be uploaded. No actual data transfer will occur.

Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--max-connections

The maximum number of parallel connections to use. Default value is 1.

Default value: 1
--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.

Default value: False
--pattern

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

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

--validate-content

If set, calculates an MD5 hash for each range of the file for validation.

The storage service checks the hash of the content that has arrived is identical to the hash that was sent. This is mostly valuable for detecting bitflips during transfer if using HTTP instead of HTTPS. This hash is not stored.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file upload-batch (storage-preview extension)

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

az storage file upload-batch --destination
                             --source
                             [--account-key]
                             [--account-name]
                             [--connection-string]
                             [--content-cache]
                             [--content-disposition]
                             [--content-encoding]
                             [--content-language]
                             [--content-md5]
                             [--content-type]
                             [--destination-path]
                             [--disallow-trailing-dot {false, true}]
                             [--dryrun]
                             [--max-connections]
                             [--metadata]
                             [--no-progress]
                             [--pattern]
                             [--sas-token]
                             [--validate-content]

Examples

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

az storage file upload-batch --destination myshare --source . --account-name myaccount --account-key 00000000

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

az storage file upload-batch --destination https://myaccount.file.core.windows.net/myshare --source . --account-key 00000000

Required Parameters

--destination -d

The destination of the upload operation.

The destination can be the file share URL or the share name. When the destination is the share URL, the storage account name is parsed from the URL.

--source -s

The directory to upload files 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.

--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 directory where the source data is copied to. If omitted, data is copied to the root directory.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--dryrun

List the files and blobs to be uploaded. No actual data transfer will occur.

Default value: False
--max-connections

The maximum number of parallel connections to use. Default value is 1.

Default value: 1
--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.

Default value: False
--pattern

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

When you use '*' in --pattern, it will match any character including the the directory separator '/'.

--sas-token

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

--validate-content

If set, calculates an MD5 hash for each range of the file for validation.

The storage service checks the hash of the content that has arrived is identical to the hash that was sent. This is mostly valuable for detecting bitflips during transfer if using HTTP instead of HTTPS. This hash is not stored.

Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file url

Create the url to access a file.

az storage file url --path
                    --share-name
                    [--account-key]
                    [--account-name]
                    [--auth-mode {key, login}]
                    [--backup-intent]
                    [--connection-string]
                    [--disallow-trailing-dot {false, true}]
                    [--file-endpoint]
                    [--protocol {http, https}]
                    [--sas-token]

Examples

Create the url to access a file. (autogenerated)

az storage file url --account-key 00000000 --account-name mystorageaccount --path path/file.txt --share-name myshare

Required Parameters

--path -p

The path to the file/directory within the file share.

--share-name -s

The file share name.

Optional Parameters

--account-key

Storage account key. Must be used in conjunction with storage account name or service endpoint. 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--file-endpoint

Storage data service endpoint. Must be used in conjunction with either storage account key or a SAS token. You can find each service primary endpoint with az storage account show. Environment variable: AZURE_STORAGE_SERVICE_ENDPOINT.

--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 or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.

az storage file url (storage-preview extension)

Create the url to access a file.

az storage file url --path
                    --share-name
                    [--account-key]
                    [--account-name]
                    [--auth-mode {key, login}]
                    [--backup-intent]
                    [--connection-string]
                    [--disallow-trailing-dot {false, true}]
                    [--protocol {http, https}]
                    [--sas-token]

Examples

Create the url to access a file. (autogenerated)

az storage file url --account-key 00000000 --account-name mystorageaccount --path path/file.txt --share-name myshare

Required Parameters

--path -p

The path to the file/directory within the file share.

--share-name -s

The file share 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
--backup-intent --enable-file-backup-request-intent

Required parameter to use with OAuth (Azure AD) Authentication for Files. This will bypass any file/directory level permission checks and allow access, based on the allowed data actions, even if there are ACLs in place for those files/directories.

Default value: False
--connection-string

Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.

--disallow-trailing-dot

If true, the trailing dot will be trimmed from the target URI. Default to False.

Accepted values: false, true
Default value: False
--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.

Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
Default value: json
--query

JMESPath query string. See http://jmespath.org/ for more information and examples.

--subscription

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

--verbose

Increase logging verbosity. Use --debug for full debug logs.