Share via


az staticwebapp backends

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

Commands

Name Description Type Status
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

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

Only one backend is available to a single static web app. If a backend was previously linked to another static Web App, the auth configuration must first be removed from the backend before linking to a different Static Web App. Static web app SKU must be "Standard" or "Dedicated". Supported backend types are Azure Functions, Azure API Management, Azure App Service, Azure Container Apps. Backend region must be provided for backends of type Azure Functions and Azure App Service. See https://learn.microsoft.com/azure/static-web-apps/apis-overview to learn more.

az staticwebapp backends link --backend-resource-id
                              --name
                              --resource-group
                              [--backend-region]
                              [--environment-name]

Link a backend to a static web app

az staticwebapp backends link -n MyStaticAppName -g MyResourceGroup --backend-resource-id "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/<resource-provider>/<resource-type>/<backend-name>" --backend-region MyBackendRegion

Link a backend to a static web app environment

az staticwebapp backends link -n MyStaticAppName -g MyResourceGroup --environment-name MyEnvironmentName --backend-resource-id "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/<resource-provider>/<resource-type>/<backend-name>" --backend-region MyBackendRegion
--backend-resource-id

Resource ID of the backend to link.

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--backend-region

Region of the backend resource.

--environment-name

Name of the environment of static site.

Property Value
Default value: default
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az staticwebapp backends show

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

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

Examples

Show static web app backends.

az staticwebapp backends show -n MyStaticAppName -g MyResourceGroup

Show static web app backends for environment.

az staticwebapp backends show -n MyStaticAppName -g MyResourceGroup --environment-name MyEnvironmentName

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--environment-name

Name of the environment of static site.

Property Value
Default value: default
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

Unlink backend from a static web app.

az staticwebapp backends unlink --name
                                --resource-group
                                [--environment-name]
                                [--remove-backend-auth]

Unlink static app backends.

az staticwebapp backends unlink -n MyStaticAppName -g MyResourceGroup

Unlink backend from static web app environment and remove auth config from backend.

az staticwebapp backends unlink -n MyStaticAppName -g MyResourceGroup --environment-name MyEnvironmentName --remove-backend-auth
--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>.

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--environment-name

Name of the environment of static site.

Property Value
Default value: default
--remove-backend-auth

If set to true, removes the identity provider configured on the backend during the linking process.

Property Value
Default value: False
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False

az staticwebapp backends validate

Validate a backend for a static web app.

Only one backend is available to a single static web app. If a backend was previously linked to another static Web App, the auth configuration must first be removed from the backend before linking to a different Static Web App. Static web app SKU must be "Standard" or "Dedicated". Supported backend types are Azure Functions, Azure API Management, Azure App Service, Azure Container Apps. Backend region must be provided for backends of type Azure Functions and Azure App Service. See https://learn.microsoft.com/azure/static-web-apps/apis-overview to learn more.

az staticwebapp backends validate --backend-resource-id
                                  --name
                                  --resource-group
                                  [--backend-region]
                                  [--environment-name]

Examples

Validate a backend for a static web app

az staticwebapp backends validate -n MyStaticAppName -g MyResourceGroup --backend-resource-id "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/<resource-provider>/<resource-type>/<backend-name>" --backend-region MyBackendRegion

Validate a backend for a static web app environment

az staticwebapp backends validate -n MyStaticAppName -g MyResourceGroup --environment-name MyEnvironmentName --backend-resource-id "/subscriptions/<subscription-id>/resourceGroups/<resource-group>/providers/<resource-provider>/<resource-type>/<backend-name>" --backend-region MyBackendRegion

Required Parameters

--backend-resource-id

Resource ID of the backend to link.

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

The following parameters are optional, but depending on the context, one or more might become required for the command to execute successfully.

--backend-region

Region of the backend resource.

--environment-name

Name of the environment of static site.

Property Value
Default value: default
Global Parameters
--debug

Increase logging verbosity to show all debug logs.

Property Value
Default value: False
--help -h

Show this help message and exit.

--only-show-errors

Only show errors, suppressing warnings.

Property Value
Default value: False
--output -o

Output format.

Property Value
Default value: json
Accepted values: json, jsonc, none, table, tsv, yaml, yamlc
--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.

Property Value
Default value: False