Skip to content

Commit 310863b

Browse files
Merge pull request #314600 from yutanglin16/patch-30
Add authorization steps for App Service certificate in Key Vault
2 parents 64208cb + a2c565b commit 310863b

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,49 @@ Currently, App Service certificates aren't supported in Azure national clouds.
5959

6060
1. After the deployment is finished, select **Go to resource**.
6161

62+
#### Authorize App Service certificate to access Azure Key Vault
63+
64+
By default, the App Service certificate resource provider doesn't have access to your key vault. To store, renew, and rekey a certificate in key vault, you must authorize access for the resource provider (App Service certificate) to the key vault. You can grant access with role-based access control (RBAC) or access policy.
65+
66+
#### [RBAC permissions](#tab/rbac)
67+
68+
| Resource provider | Service principal app ID / assignee | Key Vault RBAC role |
69+
|--|--|--|
70+
| Microsoft.Azure.CertificateRegistration | `f3c21649-0979-4721-ac85-b0216b2cf413` | Key Vault Secrets Officer |
71+
72+
The service principal app ID or assignee value is the application (client) ID for the App Service certificate resource provider.
73+
74+
#### [Access policy permissions](#tab/accesspolicy)
75+
76+
| Resource provider | Service principal app ID | Key Vault secret permissions | Key Vault certificate permissions |
77+
|--|--|--|--|
78+
| Microsoft.Azure.CertificateRegistration | `f3c21649-0979-4721-ac85-b0216b2cf413` | Get<br/>List<br/>Set<br/>Delete | Get<br/>List<br/>Set<br/>Delete |
79+
80+
The service principal app ID or assignee value is the ID for the App Service certificate resource provider. To learn how to authorize Key Vault permissions for the App Service certificate resource provider by using an access policy, see [Assign a Key Vault access policy](/azure/key-vault/general/assign-access-policy?tabs=azure-portal).
81+
82+
---
83+
84+
> [!NOTE]
85+
> Don't delete these permissions from the key vault. If you do, App Service certificate can't store, renew, or rekey the certificate in key vault.
86+
87+
> [!IMPORTANT]
88+
> The values in the table are application (client) IDs. If you grant the Key Vault Certificate User role by using infrastructure-as-code (for example, ARM templates or Bicep), you typically must use the object ID of the corresponding enterprise application (service principal) in your Microsoft Entra tenant. Using the application ID works with some tooling (for example, Azure CLI role assignment), but ARM/Bicep role assignments generally require the service principal object ID.
89+
90+
#### [Azure CLI](#tab/azure-cli/rbac)
91+
92+
```azurecli-interactive
93+
az role assignment create --role "Key Vault Secrets Officer" --assignee "f3c21649-0979-4721-ac85-b0216b2cf413" --scope "/subscriptions/{subscriptionid}/resourcegroups/{resource-group-name}/providers/Microsoft.KeyVault/vaults/{key-vault-name}"
94+
```
95+
96+
#### [Azure PowerShell](#tab/azure-powershell/rbac)
97+
98+
```azurepowershell
99+
#Assign by Service Principal ApplicationId
100+
New-AzRoleAssignment -RoleDefinitionName "Key Vault Secrets Officer" -ApplicationId "f3c21649-0979-4721-ac85-b0216b2cf413" -Scope "/subscriptions/{subscriptionid}/resourcegroups/{resource-group-name}/providers/Microsoft.KeyVault/vaults/{key-vault-name}"
101+
```
102+
---
103+
104+
62105
#### Store the certificate in Azure Key Vault
63106

64107
[Key Vault](/azure/key-vault/general/overview) is an Azure service that helps safeguard cryptographic keys and secrets used by cloud applications and services. For App Service certificates, we recommend that you use Key Vault. After you finish the certificate purchase process, you must complete a few more steps before you start using the certificate.

0 commit comments

Comments
 (0)