az containerapp ingress cors

Commands to manage CORS policy for a container app.

Commands

Name Description Type Status
az containerapp ingress cors disable

Disable CORS policy for a container app.

Core GA
az containerapp ingress cors enable

Enable CORS policy for a container app.

Core GA
az containerapp ingress cors show

Show CORS policy for a container app.

Core GA
az containerapp ingress cors update

Update CORS policy for a container app.

Core GA

az containerapp ingress cors disable

Disable CORS policy for a container app.

az containerapp ingress cors disable [--ids]
                                     [--name]
                                     [--resource-group]
                                     [--subscription]

Examples

Disable CORS policy for a container app.

az containerapp ingress cors disable -n my-containerapp -g MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--resource-group -g

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

--subscription

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

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 containerapp ingress cors enable

Enable CORS policy for a container app.

az containerapp ingress cors enable --allowed-origins
                                    [--allow-credentials {false, true}]
                                    [--allowed-headers]
                                    [--allowed-methods]
                                    [--expose-headers]
                                    [--ids]
                                    [--max-age]
                                    [--name]
                                    [--resource-group]
                                    [--subscription]

Examples

Set allowed origins and allowed methods for a container app.

az containerapp ingress cors enable -n my-containerapp -g MyResourceGroup --allowed-origins http://www.contoso.com https://www.contoso.com --allowed-methods GET POST

Set allowed origins, allowed methods and allowed headers for a container app.

az containerapp ingress cors enable -n my-containerapp -g MyResourceGroup --allowed-origins * --allowed-methods * --allowed-headers header1 header2

Required Parameters

--allowed-origins -r

A list of allowed origin(s) for the container app. Values are space-separated. Empty string to clear existing values.

Optional Parameters

--allow-credentials

Whether the credential is allowed for the container app.

Accepted values: false, true
--allowed-headers -a

A list of allowed header(s) for the container app. Values are space-separated. Empty string to clear existing values.

--allowed-methods -m

A list of allowed method(s) for the container app. Values are space-separated. Empty string to clear existing values.

--expose-headers -e

A list of expose header(s) for the container app. Values are space-separated. Empty string to clear existing values.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--max-age

The maximum age of the allowed origin in seconds. Only postive integer or empty string are allowed. Empty string resets max_age to null.

--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--resource-group -g

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

--subscription

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

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 containerapp ingress cors show

Show CORS policy for a container app.

az containerapp ingress cors show [--ids]
                                  [--name]
                                  [--resource-group]
                                  [--subscription]

Examples

Show CORS policy for a container app.

az containerapp ingress cors show -n my-containerapp -g MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--resource-group -g

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

--subscription

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

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 containerapp ingress cors update

Update CORS policy for a container app.

az containerapp ingress cors update [--allow-credentials {false, true}]
                                    [--allowed-headers]
                                    [--allowed-methods]
                                    [--allowed-origins]
                                    [--expose-headers]
                                    [--ids]
                                    [--max-age]
                                    [--name]
                                    [--resource-group]
                                    [--subscription]

Examples

Update allowed origins and allowed methods for a container app while keeping other cors settings.

az containerapp ingress cors update -n my-containerapp -g MyResourceGroup --allowed-origins http://www.contoso.com https://www.contoso.com --allowed-methods GET POST

Optional Parameters

--allow-credentials

Whether the credential is allowed for the container app.

Accepted values: false, true
--allowed-headers -a

A list of allowed header(s) for the container app. Values are space-separated. Empty string to clear existing values.

--allowed-methods -m

A list of allowed method(s) for the container app. Values are space-separated. Empty string to clear existing values.

--allowed-origins -r

A list of allowed origin(s) for the container app. Values are space-separated. Empty string to clear existing values.

--expose-headers -e

A list of expose header(s) for the container app. Values are space-separated. Empty string to clear existing values.

--ids

One or more resource IDs (space-delimited). It should be a complete resource ID containing all information of 'Resource Id' arguments. You should provide either --ids or other 'Resource Id' arguments.

--max-age

The maximum age of the allowed origin in seconds. Only postive integer or empty string are allowed. Empty string resets max_age to null.

--name -n

The name of the Containerapp. A name must consist of lower case alphanumeric characters or '-', start with a letter, end with an alphanumeric character, cannot have '--', and must be less than 32 characters.

--resource-group -g

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

--subscription

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

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.