Share via


az staticwebapp

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

Commands

Name Description Type Status
az staticwebapp appsettings

Manage app settings the static app.

Core GA
az staticwebapp appsettings delete

Delete app settings with given keys of the static app.

Core GA
az staticwebapp appsettings list

List app settings of the static app.

Core GA
az staticwebapp appsettings set

Add to or change the app settings of the static app.

Core GA
az staticwebapp backends

Link or unlink a prexisting backend with a static web app. Also known as "Bring your own API.".

Core GA
az staticwebapp backends link

Link a backend to a static web app. Also known as "Bring your own API.".

Core GA
az staticwebapp backends show

Show details on the backend linked to a static web app.

Core GA
az staticwebapp backends unlink

Unlink backend from a static web app.

Core GA
az staticwebapp backends validate

Validate a backend for a static web app.

Core GA
az staticwebapp create

Create a static app. To provide content to the static web app and integrate with a Github repo, provide the Github repository URL (--source) and a branch (--branch). If the repo is under a Github organization, please ensure that the Azure CLI Github App has access to the organization. Access can be requested in the browser when using the "--login-with-github" argument. Access must be granted by the organization's admin.

Core GA
az staticwebapp dbconnection

Manage Static Web App database connections.

Extension Preview
az staticwebapp dbconnection create

Create a Static Web App database connection.

Extension Preview
az staticwebapp dbconnection delete

Delete a Static Web App database connection.

Extension Preview
az staticwebapp dbconnection show

Get details for a Static Web App database connection.

Extension Preview
az staticwebapp delete

Delete a static app.

Core GA
az staticwebapp disconnect

Disconnect source control to enable connecting to a different repo.

Core GA
az staticwebapp enterprise-edge

Manage the Azure Front Door CDN for static webapps. For optimal experience and availability please check our documentation https://aka.ms/swaedge.

Core GA
az staticwebapp enterprise-edge disable

Disable the Azure Front Door CDN for a static webapp. For optimal experience and availability please check our documentation https://aka.ms/swaedge.

Core GA
az staticwebapp enterprise-edge enable

Enable the Azure Front Door CDN for a static webapp. Enabling enterprise-grade edge requires re-registration for the Azure Front Door Microsoft.CDN resource provider. For optimal experience and availability please check our documentation https://aka.ms/swaedge.

Core GA
az staticwebapp enterprise-edge show

Show the status (Enabled, Disabled, Enabling, Disabling) of the Azure Front Door CDN for a webapp. For optimal experience and availability please check our documentation https://aka.ms/swaedge.

Core GA
az staticwebapp environment

Manage environment of the static app.

Core GA
az staticwebapp environment delete

Delete the static app production environment or the specified environment.

Core GA
az staticwebapp environment functions

Show information about functions.

Core GA
az staticwebapp environment list

List all environment of the static app including production.

Core GA
az staticwebapp environment show

Show information about the production environment or the specified environment.

Core GA
az staticwebapp functions

Link or unlink a prexisting functionapp with a static webapp. Also known as "Bring your own Functions.".

Core GA
az staticwebapp functions link

Link an Azure Function to a static webapp. Also known as "Bring your own Functions." Only one Azure Functions app is available to a single static web app. Static webapp SKU must be "Standard" or "Dedicated".

Core GA
az staticwebapp functions show

Show details on the Azure Function linked to a static webapp.

Core GA
az staticwebapp functions unlink

Unlink an Azure Function from a static webapp.

Core GA
az staticwebapp hostname

Manage custom hostnames of Functions of the static app.

Core GA
az staticwebapp hostname delete

Delete given hostname of the static app.

Core GA
az staticwebapp hostname list

List custom hostnames of the static app.

Core GA
az staticwebapp hostname set

Set given sub-domain hostname to the static app. Please configure CNAME/TXT/ALIAS record with your DNS provider. Use --no-wait to not wait for validation.

Core GA
az staticwebapp hostname show

Get details for a staticwebapp custom domain. Can be used to fetch validation token for TXT domain validation (see example).

Core GA
az staticwebapp identity

Manage a static web app's managed identity.

Core GA
az staticwebapp identity assign

Assign managed identity to the static web app.

Core GA
az staticwebapp identity remove

Disable static web app's managed identity.

Core GA
az staticwebapp identity show

Display static web app's managed identity.

Core GA
az staticwebapp list

List all static app resources in a subscription, or in resource group if provided.

Core GA
az staticwebapp reconnect

Connect to a repo and branch following a disconnect command.

Core GA
az staticwebapp secrets

Manage deployment token for the static app.

Core GA
az staticwebapp secrets list

List the deployment token for the static app.

Core GA
az staticwebapp secrets reset-api-key

Reset the deployment token for the static app.

Core GA
az staticwebapp show

Show details of a static app.

Core GA
az staticwebapp update

Update a static app. Return the app updated.

Core GA
az staticwebapp users

Manage users of the static app.

Core GA
az staticwebapp users invite

Create invitation link for specified user to the static app.

Core GA
az staticwebapp users list

Lists users and assigned roles, limited to users who accepted their invites.

