Repository navigation
az login and az account set fail with HTML-encoded characters and subscription not found #32324
Description
Activity
- addedbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
on Oct 26, 2025 Thank you for opening this issue, we will look into it.
- addedcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.Auto-AssignAuto assign by botAuto assign by botARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupaz resource/group/lock/tag/deployment/policy/managementapp/account management-group
on Oct 26, 2025 - addedAzure CLI TeamThe command of the issue is owned by Azure CLI teamThe command of the issue is owned by Azure CLI teamquestionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatAccountaz login/accountaz login/account
on Oct 26, 2025 - removedbugThis issue requires a change to an existing behavior in the product in order to be resolved.This issue requires a change to an existing behavior in the product in order to be resolved.
on Oct 26, 2025 Solutionpoint-blip commented
on Oct 26, 2025 AuthorMore actionsHi Yong Zhang (@yonzhan) and Azure CLI team,
Thank you for acknowledging the issue.
I’m currently using macOS with the zsh shell, and I’ve noticed that when copying commands from web sources or documentation, they often include HTML-encoded characters like <SUBSCRIPTION_ID> instead of the correct <SUBSCRIPTION_ID>. This causes parsing errors in both zsh and Terraform, especially when setting environment variables or executing CLI commands.
For example:
ShellSUB="<SUBSCRIPTION_ID>" # ❌ FailsSUB="<SUBSC
SUB="<SUBSCRIPTION_ID>" # ❌ Fails
SUB="<SUBSCRIPTION_ID>" # ✅ Works correctlyThis behavior leads to failures in commands such as az account set --subscription, which expects a properly formatted subscription ID.
Suggestion:Add a note in the documentation warning users about HTML encoding issues when copying commands.
Sanitize CLI examples to ensure they are copy-paste friendly across different environments.Environment details:
Azure CLI: 2.78.0
Python: 3.13.9
Tenant: D P Printing And Binding
Subscription: Azure subscription 1Please let me know if you need any logs or further reproduction steps. I’ll be happy to assist.
Thanks again!
– Solutionpoint-blipLet me know if you'd like to include screenshots or logs with this comment.
Provide your feedback on BizChatThe
<and>in your comment are actually converted to<and>by GitHub markdown:I’m currently using macOS with the zsh shell, and I’ve noticed that when copying commands from web sources or documentation, they often include HTML-encoded characters like <SUBSCRIPTION_ID> instead of the correct <SUBSCRIPTION_ID>. This causes parsing errors in both zsh and Terraform, especially when setting environment variables or executing CLI commands. For example: ShellSUB="<SUBSCRIPTION_ID>" # ❌ FailsSUB="<SUBSC SUB="<SUBSCRIPTION_ID>" # ❌ Fails SUB="<SUBSCRIPTION_ID>" # ✅ Works correctly
Commands copied from web sources seem to include HTML-encoded characters like
<instead of<Could you share some example web sources? This doesn't seem to happen on Windows or Linux.
Also, the
<and>are merely placeholders meaning the string<SUBSCRIPTION_ID>should be replaced by a real subscription ID or name, so a real command should look likeaz account set --subscription "2b476f58-53d6-40e7-b051-f4ec1fcad3d5" az account set --subscription "Azure subscription 1"
Describe the bug
When using Azure CLI on macOS with zsh, commands like
az account setfail 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 "<SUBSCRIPTION_ID>"
Errors
zsh: no such file or directory: SUBSCRIPTION_ID
The subscription of '<subscription_id>' 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.