-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error from Container Apps- Failed to connect to MSI. Please make sure MSI is configured correctly. #22677
Comments
route to CXP team |
@guitarrapc Thank you for reaching out, we are looking into it. |
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @macolso. Issue Details
Related command
Describe the bug Running
To Reproduce
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
Expected behavior Managed Identity can be use for Environment summary Docker Additional context
|
I'm also facing this issue and wonder if there has been any resolution for it |
Do we have an update on this? As It's a preferred method to manage authentication instead of using a service principal. |
@yonzhan the issue here is that
This appears to be using the msrestazure-for-python, and sure enough we find that library is attempting to determine the environment it is running in by looking at environment variables with no support for Container Apps. We opened an issue there to get this resolved (Azure/msrestazure-for-python#167), which was closed saying that msrestazure-for-python is deprecated in favor of azure-sdk-for-python. @yonzhan can you please advise which python library this needs to be fixed in? |
@vturecek, your investigation is accurate. The document for App Service's managed identity endpoint https://learn.microsoft.com/en-us/azure/app-service/overview-managed-identity?tabs=portal%2Chttp#rest-endpoint-reference doesn't even describe It has been concluded that MSAL will support all variations of managed identity (AzureAD/microsoft-authentication-library-for-python#58), including |
Workaround is to set the environment variable APPSETTING_WEBSITE_SITE_NAME to any value, which will make the CLI interpret itself as running under App Service, reverting to App Service semantics.
|
We're getting intermittent "Connection refused" when EDIT: This seems to be covered by #568. |
Thanks @maskati |
@yonzhan Can you please advise @vturecek on how to proceed with this?
|
We are working on migrating to MSAL to consume the latest managed identity API version in #25959, but there is currently no ETA yet. |
tried your fix, but still having issues: in my script i run
and passing the resource id for the uami, but still getting this error
|
Should use |
Any idea if this is being looked into or has a expected resolve date? |
Thanks @maskati, after setting |
Just to add with container app jobs for self hosted ADO agents you need to use both and manually set the client id export APPSETTING_WEBSITE_SITE_NAME=DUMMY
az login --identity -u $MSI_CLIENT_ID |
Any updates on this? It works for me in an Azure Container App by setting: The container app is setup like this (bicep):
|
Related command
Describe the bug
Running
azure-cli
in ContainerApps with MSI, both System assigned and User assigned, butaz login --identity
failed with 405.To Reproduce
foo
.bar
.console
in Container App side Menu.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
The text was updated successfully, but these errors were encountered: