Background
MSAL for Java (msal4j) now supports acquiring tokens for user-assigned managed identities (UAMI) on Azure Arc (msal4j 1.26.0). Historically Azure Arc only supported system-assigned managed identity (SAMI). This issue tracks enabling Arc UAMI in azure-identity (ManagedIdentityCredential and DefaultAzureCredential).
Current behavior
ManagedIdentityCredential routes Arc through ManagedIdentityMsalCredential → msal4j's ManagedIdentityApplication (only AKS federated-token is special-cased to AksExchangeTokenCredential). So the Arc token path already uses MSAL.
- However,
ManagedIdentityCredential.getToken() contains an explicit upfront block: when a UAMI id is set and ManagedIdentityApplication.getManagedIdentitySource() is CLOUD_SHELL or AZURE_ARC, it throws CredentialUnavailableException ("User-assigned managed identity is not supported in AZURE_ARC..."). A separate block exists for SERVICE_FABRIC.
- A legacy
ArcIdentityCredential also contains a UAMI guard (if (getClientId() != null) throw ...) that appears unused now that Arc is routed through ManagedIdentityMsalCredential.
Net effect: the token path is already MSAL-based; enabling Arc UAMI mainly requires removing the explicit AZURE_ARC guard plus a dependency uptake.
Scope of work
Key references
sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredential.java
sdk/identity/azure-identity/src/main/java/com/azure/identity/ArcIdentityCredential.java
sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityMsalCredential.java
Background
MSAL for Java (
msal4j) now supports acquiring tokens for user-assigned managed identities (UAMI) on Azure Arc (msal4j1.26.0). Historically Azure Arc only supported system-assigned managed identity (SAMI). This issue tracks enabling Arc UAMI inazure-identity(ManagedIdentityCredentialandDefaultAzureCredential).Current behavior
ManagedIdentityCredentialroutes Arc throughManagedIdentityMsalCredential→msal4j'sManagedIdentityApplication(only AKS federated-token is special-cased toAksExchangeTokenCredential). So the Arc token path already uses MSAL.ManagedIdentityCredential.getToken()contains an explicit upfront block: when a UAMI id is set andManagedIdentityApplication.getManagedIdentitySource()isCLOUD_SHELLorAZURE_ARC, it throwsCredentialUnavailableException("User-assigned managed identity is not supported in AZURE_ARC..."). A separate block exists forSERVICE_FABRIC.ArcIdentityCredentialalso contains a UAMI guard (if (getClientId() != null) throw ...) that appears unused now that Arc is routed throughManagedIdentityMsalCredential.Net effect: the token path is already MSAL-based; enabling Arc UAMI mainly requires removing the explicit
AZURE_ARCguard plus a dependency uptake.Scope of work
msal4jto>= 1.26.0.AZURE_ARCfrom the UAMI guard inManagedIdentityCredential.getToken()(keep the Cloud Shell and Service Fabric guards).ArcIdentityCredential(optional).Key references
sdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityCredential.javasdk/identity/azure-identity/src/main/java/com/azure/identity/ArcIdentityCredential.javasdk/identity/azure-identity/src/main/java/com/azure/identity/ManagedIdentityMsalCredential.java