Skip to content

"az resource ls" throws errors on macOS #34237

Open

Description

@ceri

Describe the bug

az resource threw a bunch of errors. Even if "ls" isn't a valid option, it shouldn't be doing this and it makes me worry about using this at all.

Command Name
az resource ls

Errors:

❯ az resource ls
/opt/homebrew/Caskroom/azure-cli/2.91.0/libexec/lib/python3.14/site-packages/azure/batch/models/_models.py:9067: SyntaxWarning: "\ " is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\ "? A raw string is also an option.
  """The source port ranges to match for the rule. Valid values are '\ *' (for all ports 0 - 65535),
/opt/homebrew/Caskroom/azure-cli/2.91.0/libexec/lib/python3.14/site-packages/azure/batch/models/_models.py:9235: SyntaxWarning: "\ " is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\ "? A raw string is also an option.
  using brackets (for example abc[\ *] would match a file named abc*\ ). Note that both and / are
/opt/homebrew/Caskroom/azure-cli/2.91.0/libexec/lib/python3.14/site-packages/azure/mgmt/resource/deploymentstacks/models/_models.py:119: SyntaxWarning: "\/" is an invalid escape sequence. Such sequences will not work in the future. Did you mean "\\/"? A raw string is also an option.
  following actions are automatically appended to 'excludedActions': '*\/read' and
'ls' is misspelled or not recognized by the system.

https://aka.ms/cli_ref
Read more about the command in reference docs

~ on ☁️  (eu-west-2) took 7s

To Reproduce:

Steps to reproduce the behavior.

  • az resource ls

Expected Behavior

Environment Summary

macOS-27.0.1-arm64-arm-64bit-Mach-O
Python 3.14.8
Installer: HOMEBREW_CASK

azure-cli 2.91.0

Additional Context

Activity

  1. yonzhan commented on Oct 19, 2026

    @yonzhan
    Collaborator

    Thank you for opening this issue, we will look into it.

  2. added
    customer-reportedIssues that are reported by GitHub users external to the Azure organization.
    ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-group
    Azure CLI TeamThe command of the issue is owned by Azure CLI team
    questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
    on Oct 19, 2026
  3. added this to the Backlog milestone on Oct 19, 2026
  4. microsoft-github-policy-service commented on Oct 19, 2026

    @microsoft-github-policy-service
    Contributor

    🔔 Routing this issue to @Azure/act-identity-squad.

  5. x-engineering-agent commented on Oct 19, 2026

    @x-engineering-agent
    Contributor

    Triage finding

    az resource ls is not a registered Azure CLI command. The resource command table registers az resource list, so the final ls is misspelled or not recognized message is the invalid-command error. Use az resource list to list resources.

    The preceding SyntaxWarning messages are separate from that error: the paths in the output point to installed azure.batch and azure.mgmt.resource.deploymentstacks SDK model files, and the warnings identify invalid escape sequences under Python 3.14. They do not indicate that a resource operation was attempted or failed. The actionable cleanup is in those SDK dependencies' Python 3.14 compatibility, not an az resource ls implementation. There is no evidence here of an Azure resource command failure with the supported list subcommand.

    Posted by x-engineering-agent (Fixer)

  6. x-engineering-agent commented on Oct 19, 2026

    @x-engineering-agent
    Contributor

    The resource command is az resource list, not az resource ls; the latter's “'ls' is misspelled or not recognized” error is expected. The resource command registration defines list but not ls.

    The preceding SyntaxWarning lines are separate: their paths point to installed azure.batch and azure.mgmt.resource.deploymentstacks SDK model files being parsed by Python 3.14, not to a failed resource operation. Please use az resource list for the intended command. The SDK warnings are still worth tracking independently for Python 3.14 compatibility; if they also appear with a valid CLI command, a separate issue with the warning paths and your CLI/Python versions would let maintainers investigate them without conflating them with the expected unknown-command error.

    Posted by x-engineering-agent (Fixer)

  7. isra-fel commented on Oct 20, 2026

    @isra-fel
    Member

    Reproduced on 2.91.0 but gives a meaningful error on 2.89.0. Might be a regression in between.

  8. microsoft-github-policy-service commented on Oct 20, 2026

    @microsoft-github-policy-service
    Contributor

    🔔 Routing this issue to @Azure/act-quality-productivity-squad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamact-quality-productivity-squadcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions