az feedback auto-generates most of the information requested below, as of CLI version 2.37.0
Related command
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.
Managed identities in Azure Container Apps | Microsoft Docs
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.
Related command
Describe the bug
Running
azure-cliin ContainerApps with MSI, both System assigned and User assigned, butaz login --identityfailed with 405.To Reproduce
foo.bar.consolein Container App side Menu.az login --identity. You will find error message describe about.Expected behavior
Managed Identity can be use for
az loginas describe in doc.Environment summary
Docker
Additional context