az staticwebapp

Manage static apps.

Commands

az staticwebapp appsettings

Manage app settings of Functions of the static app.

az staticwebapp appsettings delete

Delete function app settings with given keys of the static app.

az staticwebapp appsettings list

List function app settings of the static app. A function must first be deployed to use this method.

az staticwebapp appsettings set

Set (replace) function app settings of the static app.

az staticwebapp browse

Show details of a static app.

az staticwebapp create

Create a static app with content from GitHubRepository URL provided in source on provided branch. Return the app created.

az staticwebapp delete

Delete a static app.

az staticwebapp disconnect

Disconnect source control to enable connecting to a different repo.

az staticwebapp environment

Manage environment of the static app.

az staticwebapp environment functions

Show information about functions.

az staticwebapp environment list

List all environment of the static app including production.

az staticwebapp environment show

Show information about the production environment or the specified environment.

az staticwebapp hostname

Manage custom hostnames of Functions of the static app.

az staticwebapp hostname delete

Delete given hostname of the static app.

az staticwebapp hostname list

List custom hostnames of the static app.

az staticwebapp hostname set

Set given sub-domain hostname to the static app. Please configure a CNAME record with your DNS provider.

az staticwebapp list

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

az staticwebapp reconnect

Connect to a repo and branch following a disconnect command.

az staticwebapp users

Manage users of the static app.

az staticwebapp users invite

Create invitation link for specified user to the static app.

az staticwebapp users list

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

az staticwebapp users update

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

az staticwebapp browse

Show details of a static app.

az staticwebapp browse --name
                       [--resource-group]
                       [--subscription]

Examples

Show static app in a subscription.

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

--subscription

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

az staticwebapp create

Create a static app with content from GitHubRepository URL provided in source on provided branch. Return the app created.

az staticwebapp create --branch
                       --location
                       --name
                       --resource-group
                       --source
                       [--api-location]
                       [--app-artifact-location]
                       [--app-location]
                       [--no-wait]
                       [--subscription]
                       [--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

Required Parameters

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

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

--source -s

URL for the repository of the static site.

Optional Parameters

--api-location

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

default value: .
--app-artifact-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.

default value: .github/workflows
--app-location

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

default value: .
--no-wait

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

--subscription

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

--tags

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

--token -t

A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. If you need to create a Github Personal Access Token, please follow the steps found at the following link: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line.

az staticwebapp delete

Delete a static app.

az staticwebapp delete --name
                       [--no-wait]
                       [--resource-group]
                       [--subscription]
                       [--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.

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

--yes -y

Do not prompt for confirmation.

az staticwebapp disconnect

Disconnect source control to enable connecting to a different repo.

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

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.

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

az staticwebapp list

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

az staticwebapp list [--query-examples]
                     [--resource-group]
                     [--subscription]

Examples

List static apps in a subscription.

az staticwebapp list

Optional Parameters

--query-examples

Recommend JMESPath string for you. You can copy one of the query and paste it after --query parameter within double quotation marks to see the results. You can add one or more positional keywords so that we can give suggestions based on these key words.

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

az staticwebapp reconnect

Connect to a repo and branch following a disconnect command.

az staticwebapp reconnect --branch
                          --name
                          --source
                          [--no-wait]
                          [--resource-group]
                          [--subscription]
                          [--token]

Examples

Connect a repo and branch to static app.

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

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

--no-wait

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

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

--token -t

A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. If you need to create a Github Personal Access Token, please follow the steps found at the following link: https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line.