Azure / Azure/azure-cli

az login --identity fails on ML compute instance with MSI enabled

Open
#25,543 2 comments 0 reactions 1 assignee Claimed by @jiasli View on GitHub
Account act-identity-squad Auto-Assign Azure CLI Team customer-reported feature-request
Dominant language
Python
Stars
4.6k
Forks
3.5k
Avg merge
3d 2h
Merged PRs (30d)
60

Description

**Related command**

`az login --identity`

**Describe the bug**

When running `az login --identity` in a SSH session of a ML Compute Instance with System Managed Identity enabled, I get the error:

```
Failed to connect to MSI. Please make sure MSI is configured correctly.
Get Token request returned http error: 400, reason: Bad Request
```

Even if MSI is configured

**To Reproduce**

- Create ML Compute Instance with SSH access enabled and System Managed Identity
- Login into ML compute instance using SSH
- Run `az login --identity` as suggested by the welcome message

**Expected behavior**

I should be able to login without errors

## Environment Summary
```
Linux-5.15.0-1031-azure-x86_64-with-glibc2.31, Ubuntu 20.04.5 LTS
Python 3.10.8
Installer: DEB

azure-cli 2.45.0

Extensions:
ml 2.14.0

Dependencies:
msal 1.20.0
azure-mgmt-resource 21.1.0b1
```
## Additional Context

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.