Assigne user assigned managed identity to Container Instance


Hi Team,

I am trying to access azure keyvault inside my container instance app. However, I am not getting the proper response.

  1. Creates Web APi with DefaultAzureCredential
  2. User's image
  3. Able to retrive the data using aboe code.
  4. Built image and pushed into Azure container registry
  5. Created user defined managed identity
    1. az identity create --resource-group "POCRG" --name "AcIdSample20240530101995"
  6. Provide keyvault secret user role to above identity
  7. Created a container and assigned above identity
    1. az container create --resource-group "POCRG" --name "democmdapi-userassigned" --image "" --assign-identity "/subscriptions/f9356ed2-112486e/resourcegroups/POCRG/providers/Microsoft.ManagedIdentity/userAssignedIdentities/AcIdSample20240530101995" --os-type "Windows" --registry-username "Sample02055" --registry-password "2ITH1E7gn0oujgaZ+ACRA+SoJX" --dns-name-label "api-dem-az2-user-assigned" --ip-address "Public"
  8. When I try to access the application, it is giving an error
  9.    ManagedIdentityCredential authentication failed: DefaultIdentityNotDefined \r\nStatus: 404 (Not Found)\r\nErrorCode
Azure Key Vault
Azure Key Vault
An Azure service that is used to manage and protect cryptographic keys and other secrets used by cloud apps and services.
1,158 questions
Microsoft Identity Manager
Microsoft Identity Manager
A family of Microsoft products that manage a user's digital identity using identity synchronization, certificate management, and user provisioning.
632 questions
Azure Container Instances
Azure Container Instances
An Azure service that provides customers with a serverless container experience.
659 questions
{count} votes