| title | Include file |
|---|---|
| description | Include file |
| services | api-center |
| ms.service | azure-api-center |
| ms.topic | include |
| ms.date | 03/09/2026 |
| ms.custom | Include file |
To allow import of the assets, assign your API center's managed identity the Key Vault Secrets User role in your Azure key vault. You can use the portal or the Azure CLI.
- In the portal, go to your key vault.
- In the sidebar menu, select Access control (IAM).
- Select + Add role assignment.
- On the Add role assignment page, set the values as follows:
- On the Role tab, select Key Vault Secrets User.
- On the Members tab, in Assign access to - Select Managed identity > + Select members.
- 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.
- Select Review + assign.
-
Get the principal ID of the identity. For a system-assigned identity, use the az apic show command.
#! /bin/bash apicObjID=$(az apic show --name <api-center-name> \ --resource-group <resource-group-name> \ --query "identity.principalId" --output tsv)# Formatted for PowerShell $apicObjID=$(az apic show --name <api-center-name> ` --resource-group <resource-group-name> ` --query "identity.principalId" --output tsv) -
Get the resource ID of your key vault using the az keyvault show command.
#! /bin/bash kvID=$(az keyvault show --name <kv-name> --resource-group <resource-group-name> --query "id" --output tsv)# Formatted for PowerShell $kvID=$(az keyvault show --name <kv-name> --resource-group <resource-group-name> --query "id" --output tsv) -
Assign the managed identity the Key Vault Secrets User role in your key vault the az role assignment create command.
#! /bin/bash scope="${kvID:1}" az role assignment create \ --role "Key Vault Secrets User" \ --assignee-object-id $apicObjID \ --assignee-principal-type ServicePrincipal \ --scope $scope# Formatted for PowerShell $scope=$apimID.substring(1) az role assignment create ` --role "Key Vault Secrets User" ` --assignee-object-id $apicObjID ` --assignee-principal-type ServicePrincipal ` --scope $scope