Core GA
az staticwebapp users update

Updates a user entry with the listed roles. Either user details or user id is required.

Core GA

az staticwebapp create

Create a static app. To provide content to the static web app and integrate with a Github repo, provide the Github repository URL (--source) and a branch (--branch). If the repo is under a Github organization, please ensure that the Azure CLI Github App has access to the organization. Access can be requested in the browser when using the "--login-with-github" argument. Access must be granted by the organization's admin.

az staticwebapp create --name
                       --resource-group
                       [--api-location]
                       [--app-location]
                       [--branch]
                       [--location]
                       [--login-with-ado]
                       [--login-with-github]
                       [--no-wait]
                       [--output-location]
                       [--sku {Dedicated, Free, Standard}]
                       [--source]
                       [--tags]
                       [--token]

Examples

Create static app in a subscription.

az staticwebapp create -n MyStaticAppName -g MyExistingRg -s https://github.com/JohnDoe/my-first-static-web-app -l WestUs2 -b master -t MyAccessToken

Create static app in a subscription, retrieving token interactively

az staticwebapp create -n MyStaticAppName -g MyExistingRg -s https://github.com/JohnDoe/my-first-static-web-app -l WestUs2 -b master --login-with-github

Create a static web app without any content and without a github integration

az staticwebapp create -n MyStaticAppName -g MyExistingRg

Required Parameters

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

Optional Parameters

--api-location

Location of your Azure Functions code. For example, '/api' represents a folder called 'api'.

--app-location

Location of your application code. For example, '/' represents the root of your app, while '/app' represents a directory called 'app'.

Default value: /
--branch -b

The target branch in the repository.

--location -l

Location. Values from: az account list-locations. You can configure the default location using az configure --defaults location=<location>.

Default value: centralus
--login-with-ado

Use azure credentials to create an Azure Dev Ops personal access token.

Default value: False
--login-with-github

Interactively log in with Github to retrieve the Personal Access Token.

Default value: False
--no-wait

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

Default value: False
--output-location

The path of your build output relative to your apps location. For example, setting a value of 'build' when your app location is set to '/app' will cause the content at '/app/build' to be served.

--sku

The pricing tiers for Static Web App.

Accepted values: Dedicated, Free, Standard
Default value: Free
--source -s

URL for the repository of the static site.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--token -t

A user's GitHub or Azure Dev Ops repository token. This is used to create the Github Action or Dev Ops pipeline.

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 staticwebapp delete

Delete a static app.

az staticwebapp delete --name
                       [--no-wait]
                       [--resource-group]
                       [--yes]

Examples

Delete a static app.

az staticwebapp delete -n MyStaticAppName -g MyRg

Required Parameters

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

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 staticwebapp disconnect

Disconnect source control to enable connecting to a different repo.

az staticwebapp disconnect --name
                           [--no-wait]
                           [--resource-group]

Examples

Disconnect static app.

az staticwebapp disconnect -n MyStaticAppName

Required Parameters

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

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 staticwebapp list

List all static app resources in a subscription, or in resource group if provided.

az staticwebapp list [--resource-group]

Examples

List static apps in a subscription.

az staticwebapp list

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 staticwebapp reconnect

Connect to a repo and branch following a disconnect command.

az staticwebapp reconnect --branch
                          --name
                          --source
                          [--login-with-github]
                          [--no-wait]
                          [--resource-group]
                          [--token]

Examples

Connect a repo and branch to static app.

az staticwebapp reconnect -n MyStaticAppName --source MyGitHubRepo -b master --token MyAccessToken

Connect a repo and branch to static app, retrieving token interactively

az staticwebapp reconnect -n MyStaticAppName --source MyGitHubRepo -b master --login-with-github

Required Parameters

--branch -b

The target branch in the repository.

--name -n

Name of the static site.

--source -s

URL for the repository of the static site.

Optional Parameters

--login-with-github

Interactively log in with Github to retrieve the Personal Access Token.

Default value: False
--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>.

--token -t

A user's GitHub or Azure Dev Ops repository token. This is used to create the Github Action or Dev Ops pipeline.

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 staticwebapp show

Show details of a static app.

az staticwebapp show --name
                     [--resource-group]

Examples

Show static app in a subscription.

az staticwebapp show -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>.

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 staticwebapp update

Update a static app. Return the app updated.

az staticwebapp update --name
                       [--branch]
                       [--no-wait]
                       [--resource-group]
                       [--sku {Dedicated, Free, Standard}]
                       [--source]
                       [--tags]
                       [--token]

Examples

Update static app to standard sku.

az staticwebapp update -n MyStaticAppName --sku Standard

Required Parameters

--name -n

Name of the static site.

Optional Parameters

--branch -b

The target branch in the repository.

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

--sku

The pricing tiers for Static Web App.

Accepted values: Dedicated, Free, Standard
--source -s

URL for the repository of the static site.

--tags

Space-separated tags: key[=value] [key[=value] ...]. Use "" to clear existing tags.

--token -t

A user's GitHub or Azure Dev Ops repository token. This is used to create the Github Action or Dev Ops pipeline.

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.