az webapp identity

Manage web app's managed service identity.

Commands

az webapp identity assign Assign or disable managed service identity to the web app.
az webapp identity remove Disable web app's managed service identity.
az webapp identity show Display web app's managed service identity.

az webapp identity assign

Assign or disable managed service identity to the web app.

az webapp identity assign [--ids]
[--name]
[--resource-group]
[--role]
[--scope]
[--slot]
[--subscription]

Examples

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

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

enable identity for the web app.

az webapp identity assign -g MyResourceGroup -n MyUniqueApp

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the web app. You can configure the default using 'az configure --defaults web='.

--resource-group -g

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

--role

Role name or id the managed identity will be assigned.

default value: Contributor
--scope

The scope the managed identity has access to.

--slot -s

The name of the slot. Default to the productions slot if not specified.

--subscription

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

az webapp identity remove

Disable web app's managed service identity.

az webapp identity remove [--ids]
[--name]
[--resource-group]
[--slot]
[--subscription]

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the web app. You can configure the default using 'az configure --defaults web='.

--resource-group -g

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

--slot -s

The name of the slot. Default to the productions slot if not specified.

--subscription

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

az webapp identity show

Display web app's managed service identity.

az webapp identity show [--ids]
[--name]
[--resource-group]
[--slot]
[--subscription]

Examples

display webapp's managed service identity (autogenerated)

az webapp identity show --name MyWebapp --resource-group MyResourceGroup

Optional Parameters

--ids

One or more resource IDs (space-delimited). If provided, no other 'Resource Id' arguments should be specified.

--name -n

Name of the web app. You can configure the default using 'az configure --defaults web='.

--resource-group -g

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

--slot -s

The name of the slot. Default to the productions slot if not specified.

--subscription

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