Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Syntax warnings with brand new Azure CLI on macOS installed via brew - attempt 2 #30998

Open
joelparkerhenderson opened this issue Mar 10, 2025 · 8 comments
Assignees
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Possible-Solution question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Milestone

Comments

@joelparkerhenderson
Copy link

joelparkerhenderson commented Mar 10, 2025

Describe the bug

Microsoft staff got trigger-happy and closed a bug report without actually verifying it as fixed. This is subpar DX so please see what you all can do to be mutually respectful and mutually committed to success together; for example, allot a day or week to communicate with the person who's reporting the bug.

#30963 (comment)

In this case, the bug that I'm experiencing is still NOT fixed.

Here's the updated info from just now, that shows the problem is still happening.

Is there a different/better command that you all want me to run, in order to reinstall? And/or a way you want the python item at issue to be changed/replaced/upgraded/etc.?

What's the path forward to getting Azure CLI to change from using Python to using a more reliable language, such as C# or Rust?

% brew reinstall azure-cli
==> Downloading https://ghcr.io/v2/homebrew/core/azure-cli/manifests/2.70.0
Already downloaded: /Users/brew/Library/Caches/Homebrew/downloads/ea4b3d97ffc52123734007002b9b4a421cd80d7c3fb836206f1c9ce075674b9c--azure-cli-2.70.0.bottle_manifest.json
==> Fetching azure-cli
==> Downloading https://ghcr.io/v2/homebrew/core/azure-cli/blobs/sha256:636ee4eece82539bb156
Already downloaded: /Users/brew/Library/Caches/Homebrew/downloads/7e839fc52e2dd43abc44823d3daa9a198bc7a267c4ee584ed1f9c1bd7a6ac6bb--azure-cli--2.70.0.arm64_sequoia.bottle.tar.gz
==> Reinstalling azure-cli 
==> Pouring azure-cli--2.70.0.arm64_sequoia.bottle.tar.gz
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Summary
🍺  /opt/homebrew/Cellar/azure-cli/2.70.0: 21,037 files, 497.0MB
==> Running `brew cleanup azure-cli`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

% az --version
azure-cli                         2.70.0

core                              2.70.0
telemetry                          1.1.0

Dependencies:
msal                            1.31.2b1
azure-mgmt-resource               23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/bin/python'
Config directory '/Users/jph/.azure'
Extensions directory '/Users/jph/.azure/cliextensions'

