az storage cors

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

Commands

az storage cors add Add a CORS rule to a storage account.
az storage cors clear Remove all CORS rules from a storage account.
az storage cors list List all CORS rules for a storage account.

az storage cors add

Add a CORS rule to a storage account.

az storage cors add --methods {DELETE, GET, HEAD, MERGE, OPTIONS, POST, PUT}
--origins
--services
[--account-key]
[--account-name]
[--allowed-headers]
[--connection-string]
[--exposed-headers]
[--max-age]
[--sas-token]
[--timeout]

Required Parameters

--methods
List of HTTP methods allowed to be executed by the origin.
accepted values: DELETE, GET, HEAD, MERGE, OPTIONS, POST, PUT
--origins
List of origin domains that will be allowed via CORS, or "*" to allow all domains.
--services
The storage service(s) to add rules to. Allowed options are: (b)lob, (f)ile, (q)ueue, (t)able. Can be combined.

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. Must be used in conjunction with either storage account key or a SAS token. Environment variable: AZURE_STORAGE_ACCOUNT.
--allowed-headers
List of response headers allowed to be part of the cross-origin request.
--connection-string
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
--exposed-headers
List of response headers to expose to CORS clients.
--max-age
The maximum number of seconds the client/browser should cache a preflight response.
--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.

az storage cors clear

Remove all CORS rules from a storage account.

az storage cors clear --services
[--account-key]
[--account-name]
[--connection-string]
[--sas-token]
[--timeout]

Required Parameters

--services
The storage service(s) to remove rules from. Allowed options are: (b)lob, (f)ile, (q)ueue, (t)able. Can be combined.

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. Must be used in conjunction with either storage account key or a SAS token. Environment variable: AZURE_STORAGE_ACCOUNT.
--connection-string
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
--sas-token
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
--timeout
Request timeout in seconds. Applies to each call to the service.

az storage cors list

List all CORS rules for a storage account.

az storage cors list [--account-key]
[--account-name]
[--connection-string]
[--sas-token]
[--services]
[--timeout]

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. Must be used in conjunction with either storage account key or a SAS token. Environment variable: AZURE_STORAGE_ACCOUNT.
--connection-string
Storage account connection string. Environment variable: AZURE_STORAGE_CONNECTION_STRING.
--sas-token
A Shared Access Signature (SAS). Must be used in conjunction with storage account name. Environment variable: AZURE_STORAGE_SAS_TOKEN.
--services
The storage service(s) to list rules for. Allowed options are: (b)lob, (f)ile, (q)ueue, (t)able. Can be combined.
default value: bqft
--timeout
Request timeout in seconds. Applies to each call to the service.