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

[Install] winget installation instructions don't add az to path #3568

Closed
3 tasks done
citelao opened this issue Mar 16, 2023 · 10 comments
Closed
3 tasks done

[Install] winget installation instructions don't add az to path #3568

citelao opened this issue Mar 16, 2023 · 10 comments
Assignees
Labels
assigned-to-author azure-powershell/svc doc-bug install Referencing docs having to do with Azure CLI installation triaged windows

Comments

@citelao
Copy link

citelao commented Mar 16, 2023

Prerequisites

  • Write a descriptive title.
  • Search the existing issues.
  • I am reporting the documentation problem for the current version of Azure CLI.

Azure CLI version being used

n/a

Link to affected document

https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=powershell

Description of the documentation error

I followed the winget installation instructions:

winget install -e --id Microsoft.AzureCLI

But this did not add az to my path. I am unable to run the az command bare; I have to run it:

& "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\az.cmd"

Suggested fix

2 possible fixes:

  1. Fix the winget recipe to include adding az to the path.
  2. Tell folks to add the directory to their path manually: C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin
@SaibabaBalapur-MSFT
Copy link

@citelao
Thanks for your feedback! We will investigate and update as appropriate.

@dbradish-microsoft dbradish-microsoft added azure-powershell/svc install Referencing docs having to do with Azure CLI installation labels May 2, 2023
@bebound
Copy link
Contributor

bebound commented May 16, 2023

After the installation is complete, you will need to close and reopen any active terminal window to use the Azure CLI.

Kindly restart terminal and it should work.

@dbradish-microsoft
Copy link
Collaborator

@citelao, Did you restart PowerShell before you tried to run az? That should fix the problem.

@dbradish-microsoft
Copy link
Collaborator

@citelao, We are closing this issue for now, but feel free to comment here as necessary. Thank you for your feedback.

@wheniuseoddjoy
Copy link

Found this page during a websearch. A terminal restart is indeed the answer.

@citelao
Copy link
Author

citelao commented Aug 28, 2023

Took me a while to login to respond to this issue, but yes, restarting Terminal (not PowerShell!) was sufficient to add az to the path. Modern versions of Terminal will also find az on the path in new tabs (no Terminal restart necessary): microsoft/terminal#14999 and microsoft/terminal#15102.

This is caused by microsoft/winget-cli#549 (see also microsoft/winget-cli#549 (comment)).

@thedomeffm
Copy link

thedomeffm commented Aug 20, 2024

I've installed the az yesterday via winget and restarting the windows powershell and even reboot the system does not help. The installation does not add it to the path. Probably @dbradish-microsoft can reopen the issue.

@dbradish-microsoft
Copy link
Collaborator

@thedomeffm, What version of Windows are you running? winget is only available by default in Windows 11 and modern versions of Windows 10.

@thedomeffm
Copy link

@thedomeffm, What version of Windows are you running? winget is only available by default in Windows 11 and modern versions of Windows 10.

Windows 11 Enterprise 23H2

@thedomeffm
Copy link

@dbradish-microsoft

I've solved it by adding the following path to the $profile.CurrentUserCurrentHost:

$env:Path += ';C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin'

But from my expecation the installation of azure cli should have done it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned-to-author azure-powershell/svc doc-bug install Referencing docs having to do with Azure CLI installation triaged windows
Projects
None yet
Development

No branches or pull requests

7 participants