Skip to content

Commit e97c688

Browse files
authored
Merge pull request #284719 from anthonychu/20240814-aca-kv-certs-updates
[Container Apps] Key Vault certs – remove preview and fix instructions
2 parents c6bfc56 + 3f93bc9 commit e97c688

File tree

1 file changed

+38
-70
lines changed

1 file changed

+38
-70
lines changed

articles/container-apps/key-vault-certificates-manage.md

Lines changed: 38 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -5,62 +5,23 @@ services: container-apps
55
author: craigshoemaker
66
ms.service: azure-container-apps
77
ms.topic: how-to
8-
ms.date: 05/09/2024
8+
ms.date: 08/14/2024
99
ms.author: cshoe
1010
---
1111

12-
# Import certificates from Azure Key Vault to Azure Container Apps (preview)
12+
# Import certificates from Azure Key Vault to Azure Container Apps
1313

14-
You can set up Azure Key Vault to manage your container app's certificates to handle updates, renewals, and monitoring. Without Key Vault, you're left managing your certificate manually, which means you can't manage certificates in a central location and can't take advantage of lifecycle automation or notifications.
14+
You can set up Azure Key Vault to centrally manage your container app's TLS/SSL certificates and handle updates, renewals, and monitoring.
1515

1616
## Prerequisites
1717

18-
- [Azure Key Vault](/azure/key-vault/general/manage-with-cli2): Create a Key Vault resource.
18+
An Azure Key Vault resource is required to store your certificate. See [Import a certificate in Azure Key Vault](/azure/key-vault/certificates/tutorial-import-certificate?tabs=azure-portal) or [Configure certificate auto-rotation in Key Vault](/azure/key-vault/certificates/tutorial-rotate-certificates) to create a Key Vault and add a certificate.
1919

20-
- [Azure CLI](/cli/azure/install-azure-cli): You need the Azure CLI updated with the Azure Container Apps extension version `0.3.49` or higher. Use the `az extension add` command to install the latest version.
20+
## Enable managed identity for Container Apps environment
2121

