Hi Ivan Webber,
We noticed your feedback that the above answer was not helpful. Thank you for taking time to share feedback.
Your understanding is spot on—the old cluster most likely used Pod Identity, which is why authentication worked without additional configuration. The new cluster follows Workload Identity, which requires explicit configuration in the deployment YAML.
Old Cluster (Using Pod Identity)
- A few years ago, Azure AD Pod Identity was the recommended way to assign Managed Identities to pods.https://github.com/Azure/aad-pod-identity
- It worked by deploying an agent (DaemonSet) in AKS that:
- Intercepted requests to IMDS (Instance Metadata Service).
- Redirected them to use a Kubernetes-assigned identity.
- The FastAPI app in the old cluster relied on this Pod Identity mechanism to authenticate without needing Service Connector or extra annotations.
New Cluster (Using Workload Identity) workload-identity
- Microsoft deprecated Pod Identity and replaced it with Azure Workload Identity for better performance and security.
- IMDS is no longer needed for authentication in Workload Identity.
- Instead, authentication now works by:
- Using OIDC (OpenID Connect).
- The Kubernetes Service Account is linked directly to an Azure Managed Identity.
- The pod uses an environment variable (
AZURE_CLIENT_ID
) and federated credentials to authenticate.
https://learn.microsoft.com/en-us/azure/aks/workload-identity-migrate-from-pod-identity
Workload Identity requires explicitly linking the Kubernetes Service Account to the Managed Identity.
The additional YAML keys (azure.workload.identity/use: "true"
and serviceAccountName
) were needed to enable Workload Identity authentication.
As per my understanding, your resolution follows Microsoft's recommended approach for enabling Workload Identity without code changes.
On a cluster that is already running a pod-managed identity, you can configure it to use workload identity one of two ways. The first option allows you to use the same configuration that you've implemented for pod-managed identity. You can annotate the service account within the namespace with the identity to enable Microsoft Entra Workload ID and inject the annotations into the pods.
Hope this helps!
Let me know if you have any further queries!
If you find the answer heplful, please consider Accepting answer and upvote.