You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This article shows how to create a managed identity for an Azure API Management instance and how to use it to access other resources. A managed identity generated by Microsoft Entra ID enables API Management to easily and securely access other resources that are protected by Microsoft Entra, like Azure Key Vault. Azure manages these identities, so you don't have to provision or rotate any secrets. For more information about managed identities, see [What are managed identities for Azure resources?](../active-directory/managed-identities-azure-resources/overview.md)
22
+
This article shows how to create a managed identity for an Azure API Management instance and how to use it to access other resources. By using a managed identity generated by Microsoft Entra ID, API Management can easily and securely access other resources that are protected by Microsoft Entra, like Azure Key Vault. Azure manages these identities, so you don't have to provision or rotate any secrets. For more information about managed identities, see [What are managed identities for Azure resources?](../active-directory/managed-identities-azure-resources/overview.md)
23
23
24
24
You can grant two types of identities to an API Management instance:
25
25
26
26
- A *system-assigned identity* is tied to your service and is deleted if your service is deleted. The service can have only one system-assigned identity.
27
-
- A *user-assigned identity* is a standalone Azure resource that can be assigned to your service. The service can have multiple user-assigned identities.
27
+
- A *user-assigned identity* is a standalone Azure resource that you can assign to your service. The service can have multiple user-assigned identities.
28
28
29
29
> [!NOTE]
30
-
> - Managed identities are specific to the Microsoft Entra tenant in which your Azure subscription is hosted. They don't get updated if a subscription is moved to a different directory. If a subscription is moved, you need to recreate and reconfigure the identities.
30
+
> - Managed identities are specific to the Microsoft Entra tenant in which your Azure subscription is hosted. They don't get updated if you move a subscription to a different directory. If you move a subscription, you need to recreate and reconfigure the identities.
31
31
> - API Management managed identities are also specific to the Azure subscription in which the service is hosted. If you move the service to a different subscription in the same tenant, you need to recreate and reconfigure the identities.
@@ -36,7 +36,9 @@ You can grant two types of identities to an API Management instance:
36
36
37
37
### Azure portal
38
38
39
-
To set up a managed identity in the Azure portal, you create an API Management instance and then enable the feature.
39
+
In the Azure portal, you can enable a system-assigned managed identity when you create an API Management instance, or you can create an API Management instance and then enable the feature.
40
+
41
+
To enable a managed identity in an existing instance:
40
42
41
43
1. Create an API Management instance in the portal as you normally would. Go to it in the portal.
42
44
1. In the left menu, under **Security**, select **Managed identities**.
@@ -84,7 +86,7 @@ You can create an API Management instance with a system-assigned identity by inc
84
86
85
87
This property instructs Azure to create and manage the identity for your API Management instance.
86
88
87
-
For example, a complete ARM template might look like this one:
89
+
For example, a complete ARM template might look like the following example:
88
90
89
91
```json
90
92
{
@@ -128,34 +130,34 @@ The `tenantId` property identifies which Microsoft Entra tenant the identity bel
128
130
129
131
## Configure Key Vault access by using a managed identity
130
132
131
-
The following configurations are required if you want to use API Management to access certificates from an Azure key vault.
133
+
To use API Management to access certificates from an Azure key vault, configure the following settings.
## Supported scenarios that use system-assigned identity
138
140
139
-
Following are some common scenarios for using a system-assigned managed identity in Azure API Management.
141
+
The following list shows some common scenarios for using a system-assigned managed identity in Azure API Management.
140
142
141
143
### Obtain a custom TLS/SSL certificate for the API Management instance from Key Vault
142
144
143
-
You can use the system-assigned identity of an API Management instance to retrieve custom TLS/SSL certificates that are stored in Key Vault. You can then assign these certificates to custom domains in the API Management instance. Take these considerations into account:
145
+
You can use the system-assigned identity of an API Management instance to retrieve custom TLS/SSL certificates that are stored in Key Vault. You can then assign these certificates to custom domains in the API Management instance. Consider the following points:
144
146
145
147
- The content type of the secret must be *application/x-pkcs12*. For more information, see [Domain certificate options](configure-custom-domain.md?tabs=key-vault#domain-certificate-options).
146
148
- You must use the Key Vault certificate secret endpoint, which contains the secret.
147
149
148
-
> [!Important]
150
+
> [!IMPORTANT]
149
151
> If you don't provide the object version of the certificate, API Management automatically obtains any newer version of the certificate within four hours after it's updated in Key Vault.
150
152
151
153
The following example shows an ARM template that uses the system-assigned managed identity of an API Management instance to retrieve a custom domain certificate from Key Vault.
152
154
153
155
#### Prerequisites
154
156
155
157
* An API Management instance that's configured with a system-assigned managed identity. To create the instance, you can use an [Azure Quickstart Template](https://azure.microsoft.com/resources/templates/api-management-create-with-msi/).
156
-
* A Key Vault instance in the same resource group. The instance must host a certificate that will be used as a custom domain certificate in API Management.
158
+
* A Key Vault instance in the same resource group. The instance must host a certificate that you use as a custom domain certificate in API Management.
157
159
158
-
The template contains the following steps.
160
+
The template contains the following steps:
159
161
160
162
1. Update the access policies of the Key Vault instance and allow the API Management instance to obtain secrets from it.
161
163
1. Update the API Management instance by setting a custom domain name through the certificate from the Key Vault instance.
@@ -311,11 +313,11 @@ You can use a system-assigned managed identity to access Key Vault to store and
311
313
312
314
### Authenticate to a backend by using an API Management identity
313
315
314
-
You can use the system-assigned identity to authenticate to a backend service via the [authentication-managed-identity](authentication-managed-identity-policy.md) policy.
316
+
Use the system-assigned identity to authenticate to a backend service via the [authentication-managed-identity](authentication-managed-identity-policy.md) policy.
315
317
316
318
### Connect to Azure resources behind an IP firewall by using a system-assigned managed identity
317
319
318
-
API Management is a trusted Microsoft service to the following resources. This trusted status enables the service to connect to the following resources behind a firewall when the firewall enables a setting to **Allow Trusted Microsoft Services to bypass this firewall**. After you explicitly assign the appropriate Azure role to the [system-assigned managed identity](../active-directory/managed-identities-azure-resources/overview.md) for a resource instance, the scope of access for the instance corresponds to the Azure role that's assigned to the managed identity.
320
+
API Management is a trusted Microsoft service to the following resources. This trusted status enables the service to connect to the following resources behind a firewall when the firewall enables the **Allow Trusted Microsoft Services to bypass this firewall** setting. After you explicitly assign the appropriate Azure role to the [system-assigned managed identity](../active-directory/managed-identities-azure-resources/overview.md) for a resource instance, the scope of access for the instance corresponds to the Azure role that's assigned to the managed identity.
319
321
320
322
321
323
-[Trusted access for Key Vault](/azure/key-vault/general/overview-vnet-service-endpoints#trusted-services)
@@ -333,12 +335,9 @@ You can configure and use a system-assigned managed identity to access an event
333
335
334
336
## Create a user-assigned managed identity
335
337
336
-
> [!NOTE]
337
-
> You can associate an API Management instance with as many as 10 user-assigned managed identities.
338
-
339
338
### Azure portal
340
339
341
-
To set up a managed identity in the portal, you must first create an API Management instance and [create a user-assigned identity](../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md). Then complete the following steps.
340
+
To set up a managed identity in the portal, first create an API Management instance and [create a user-assigned identity](../active-directory/managed-identities-azure-resources/how-manage-user-assigned-managed-identities.md). Then complete the following steps.
342
341
343
342
1. Go to your API Management instance in the portal.
344
343
1. In the left menu, under **Security**, select **Managed identities**.
@@ -397,9 +396,9 @@ You can create an API Management instance that has an identity by including the
397
396
}
398
397
```
399
398
400
-
Adding the user-assigned type informs Azure to use the user-assigned identity that's specified for your instance.
399
+
Adding the user-assigned type informs Azure to use the user-assigned identity that you specify for your instance.
401
400
402
-
For example, a complete ARM template might look like this one:
401
+
For example, a complete ARM template might look like the following example:
403
402
404
403
```json
405
404
{
@@ -432,7 +431,7 @@ For example, a complete ARM template might look like this one:
432
431
}
433
432
```
434
433
435
-
When the service is created, it has the following additional properties:
434
+
When you create the service, it has the following additional properties:
436
435
437
436
```json
438
437
"identity": {
@@ -449,25 +448,25 @@ When the service is created, it has the following additional properties:
449
448
The `principalId` property is a unique identifier for the identity that's used for Microsoft Entra administration. The `clientId` property is a unique identifier for the application's new identity that's used for specifying which identity to use during runtime calls.
450
449
451
450
> [!NOTE]
452
-
> An API Management instance can have both system-assigned and user-assigned identities. In that scenario, the `type` property would be`SystemAssigned,UserAssigned`.
451
+
> An API Management instance can have both system-assigned and user-assigned identities. In that scenario, the `type` property is`SystemAssigned,UserAssigned`.
453
452
454
453
## Supported scenarios that use user-assigned managed identities
455
454
456
-
Following are some common scenarios for using a user-assigned managed identity in Azure API Management.
455
+
The following list shows some common scenarios for using a user-assigned managed identity in Azure API Management.
457
456
458
457
### Obtain a custom TLS/SSL certificate for the API Management instance from Key Vault
459
458
460
459
You can use a user-assigned identity to establish trust between an API Management instance and Key Vault. This trust can then be used to retrieve custom TLS/SSL certificates that are stored in Key Vault. You can then assign these certificates to custom domains in the API Management instance.
461
460
462
461
> [!IMPORTANT]
463
-
> If [Key Vault firewall](/azure/key-vault/general/network-security) is enabled on your key vault, you can't use a user-assigned identity for access from API Management. You can use the system-assigned identity instead. For more information, see the section [Requirements for key vault firewall](#requirements-for-key-vault-firewall).
462
+
> If you enable [Key Vault firewall](/azure/key-vault/general/network-security) on your key vault, you can't use a user-assigned identity for access from API Management. You can use the system-assigned identity instead. For more information, see the section [Requirements for key vault firewall](#requirements-for-key-vault-firewall).
464
463
465
-
Take these considerations into account:
464
+
Consider the following requirements:
466
465
467
466
- The content type of the secret must be *application/x-pkcs12*.
468
467
- You must use the Key Vault certificate secret endpoint, which contains the secret.
469
468
470
-
> [!Important]
469
+
> [!IMPORTANT]
471
470
> If you don't provide the object version of the certificate, API Management automatically obtains any newer version of the certificate within four hours after it's updated in Key Vault.
472
471
473
472
@@ -476,7 +475,7 @@ Take these considerations into account:
476
475
You can use a user-assigned managed identity to access Key Vault to store and manage secrets for use in API Management policies. For more information, see [Use named values in Azure API Management policies](api-management-howto-properties.md).
477
476
478
477
> [!NOTE]
479
-
> If [Key Vault firewall](/azure/key-vault/general/network-security) is enabled on your key vault, you can't use a user-assigned identity for access from API Management. You can use the system-assigned identity instead. For more information, see the section [Requirements for key vault firewall](#requirements-for-key-vault-firewall).
478
+
> If you enable [Key Vault firewall](/azure/key-vault/general/network-security) on your key vault, you can't use a user-assigned identity for access from API Management. You can use the system-assigned identity instead. For more information, see the section [Requirements for key vault firewall](#requirements-for-key-vault-firewall).
480
479
481
480
### Authenticate to a backend by using a user-assigned identity
482
481
@@ -488,9 +487,9 @@ You can configure and use a user-assigned managed identity to access an event hu
488
487
489
488
## Remove an identity
490
489
491
-
You can remove a system-assigned identity by disabling the feature via the portal or an ARM template in the same way that it was created. User-assigned identities can be removed individually. To remove all identities, set the identity type to `"None"`.
490
+
You can remove a system-assigned identity by disabling the feature through the portal or by using an ARM template, just like you created it. You can remove user-assigned identities individually. To remove all identities, set the identity type to `"None"`.
492
491
493
-
Removing a system-assigned identity in this way also deletes it from Microsoft Entra ID. System-assigned identities are also automatically removed from Microsoft Entra ID when the API Management instance is deleted.
492
+
When you remove a system-assigned identity, you also delete it from Microsoft Entra ID. When you delete the API Management instance, the system-assigned identity is automatically removed from Microsoft Entra ID.
494
493
495
494
To remove all identities by using an ARM template, update this section:
496
495
@@ -500,10 +499,10 @@ To remove all identities by using an ARM template, update this section:
500
499
}
501
500
```
502
501
503
-
> [!Important]
504
-
> If an API Management instance is configured with a custom SSL certificate from Key Vault and you try to disable a managed identity, the request fails.
502
+
> [!IMPORTANT]
503
+
> If you configure an API Management instance with a custom SSL certificate from Key Vault and try to disable a managed identity, the request fails.
505
504
>
506
-
> You can resolve this by switching from a Key Vault certificate to an inline-encoded certificate and then disabling the managed identity. For more information, see [Configure a custom domain name](configure-custom-domain.md).
505
+
> You can resolve this problem by switching from a Key Vault certificate to an inline-encoded certificate and then disabling the managed identity. For more information, see [Configure a custom domain name](configure-custom-domain.md).
0 commit comments