ManagedIdentityCredential not working from Container Instance

Steve Hayles 6 Reputation points

Using Azure.Identity SDK 1.3 in an Azure Container Instance fails when trying to use a managed identity with the message "ManagedIdentityCredential authentication unavailable: No Managed Identity endpoint found"

Enabling a System Managed Identity from the portal appears to work and the identity is available in Azure AD as expected. The container instance does not contain the environment variables "MSI_ENDPOINT" and "MSI_SECRET" which appear to be set automatically when trying something similar from an App Service

Is this supported, should the endpoints be set specifically via Environment Variable or in code ?

Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
580 questions
Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
17,600 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 34,231 Reputation points Microsoft Employee

    @Steve Hayles
    Thank you for your post and I apologize for the delayed response!

    When it comes to using Managed Identities from a Container Instance, are you able to share any documentation that you followed to enabled this? This way I can gain a better understanding of our issue. I've also reached out to our AKS team regarding this so they can take a look into this issue as well.

    Additional links:
    How to use managed identities with Azure Container Instances
    Is there support for Azure Kubernetes Containers?
    Updating to version 3 throws "No managed identity endpoint found" with managed identity
    AKS 1.15.11 getting : ManagedIdentityCredential authentication unavailable, no managed identity endpoint found when using eventhub
    Azure Container Instance - Managed Identity not available when container first deployed or restarted

    If you have any other questions or would like to work with our support team to get this issue resolved, please let me know.
    Thank you for your time and patience!