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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The source of the file delete operation. The source can be the file share URL or the share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List the files and blobs to be deleted. No actual data deletion will occur.
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.
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 '/'.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The source of the file delete operation. The source can be the file share URL or the share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List the files and blobs to be deleted. No actual data deletion will occur.
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 '/'.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Path of the file to write to. The source filename will be used if not specified.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
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.
Maximum number of parallel connections to use.
Include this flag to disable progress reporting for the command.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
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.
Request timeout in seconds. Applies to each call to the service.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Path of the file to write to. The source filename will be used if not specified.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
Maximum number of parallel connections to use.
Include this flag to disable progress reporting for the command.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
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.
Request timeout in seconds. Applies to each call to the service.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The local directory where the files are downloaded to. This directory must already exist.
The source of the file download operation. The source can be the file share URL or the share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List the files and blobs to be downloaded. No actual data transfer will occur.
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.
The maximum number of parallel connections to use. Default value is 1.
Include this flag to disable progress reporting for the command.
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 '/'.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
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.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The local directory where the files are downloaded to. This directory must already exist.
The source of the file download operation. The source can be the file share URL or the share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List the files and blobs to be downloaded. No actual data transfer will occur.
The maximum number of parallel connections to use. Default value is 1.
Include this flag to disable progress reporting for the command.
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 '/'.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
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.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
Response header value for Cache-Control when resource is accessed using this shared access signature.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Response header value for Content-Disposition when resource is accessed using this shared access signature.
Response header value for Content-Encoding when resource is accessed using this shared access signature.
Response header value for Content-Language when resource is accessed using this shared access signature.
Response header value for Content-Type when resource is accessed using this shared access signature.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
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.
Only permit requests made with the HTTPS protocol. If omitted, requests from both the HTTP and HTTPS protocol are permitted.
Specifies the IP address or range of IP addresses from which to accept requests. Supports only IPv4 style addresses.
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.
The name of a stored access policy within the container's ACL.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
Response header value for Cache-Control when resource is accessed using this shared access signature.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
Response header value for Content-Disposition when resource is accessed using this shared access signature.
Response header value for Content-Encoding when resource is accessed using this shared access signature.
Response header value for Content-Language when resource is accessed using this shared access signature.
Response header value for Content-Type when resource is accessed using this shared access signature.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
Only permit requests made with the HTTPS protocol. If omitted, requests from both the HTTP and HTTPS protocol are permitted.
Specifies the IP address or range of IP addresses from which to accept requests. Supports only IPv4 style addresses.
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.
The name of a stored access policy within the container's ACL.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List only files in the given share.
Specify to exclude "timestamps", "Etag", "Attributes", "PermissionKey" info from response.
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.
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.
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.
The directory path within the file share.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List only files in the given share.
Specify to exclude "timestamps", "Etag", "Attributes", "PermissionKey" info from response.
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.
Specifies the maximum number of results to return. Provide "*" to return all.
The directory path within the file share.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Size to resize file to (in bytes).
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Size to resize file to (in bytes).
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
A string that represents the snapshot version, if applicable.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
The cache control string.
Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.
The content encoding type.
The content language.
The content's MD5 hash.
The content MIME type.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
The cache control string.
Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.
The content encoding type.
The content language.
The content's MD5 hash.
The content MIME type.
If true, the trailing dot will be trimmed from the target URI. Default to False.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
Path of the local file to upload as the file content.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
The cache control string.
Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.
The content encoding type.
The content language.
The content's MD5 hash.
The content MIME type.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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.
The full endpoint URL to the File, including SAS token if used.
Maximum number of parallel connections to use.
Metadata in space-separated key=value pairs. This overwrites any existing metadata.
Include this flag to disable progress reporting for the command.
The path to the file within the file share. If the file name is omitted, the source file name will be used.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
The file share name.
Request timeout in seconds. Applies to each call to the service.
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.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The file share name.
Path of the local file to upload as the file content.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
The cache control string.
Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.
The content encoding type.
The content language.
The content's MD5 hash.
The content MIME type.
If true, the trailing dot will be trimmed from the target URI. Default to False.
Maximum number of parallel connections to use.
Metadata in space-separated key=value pairs. This overwrites any existing metadata.
Include this flag to disable progress reporting for the command.
The path to the file within the file share. If the file name is omitted, the source file name will be used.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Request timeout in seconds. Applies to each call to the service.
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.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
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.
The directory to upload files from.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
The cache control string.
Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.
The content encoding type.
The content language.
The content's MD5 hash.
The content MIME type.
The directory where the source data is copied to. If omitted, data is copied to the root directory.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List the files and blobs to be uploaded. No actual data transfer will occur.
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.
The maximum number of parallel connections to use. Default value is 1.
Metadata in space-separated key=value pairs. This overwrites any existing metadata.
Include this flag to disable progress reporting for the command.
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 '/'.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_SAS_TOKEN.
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.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
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.
The directory to upload files from.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
The cache control string.
Conveys additional information about how to process the response payload, and can also be used to attach additional metadata.
The content encoding type.
The content language.
The content's MD5 hash.
The content MIME type.
The directory where the source data is copied to. If omitted, data is copied to the root directory.
If true, the trailing dot will be trimmed from the target URI. Default to False.
List the files and blobs to be uploaded. No actual data transfer will occur.
The maximum number of parallel connections to use. Default value is 1.
Metadata in space-separated key=value pairs. This overwrites any existing metadata.
Include this flag to disable progress reporting for the command.
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 '/'.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
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.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file/directory within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name or service endpoint. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
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 to use.
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
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
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
The path to the file/directory within the file share.
The file share name.
Optional Parameters
Storage account key. Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_KEY.
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.
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.
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.
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
If true, the trailing dot will be trimmed from the target URI. Default to False.
Protocol to use.
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
Global Parameters
Increase logging verbosity to show all debug logs.
Show this help message and exit.
Only show errors, suppressing warnings.
Output format.
JMESPath query string. See http://jmespath.org/ for more information and examples.
Name or ID of subscription. You can configure the default subscription using az account set -s NAME_OR_ID
.
Increase logging verbosity. Use --debug for full debug logs.
Azure CLI