Container instance with managed identity is not working with storage account and other Azure services

Serhii Divnych 45 Reputation points
2025-03-12T10:31:42.85+00:00

Hi. I'm facing issues with container instances for 2 subscriptions in East US. Code deployed to container instance is using managed identity access to storage account, and to Azure AI services multi-service account. Beginning from 9th of March managed identity access stoped working, and container instances are not working getting below errors from logs

      Execute threw an unhandled exception.
      Azure.Identity.AuthenticationFailedException: ManagedIdentityCredential authentication failed: Service request failed.
      Status: 500 (Internal Server Error)
      
      Content:
      Received invalid token. Please try again.
      
      
      Headers:
      X-Content-Type-Options: REDACTED
      Date: Wed, 12 Mar 2025 11:53:22 GMT
      Content-Type: text/plain; charset=utf-8
      Content-Length: 42
      
      See the troubleshooting guide for more information. https://aka.ms/azsdk/net/identity/managedidentitycredential/troubleshoot
       ---> Azure.RequestFailedException: Service request failed.
      Status: 500 (Internal Server Error)
      
      Content:
      Received invalid token. Please try again.
      
      
      Headers:
      X-Content-Type-Options: REDACTED
      Date: Wed, 12 Mar 2025 11:53:22 GMT
      Content-Type: text/plain; charset=utf-8
      Content-Length: 42
      
         at Azure.Identity.ManagedIdentitySource.HandleResponseAsync(Boolean async, TokenRequestContext context, HttpMessage message, CancellationToken cancellationToken)
         at Azure.Identity.ImdsManagedIdentitySource.HandleResponseAsync(Boolean async, TokenRequestContext context, HttpMessage message, CancellationToken cancellationToken)
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
751 questions
{count} votes

Accepted answer
  1. Toni Hoang 90 Reputation points
    2025-03-13T17:12:48.8733333+00:00

    To have it as an answer: it seems it only happens when both System Assigned and User Assigned Identity are active. As a temporary workaround removing the User Assigned Identy seems to make it work again.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.