Skip to content

Commit a1e71ef

Browse files
Merge pull request #293869 from yutanglin16/patch-9
Add CLI/PS commands for RBAC
2 parents 0122b10 + ce17c5f commit a1e71ef

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

articles/app-service/configure-ssl-certificate.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,16 +136,13 @@ If you use Azure Key Vault to manage your certificates, you can import a PKCS12
136136

137137
By default, the App Service resource provider doesn't have access to your key vault. To use a key vault for a certificate deployment, you must authorize read access for the resource provider (App Service) to the key vault. You can grant access either with access policy or RBAC.
138138

139-
### [RBAC permissions](#tab/RBAC)
139+
### [RBAC permissions](#tab/rbac)
140140
| Resource provider | Service principal app ID / assignee | Key vault RBAC role |
141141
|--|--|--|
142142
| **Microsoft Azure App Service** or **Microsoft.Azure.WebSites** | - `abfa0a7c-a6b6-4736-8310-5855508787cd` for public Azure cloud environment <br><br>- `6a02c803-dafd-4136-b4c3-5a6f318b4714` for Azure Government cloud environment | Certificate User |
143143

144144
The service principal app ID or assignee value is the ID for the App Service resource provider. To learn how to authorize key vault permissions for the App Service resource provider using an access policy, see the [provide access to Key Vault keys, certificates, and secrets with an Azure role-based access control documentation](/azure/key-vault/general/rbac-guide?tabs=azure-portal#key-vault-scope-role-assignment).
145145

146-
> [!NOTE]
147-
> Do not delete these RBAC permissions from key vault. If you do, App Service will not be able to sync your web app with the latest key vault certificate version.
148-
149146
### [Access policy permissions](#tab/accesspolicy)
150147

151148
| Resource provider | Service principal app ID | Key vault secret permissions | Key vault certificate permissions |
@@ -159,6 +156,23 @@ The service principal app ID or assignee value is the ID for the App Service res
159156
160157
---
161158

159+
#### [Azure CLI](#tab/azure-cli/rbac)
160+
```azurecli-interactive
161+
az role assignment create --role "Key Vault Certificate User" --assignee "abfa0a7c-a6b6-4736-8310-5855508787cd" --scope "/subscriptions/{subscriptionid}/resourcegroups/{resource-group-name}/providers/Microsoft.KeyVault/vaults/{key-vault-name}"
162+
```
163+
164+
#### [Azure PowerShell](#tab/azure-powershell/rbac)
165+
```azurepowershell
166+
#Assign by Service Principal ApplicationId
167+
New-AzRoleAssignment -RoleDefinitionName "Key Vault Certificate User" -ApplicationId "abfa0a7c-a6b6-4736-8310-5855508787cd" -Scope "/subscriptions/{subscriptionid}/resourcegroups/{resource-group-name}/providers/Microsoft.KeyVault/vaults/{key-vault-name}"
168+
```
169+
170+
> [!NOTE]
171+
> Do not delete these RBAC permissions from key vault. If you do, App Service will not be able to sync your web app with the latest key vault certificate version.
172+
173+
---
174+
175+
162176
### Import a certificate from your vault to your app
163177

164178
1. In the [Azure portal](https://portal.azure.com), from the left menu, select **App Services** > **\<app-name>**.

0 commit comments

Comments
 (0)