Share via


az staticwebapp identity

Manage a static web app's managed identity.

Commands

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

Assign managed identity to the static web app.

az staticwebapp identity assign --name
                                --resource-group
                                [--identities]
                                [--role]
                                [--scope]

Examples

assign local identity and assign a reader role to the current resource group.

az staticwebapp identity assign -g MyResourceGroup -n MyUniqueApp --role reader --scope /subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/MyResourceGroup

enable identity for the web app.

az staticwebapp identity assign -g MyResourceGroup -n MyUniqueApp

assign local identity and a user assigned identity to a static web app.

az staticwebapp identity assign -g MyResourceGroup -n MyUniqueApp --identities [system] myAssignedId

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

--identities

Space-separated identities to assign. Use '[system]' to refer to the system assigned identity. Default: '[system]'.

--role

Role name or id the managed identity will be assigned.

Default value: Contributor
--scope

The scope the managed identity has access to.

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

Disable static web app's managed identity.

az staticwebapp identity remove --name
                                --resource-group
                                [--identities]
                                [--yes]

Examples

Disable static web app's system managed identity

az staticwebapp identity remove --name MyApp --resource-group MyResourceGroup

Disable static web app's system managed identity and a user managed identity

az staticwebapp identity remove --name MyApp --resource-group MyResourceGroup --identities [system] myAssignedId

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

--identities

Space-separated identities to assign. Use '[system]' to refer to the system assigned identity. Default: '[system]'.

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

Display static web app's managed identity.

az staticwebapp identity show --name
                              --resource-group

Examples

display static web app's managed identity (autogenerated)

az staticwebapp identity show --name MyApp --resource-group MyResourceGroup

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

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.