Hi MKD,
Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
Based on the error details you shared, I have shared troubleshooting steps that I felt will help resolve the issue you reported
The error message you encountered indicates an issue with the federated identity setup when migrating to Azure Kubernetes Service (AKS) using workload identity.
Verify the Workload Identity Configuration in Azure AD:
Check that the federated credentials are configured correctly - Issuer URL should match the issuer of the token, Subject should match the value provided by your pod identity setup (typically in the format 'system:serviceaccount:<namespace>:<serviceaccount>
') and Audience should be set to 'api://AzureADTokenExchange
'
Inspect the token and verify the aud, iss, and sub claims:
To get the token: kubectl exec <pod_name> -n <namespace> -- cat /var/run/secrets/azure/tokens/token
Double check there are no case sensitivity issues with the audience, issuer, or subject claims. Even a small case difference will cause Azure AD to reject the token.
Please refer to the below link for more information.
If you have any further queries, please do let us know.
If the answer is helpful, please click "Accept Answer" and "Upvote it."