Skip to content

Commit b9dc008

Browse files
authored
Merge pull request #274058 from dlepow/apicimp
[APIC] Identity config for import from APIM
2 parents b5ddd06 + d2f9c3a commit b9dc008

File tree

1 file changed

+6
-65
lines changed

1 file changed

+6
-65
lines changed

articles/api-center/import-api-management-apis.md

Lines changed: 6 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ When you add APIs from an API Management instance to your API center using `az a
131131

132132
### Add a managed identity in your API center
133133

134-
For this scenario, your API center uses a [managed identity](/entra/identity/managed-identities-azure-resources/overview) to access APIs in your API Management instance. Depending on your needs, use either a system-assigned or user-assigned managed identity. If you haven't added a managed identity in your API center, you can add it in the Azure portal or by using the Azure CLI.
134+
For this scenario, your API center uses a [managed identity](/entra/identity/managed-identities-azure-resources/overview) to access APIs in your API Management instance. Depending on your needs, configure either a system-assigned or one or more user-assigned managed identities.
135135

136-
#### Add a system-assigned identity
136+
The following examples show how to configure a system-assigned managed identity by using the Azure portal or the Azure CLI. At a high level, configuration steps are similar for a user-assigned managed identity.
137137

138138
#### [Portal](#tab/portal)
139139

140140
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
141-
1. In the left menu, select **Managed identities**.
141+
1. In the left menu, under **Security**, select **Managed identities**.
142142
1. Select **System assigned**, and set the status to **On**.
143143
1. Select **Save**.
144144

@@ -151,54 +151,6 @@ az apic service update --name <api-center-name> --resource-group <resource-group
151151
```
152152
---
153153

154-
#### Add a user-assigned identity
155-
156-
To add a user-assigned identity, you need to create a user-assigned identity resource, and then add it to your API center.
157-
158-
#### [Portal](#tab/portal)
159-
160-
1. Create a user-assigned identity according to [these instructions](/entra/identity/managed-identities-azure-resources/how-manage-user-assigned-managed-identities#create-a-user-assigned-managed-identity).
161-
1. In the [portal](https://azure.microsoft.com), navigate to your API center.
162-
1. In the left menu, select **Managed identities**.
163-
1. Select **User assigned** > **+ Add**.
164-
1. Search for the identity you created earlier, select it, and select **Add**.
165-
166-
#### [Azure CLI](#tab/cli)
167-
168-
1. Create a user-assigned identity.
169-
170-
```azurecli
171-
az identity create --resource-group <resource-group-name> --name <identity-name>
172-
```
173-
174-
In the command output, note the value of the identity's `id` property. The `id` property should look something like this:
175-
176-
```json
177-
{
178-
[...]
179-
"id": "/subscriptions/<subscription-id>/resourcegroups/<resource-group-name>/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<identity-name>"
180-
[...]
181-
}
182-
```
183-
184-
1. Create a JSON file with the following content, substituting the value of the `id` property from the previous step.
185-
186-
```json
187-
{
188-
"type": "UserAssigned",
189-
"userAssignedIdentities": {
190-
"<identity-id>": {}
191-
}
192-
}
193-
```
194-
195-
1. Add the user-assigned identity to your API center using the following [az apic service update](/cli/azure/apic/service#az-apic-service-update) command. Substitute the names of your API center and resource group, and pass the JSON file as the value of the `--identity` parameter. Here, the JSON file is named `identity.json`.
196-
197-
```azurecli
198-
az apic service update --name <api-center-name> --resource-group <resource-group-name> --identity "@identity.json"
199-
```
200-
---
201-
202154
### Assign the managed identity the API Management Service Reader role
203155

204156
To allow import of APIs, assign your API center's managed identity the **API Management Service Reader** role in your API Management instance. You can use the [portal](../role-based-access-control/role-assignments-portal-managed-identity.yml) or the Azure CLI.
@@ -211,14 +163,13 @@ To allow import of APIs, assign your API center's managed identity the **API Man
211163
1. On the **Add role assignment** page, set the values as follows:
212164
1. On the **Role** tab - Select **API Management Service Reader**.
213165
1. On the **Members** tab, in **Assign access to** - Select **Managed identity** > **+ Select members**.
214-
1. On the **Select managed identities** page - Select the system-assigned or user-assigned managed identity of your API center that you added in the previous section. Click **Select**.
166+
1. On the **Select managed identities** page - Select the system-assigned managed identity of your API center that you added in the previous section. Click **Select**.
215167
1. Select **Review + assign**.
216168

217169
#### [Azure CLI](#tab/cli)
218170

219-
1. Get the principal ID of the identity. If you're configuring a system-assigned identity, use the [az apic service show](/cli/azure/apic/service#az-apic-service-show) command. For a user-assigned identity, use [az identity show](/cli/azure/identity#az-identity-show).
171+
1. Get the principal ID of the identity. For a system-assigned identity, use the [az apic service show](/cli/azure/apic/service#az-apic-service-show) command.
220172

221-
**System-assigned identity**
222173
```azurecli
223174
#! /bin/bash
224175
apicObjID=$(az apic service show --name <api-center-name> \
@@ -233,16 +184,6 @@ To allow import of APIs, assign your API center's managed identity the **API Man
233184
--query "identity.principalId" --output tsv)
234185
```
235186
236-
**User-assigned identity**
237-
```azurecli
238-
#! /bin/bash
239-
apicObjID=$(az identity show --name <identity-name> --resource-group <resource-group-name> --query "principalId" --output tsv)
240-
```
241-
242-
```azurecli
243-
# PowerShell syntax
244-
$apicObjID=$(az identity show --name <identity-name> --resource-group <resource-group-name> --query "principalId" --output tsv)
245-
```
246187
1. Get the resource ID of your API Management instance using the [az apim show](/cli/azure/apim#az-apim-show) command.
247188
248189
```azurecli
@@ -279,7 +220,7 @@ To allow import of APIs, assign your API center's managed identity the **API Man
279220
--scope $scope
280221
---
281222
282-
### Import APIs directly from your API Management instance
223+
### Import APIs from API Management
283224
284225
Use the [az apic service import-from-apim](/cli/azure/apic/service#az-apic-service-import-from-apim) command to import one or more APIs from your API Management instance to your API center.
285226

0 commit comments

Comments
 (0)