Error from Container Apps- Failed to connect to MSI. Please make sure MSI is configured correctly.
See original GitHub issue
az feedback
auto-generates most of the information requested below, as of CLI version 2.37.0
Related command
az login --identity
Describe the bug
Running azure-cli
in ContainerApps with MSI, both System assigned and User assigned, but az login --identity
failed with 405.
Failed to connect to MSI. Please make sure MSI is configured correctly.
Get Token request returned: <Response [405]>
To Reproduce
- Prepare ResourceGroup
foo
. - Prepare ContainerApps Environment
bar
. - Save YAML as follows, please replace xxxx with your subscription id.
kind: containerapp
location: japaneast
name: azure-cli
resourceGroup: foo
type: Microsoft.App/containerApps
identity:
type: "systemAssigned"
properties:
managedEnvironmentId: "/subscriptions/xxxx/resourceGroups/foo/providers/Microsoft.App/managedEnvironments/bar"
configuration:
activeRevisionsMode: Single
template:
containers:
- image: "mcr.microsoft.com/azure-cli"
name: azure-cli
command:
["/bin/bash", "-c", "while true; do ping localhost; sleep 60;done"]
resources:
cpu: 0.25
memory: 0.5Gi
scale:
minReplicas: 1
maxReplicas: 1
- Deploy Container App.
az containerapp create -n "azure-cli" -g "foo" --yaml ./deploy/containerapp/azure-cli.yaml
- (optional) Assign UserAssignedIdentity if needed.
az containerapp identity assign --name "azure-cli" --resource-group "foo" --user-assigned "/subscriptions/xxxxx/resourceGroups/foo/providers/Microsoft.ManagedIdentity/userAssignedIdentities/<YOUR_ID>"
- Go to
console
in Container App side Menu. - Run
az login --identity
. You will find error message describe about.
Expected behavior
Managed Identity can be use for az login
as describe in doc.
Environment summary
Docker
Additional context
# az --version
azure-cli 2.37.0
core 2.37.0
telemetry 1.0.6
Dependencies:
msal 1.18.0b1
azure-mgmt-resource 21.1.0b1
Python location '/usr/local/bin/python'
Extensions directory '/root/.azure/cliextensions'
Python (Linux) 3.10.4 (main, Apr 20 2022, 01:09:52) [GCC 10.3.1 20211027]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Failed to connect to MSI. Please make sure MSI is configured ...
Failed to connect to MSI. Please make sure MSI is configured correctly. ... Connect to the container and attempt to authenticate with az...
Read more >Container instances sporadically cannot connect to MSI ...
ERROR : MSI endpoint is not responding. Please make sure MSI is configured correctly.\nError detail: MSI: Failed to acquire tokens after 12 ...
Read more >When I am running a deployment command on my pipeline us ...
While doing so I am doing it through Azure CLI (Inline command). 2022-11-17T08:27:29.5243851Z ERROR: Failed to connect to MSI. Please make sure ......
Read more >Create a Kubernetes pod that uses Managed Service Identity ...
MIC uses the service principal credentials stored within the the AKS cluster to access azure resources. This service principal needs to have Microsoft....
Read more >Troubleshooting and Support — Acrobat Desktop Windows ...
This error occurs because one of the product's subdirectories under Program Files does not have the correct group permissions. To fix the problem,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also facing this issue and wonder if there has been any resolution for it
@guitarrapc Thank you for reaching out, we are looking into it.