Azure / Azure/azure-cli

az login and az account set fail with HTML-encoded characters and subscription not found

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

Description

### Describe the bug

When using Azure CLI on macOS with zsh, commands like `az account set` fail due to HTML-encoded characters like `<` and `>` being interpreted literally.

Also, even after successful login and selecting the correct subscription, Terraform fails to detect the subscription ID, and Azure CLI shows:

### Related command

az login
az account list
az account set --subscription ""

### Errors

zsh: no such file or directory: SUBSCRIPTION_ID
The subscription of '' doesn't exist in cloud 'AzureCloud'.
zsh: missing end of string

### Issue script & Debug output

az login --debug
az account set --subscription "" --debug

### Expected behavior

Azure CLI should correctly parse and set the subscription ID. HTML-encoded characters should not appear in the terminal. Terraform should be able to detect the subscription ID from the Azure CLI session.

### Environment Summary

az --version

### Additional context

Using macOS with zsh. Commands copied from web sources seem to include HTML-encoded characters like `<` instead of `<`, which causes parsing issues.

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.