Python (Darwin) 3.12.9 (main, Feb  4 2025, 14:38:38) [Clang 16.0.0 (clang-1600.0.26.6)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.
/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/lib/python3.12/site-packages/deviceid/deviceid.py:9: SyntaxWarning: invalid escape sequence '\S'
  """
/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/lib/python3.12/site-packages/deviceid/_store.py:6: SyntaxWarning: invalid escape sequence '\M'
  REGISTRY_PATH = 'SOFTWARE\Microsoft\DeveloperTools'
\342\236\234 az --version
azure-cli                         2.70.0

core                              2.70.0
telemetry                          1.1.0

Dependencies:
msal                            1.31.2b1
azure-mgmt-resource               23.1.1

Python location '/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/bin/python'
Config directory '/Users/jph/.azure'
Extensions directory '/Users/jph/.azure/cliextensions'

Python (Darwin) 3.12.9 (main, Feb  4 2025, 14:38:38) [Clang 16.0.0 (clang-1600.0.26.6)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.
/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/lib/python3.12/site-packages/deviceid/deviceid.py:9: SyntaxWarning: invalid escape sequence '\S'
  """
/opt/homebrew/Cellar/azure-cli/2.70.0/libexec/lib/python3.12/site-packages/deviceid/_store.py:6: SyntaxWarning: invalid escape sequence '\M'
  REGISTRY_PATH = 'SOFTWARE\Microsoft\DeveloperTools'


### Related command

See above

### Errors

See above

### Issue script & Debug output

See above

### Expected behavior

See above

### Environment Summary

See above

### Additional context

_No response_
@joelparkerhenderson joelparkerhenderson added the bug This issue requires a change to an existing behavior in the product in order to be resolved. label Mar 10, 2025
@yonzhan
Copy link
Collaborator

yonzhan commented Mar 10, 2025

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

@microsoft-github-policy-service microsoft-github-policy-service bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Mar 10, 2025
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Upgrade py-deviceid to version 0.1.1 or reinstall azure-cli to see if the issue has been fixed.

Reference:

Powered by issue-sentinel

@yonzhan yonzhan added Azure CLI Team The command of the issue is owned by Azure CLI team question The issue doesn't require a change to the product in order to be resolved. Most issues start as that and removed bug This issue requires a change to an existing behavior in the product in order to be resolved. labels Mar 11, 2025
@yonzhan yonzhan added this to the Backlog milestone Mar 11, 2025
@bebound
Copy link
Contributor

bebound commented Mar 11, 2025

Duplicate of #30963

Sorry for the misleading comment in previous issue.
It's pretty hard for you to verify if it's fixed now. Please wait for the next release.

PS: We only fix /opt/homebrew/Cellar/azure-cli/2.70.0/libexec/lib/python3.12/site-packages/deviceid/deviceid.py:9: SyntaxWarning: invalid escape sequence '\S'. You may see other warnings like /usr/local/Cellar/azure-cli/2.70.0/libexec/lib/python3.12/site-packages/azure/mgmt/batch/models/_models_py3.py:3512: SyntaxWarning: invalid escape sequence '\ '. They lead from other dependencies in CLI.

@joelparkerhenderson
Copy link
Author

joelparkerhenderson commented Mar 11, 2025

It's pretty hard for you to verify if it's fixed now. Please wait for the next release.

It turns out it's pretty easy to verify:

  1. Try brand new Azure CLI on macOS installed via brew.

  2. Run it such as as --version and if there are no syntax warnings, then this bug is fixed.

Waiting for the next release has been many months of problems, for many developers, in many other bug posts.

Is there a roadmap for changing away from bad dependencies in python, and changing to languages with better dependency management such as C# or Rust?

@bebound
Copy link
Contributor

bebound commented Mar 11, 2025

Reinstalling azure-cli won't work since the official package locks the dependency version.

I don't know why you think switching to other language may solve this issue. Language is totally not related to this.

@joelparkerhenderson
Copy link
Author

joelparkerhenderson commented Mar 11, 2025

I don't know why you think switching to other language may solve this issue. Language is totally not related to this.

Because the Azure CLI dependency on python is showing that Azure CLI is not compiling and testing all its dependencies. Thus the kinds of errors that I'm seeing and that hundreds more developers are finding every month that these python warning messages are happening.

Better languages, such as C# or Rust, make it easier to compile a single binary, including all dependencies, then test.

Language is totally not related to this.

It turns out language is totally related to this-- in fact this Azure CLI dynamic dependency is one of the key reasons that Microsoft is strongly recommending that Microsoft enterprise customers-- including me-- switch from python to Microsoft C#.

Can your Azure CLI team please ask the Microsoft C# team for help looking at this?

@bebound
Copy link
Contributor

bebound commented Mar 12, 2025

For the explanation of the warning, see #28829 (comment)

This is the root cause of the warning. It is related to when SyntaxWarning is raised in Python and how CLI dependencies are installed via Homebrew.

Better languages, such as C# or Rust

I will not participate in discussions about language wars.

@joelparkerhenderson
Copy link
Author

joelparkerhenderson commented Mar 12, 2025

I believe you're mistaken, because what that linked issue states is that the root cause is that Azure CLI is using python without sufficient controls i.e. the root cause is that Azure CLI is using a dependency that it doesn't control.

I don't know why you think switching to other language may solve this issue. Language is totally not related to this. … I will not participate in discussions about language wars.

I don't know what to tell you then. Microsoft's own enterprise support group is recommending changing to C# or Rust. That's not a war, that's the given advice of your own company. I'm agreeing with what your company is already saying.

And what your own links show is that the problem has been happening for many months, and still has no fix-- that's a long time to have broken FTUX for something as important as Azure.

For comparison, AWS CLI and GCS CLI do not have this problem; it's only Azure CLI that has the problem.

Therefore I'm seeking any kind of long-term Azure solution that 1) solves this immediate issue, 2) helps your team keep bug reports open until they are solved, 3) improves Azure overall such that it solves this category of issue going forward.

Your answer makes it sound like you're unwilling to contact your Microsoft colleagues about this issue, and about how to ask for help. Surely you agree that many months of a glitch like this is poor FTUX, yes?

All I'm asking is what's the appropriate way, path, roadmap, etc. to make this better, and ideally do what your own company is recommending please?

And if you have other suggestions, recommendations, roadmaps, plans, etc. that offer advice, I'd like to understand please. FTUX is important, Azure is important, and teamwork with Microsoft is important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure CLI Team The command of the issue is owned by Azure CLI team customer-reported Issues that are reported by GitHub users external to the Azure organization. Possible-Solution question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Similar-Issue
Projects
None yet
Development

No branches or pull requests

3 participants