I have an Azure Kubernetes Service (AKS) cluster hosted in one Azure AD tenant and an Azure Container Registry (ACR) hosted in another Azure AD tenant. The ACR is secured using a service principal, and the AKS cluster uses a managed identity. I need to configure the AKS cluster to pull container images from the ACR securely. What is the best approach to set up cross-tenant authentication and authorization between the AKS cluster and the ACR?
Here are the specific requirements and constraints:
- The ACR is located in Azure AD Tenant A, and the AKS cluster is hosted in Azure AD Tenant B.
- A service principal exists in Tenant A, which is used to secure the ACR.
- A managed identity exists in Tenant B, which is associated with the AKS cluster.
- The AKS cluster needs to be configured to authenticate with the ACR using its managed identity.
I've researched options like Azure RBAC, Azure AD B2B collaboration, and managed identities, but I'm unsure of the best approach to implement this configuration. Can someone provide guidance or a step-by-step solution to achieve this?
Any help or insights would be greatly appreciated. Thank you!
I've done some research, but i can't find any information if this is possible from a tenant in managed Identity and another with a Service principal.
To enable Azure Kubernetes Service (AKS) to pull images from an Azure Container Registry (ACR) located in a different Azure AD tenant, you can use a service principal to authenticate with the ACR and configure the AKS cluster to use the service principal credentials. Here are the steps to set up cross-tenant authentication and authorization between the AKS cluster and the ACR:
a. Sign in to the Azure portal in Tenant A.
b. Search for and select Microsoft Entra ID.
c. Under Manage, select App registrations > + New registration.
d. In Supported account types, select Accounts in any organizational directory.
e. Select Register. On the Overview page, take note of the Application (client) ID. It will be used in Step 4.
In Certificates & secrets, under Client secrets, select + New client secret. Enter a Description and tenure and select Add. Take note of the value of the client secret. You use it to update the AKS cluster's service principal.
Select Consent on behalf of your organization and then Accept.
Use the multitenant application (client) ID and client secret collected in Step 1 to update the AKS service principal credential.
You need at least the Contributor role in the AKS cluster's subscription and the Owner role in the container registry's subscription. For detailed step-by-step instructions, please refer to the Microsoft documentation on how to pull images from a container registry to an AKS cluster in a different Microsoft Entra tenant.
References: