az staticwebapp

Manage static apps.

Commands

az staticwebapp appsettings

Manage app settings the static app.

az staticwebapp appsettings delete

Delete app settings with given keys of the static app.

az staticwebapp appsettings list

List app settings of the static app.

az staticwebapp appsettings set

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

az staticwebapp backends

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

az staticwebapp backends link

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

az staticwebapp backends show

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

az staticwebapp backends unlink

Unlink backend from a static web app.

az staticwebapp backends validate

Validate a backend for a static web app.

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 delete

Delete a static app.

az staticwebapp disconnect

Disconnect source control to enable connecting to a different repo.

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.

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.

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.

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.

az staticwebapp environment

Manage environment of the static app.

az staticwebapp environment delete

Delete the static app production environment or the specified environment.

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 functions

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

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

az staticwebapp functions show

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

az staticwebapp functions unlink

Unlink an Azure Function from a static webapp.

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 CNAME/TXT/ALIAS record with your DNS provider. Use --no-wait to not wait for validation.

az staticwebapp hostname show

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

az staticwebapp identity

Manage a static web app's managed identity.

az staticwebapp identity assign

Assign managed identity to the static web app.

az staticwebapp identity remove

Disable static web app's managed identity.

az staticwebapp identity show

Display static web app's managed identity.

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 secrets

Manage deployment token for the static app.

az staticwebapp secrets list

List the deployment token for the static app.

az staticwebapp secrets reset-api-key

Reset the deployment token for the static app.

az staticwebapp show

Show details of a static app.

az staticwebapp update

Update a static app. Return the app updated.

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

--login-with-github

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

--no-wait

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

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

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.

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

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.

--resource-group -g

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

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

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.

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

--token -t

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

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

az staticwebapp update

Update a static app. Return the app updated.

az staticwebapp update --name
                       [--branch]
                       [--no-wait]
                       [--resource-group]
                       [--sku {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.

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