az storage account blob-service-properties cors-rule

Manage the Cross-Origin Resource Sharing (CORS) rules of a storage account's blob service properties.

Commands

Name Description Type Status
az storage account blob-service-properties cors-rule add

Add a CORS rule for a storage account.

Core GA
az storage account blob-service-properties cors-rule clear

Clear all CORS rules for a storage account.

Core GA
az storage account blob-service-properties cors-rule list

List all CORS rules of a storage account's blob service properties.

Core GA

az storage account blob-service-properties cors-rule add

Add a CORS rule for a storage account.

az storage account blob-service-properties cors-rule add --account-name
                                                         --allowed-methods
                                                         --allowed-origins
                                                         --max-age
                                                         [--allowed-headers]
                                                         [--exposed-headers]
                                                         [--resource-group]

Examples

Add a CORS rule for a storage account

az storage account blob-service-properties cors-rule add --account-name mystorageaccount --resource-group myresourcegroup --allowed-origins "http://*.contoso.com" --allowed-methods PUT GET --max-age 200

Required Parameters

--account-name -n

The storage account name.

--allowed-methods --methods

Space-separated list of HTTP verbs (methods) allowed to be executed by the origin.

--allowed-origins --origins

Space-separated list of origin domains that will be allowed via CORS, or "*" to allow all domains.

--max-age --max-age-in-seconds

The number of seconds that the client/browser should cache a preflight response.

Optional Parameters

--allowed-headers

Space-separated list of headers allowed to be part of the cross-origin request.

default value: []
--exposed-headers

Space-separated list of response headers to expose to CORS clients.

default value: []
--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

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 account blob-service-properties cors-rule clear

Clear all CORS rules for a storage account.

az storage account blob-service-properties cors-rule clear --account-name
                                                           [--resource-group]

Examples

Clear all CORS rules for a storage account

az storage account blob-service-properties cors-rule clear --account-name mystorageaccount --resource-group myresourcegroup

Required Parameters

--account-name -n

The storage account name.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

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 account blob-service-properties cors-rule list

List all CORS rules of a storage account's blob service properties.

az storage account blob-service-properties cors-rule list --account-name
                                                          [--resource-group]

Examples

List all CORS rules of a storage account

az storage account blob-service-properties cors-rule list --account-name mystorageaccount --resource-group myresourcegroup

Required Parameters

--account-name -n

The storage account name.

Optional Parameters

--resource-group -g

Name of resource group. You can configure the default group using az configure --defaults group=<name>.

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.