This browser is no longer supported.

Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.

Download Microsoft Edge More info about Internet Explorer and Microsoft Edge

Examples

Delete given hostname of the static app.

az staticwebapp hostname delete -n MyStaticAppName --hostname HostnameToDelete

Required Parameters

--hostname

Custom hostname such as www.example.com . Only support sub domain in preview.

--name -n

Name of the static site.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--resource-group -g

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

--yes -y

Do not prompt for confirmation.

default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

--output -o

Output format.

--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.

Examples

List custom hostnames of the static app.

az staticwebapp hostname list -n MyStaticAppName

Required Parameters

--name -n

Name of the static site.

Optional Parameters

--resource-group -g

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

--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.

Examples

Set a hostname for a static app using CNAME validation (default)

az staticwebapp hostname set -n MyStaticAppName --hostname www.example.com

Set a root domain for a webapp using TXT validation

az staticwebapp hostname set -n MyStaticAppName --hostname example.com --validation-method "dns-txt-token"

Required Parameters

--hostname

Custom hostname such as www.example.com . Only support sub domain in preview.

--name -n

Name of the static site.

Optional Parameters

--no-wait

Do not wait for the long-running operation to finish.

default value: False
--resource-group -g

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

--validation-method -m

Validation method for the custom domain.

accepted values: cname-delegation, dns-txt-token
default value: cname-delegation
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.

--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.

Examples

Fetch the validation token (if generated) for TXT validation

az staticwebapp hostname show -n MyStaticAppName -g MyResourceGroup --hostname example.com --query "validationToken"

Show all custom domain details for a particular hostname

az staticwebapp hostname show -n MyStaticAppName -g MyResourceGroup --hostname example.com

Required Parameters

--hostname

Custom hostname such as www.example.com . Only support sub domain in preview.

--name -n

Name of the static site.

--resource-group -g

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

--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.