22-
```azurecli
23-
az extension add --name containerapp --upgrade --allow-preview`
24-
```
22+
Azure Container Apps uses an environment level managed identity to access your Key Vault and import your certificate. To enable system-assigned managed identity, follow these steps:
2523

26-
- [Managed identity](./managed-identity.md): Enable managed identity on your Container Apps environment.
27-
28-
## Secret configuration
29-
30-
An [Azure Key Vault](/azure/key-vault/general/manage-with-cli2) instance is required to store your certificate. Make the following updates to your Key Vault instance:
31-
32-
1. Open the [Azure portal](https://portal.azure.com).
33-
34-
1. Go to your Azure Container Apps environment.
35-
36-
1. From *Settings*, select Access control (IAM).
37-
38-
1. From the *Roles* tab, and set yourself as a *Key Vault Administrator*.
39-
40-
1. Go to your certificate's details and copy the value for *Secret Identifier* and paste it into a text editor for use in an upcoming step.
41-
42-
> [!NOTE]
43-
> To retrieve a specific version of the certificate, include the version suffix with the secret identifier. To get the latest version, remove the version suffix from the identifier.
44-
45-
## Enable and configure Key Vault Certificate
46-
47-
1. Open the Azure portal and go to your Key Vault.
48-
49-
1. In the *Objects* section, select **Certificates**.
50-
51-
1. Select the certificate you want to use.
52-
53-
1. In the *Access control (IAM)* section, select **Add role assignment**.
54-
55-
1. Add the roles: **Key Vault Certificates Officer** and **Key Vault Secrets Officer**.
56-
57-
1. Go to your certificate's details and copy the value for **Secret Identifier**.
58-
59-
1. Paste the identifier into a text editor for use in an upcoming step.
60-
61-
## Assign roles for environment-level managed identity
62-
63-
1. Open the [Azure portal](https://portal.azure.com) and find your instance of your Azure Container Apps environment where you want to import a certificate.
24+
1. Open the [Azure portal](https://portal.azure.com) and find your Azure Container Apps environment where you want to import a certificate.
6425

6526
1. From *Settings*, select **Identity**.
6627

@@ -77,46 +38,53 @@ An [Azure Key Vault](/azure/key-vault/general/manage-with-cli2) instance is requ
7738
| Scope | Select **Key Vault**. |
7839
| Subscription | Select your Azure subscription. |
7940
| Resource | Select your vault. |
80-
| Role | Select *Key Vault Secrets User**. |
41+
| Role | Select **Key Vault Secrets User**. |
8142

8243
1. Select **Save**.
8344

8445
For more detail on RBAC vs. legacy access policies, see [Azure role-based access control (Azure RBAC) vs. access policies](/azure/key-vault/general/rbac-access-policy).
8546

86-
## Import a certificate
47+
## Import certificate from Key Vault
48+
49+
1. Open the Azure portal and go to your Azure Container Apps environment.
50+
51+
1. From *Settings*, select **Certificates**.
52+
53+
1. Select the **Bring your own certificates (.pfx)** tab.
8754

88-
Once you authorize your container app to read the vault, you can use the `az containerapp env certificate upload` command to import your vault to your Container Apps environment.
55+
1. Select **Add certificate**.
8956

90-
Before you run the following command, replace the placeholder tokens surrounded by `<>` brackets with your own values.
57+
1. In the *Add certificate* panel, in *Source*, select **Import from Key Vault**.
58+
59+
1. Select **Select key vault certificate** and select the following values:
60+
61+
| Property | Value |
62+
|--|--|
63+
| Subscription | Select your Azure subscription. |
64+
| Key vault | Select your vault. |
65+
| Certificate | Select your certificate. |
66+
67+
> [!NOTE]
68+
> If you see an error, *"The operation "List" is not enabled in this key vault's access policy."*, you need to configure an access policy in your Key Vault to allow your user account to list certificates. For more information, see [Assign a Key Vault access policy](/azure/key-vault/general/assign-access-policy?tabs=azure-portal).
9169
92-
```azurecli
93-
az containerapp env certificate upload \
94-
--resource-group <RESOURCE_GROUP> \
95-
--name <CONTAINER_APP_NAME> \
96-
--akv-url <KEY_VAULT_URL> \
97-
--certificate-identity <CERTIFICATE_IDENTITY>
98-
```
70+
1. Select **Select**.
9971

100-
For more information regarding the command parameters, see the following table.
72+
1. In the *Add certificate* panel, in *Managed identity*, select **System assigned**. If you're using a user-assigned managed identity, select your user-assigned managed identity.
10173

102-
| Parameter | Description |
103-
|---|---|
104-
| `--resource-group` | Your resource group name. |
105-
| `--name` | Your container app name. |
106-
| `--akv-url` | The URL for your secret identifier. This URL is the value you set aside in a previous step. |
107-
| `--certificate-identity` | The ID for your managed identity. This value can either be `system`, or the ID for your user-assigned managed identity. |
74+
1. Select **Add**.
10875

109-
## Troubleshooting
76+
> [!NOTE]
77+
> If you receive an error message, verify that the managed identity is assigned the **Key Vault Secrets User** role on the Key Vault.
11078
111-
If you encounter an error message as you import your certificate, verify your actions using the following steps:
79+
## Configure a custom domain
11280

113-
- Ensure that permissions are correctly configured for both your certificate and environment-level managed identity.
81+
After configuring your certificate, you can use it to secure your custom domain. Follow the steps in [Add a custom domain](custom-domains-certificates.md#add-a-custom-domain-and-certificate) and select the certificate you imported from Key Vault.
11482

115-
- You should assign both *Key Vault Secrets Officer* and *Key Vault Certificates Officer* roles.
83+
## Rotate certificates
11684

117-
- Make sure that you're using the correct URL for accessing your certificate. You should be using the *Secret Identifier* URL.
85+
When you rotate your certificate in Key Vault, Azure Container Apps automatically updates the certificate in your environment. It takes up to 12 hours for the new certificate to be applied.
11886

11987
## Related
12088

12189
> [!div class="nextstepaction"]
122-
> [Manage secrets](manage-secrets.md)
90+
> [Certificates in Azure Container Apps](certificates-overview.md)

0 commit comments

Comments
 (0)