Dave Poon / Thoughts and Ramblings

Install Azure CLI 2.0 on Oh My Zsh

Install Azure CLI 2.0 on Oh My Zsh

If you are trying to install Azure CLI 2.0 on Mac Oh My Zsh(zsh shell), you may get the following error after installation. You entered

~  az

then you get

~  zsh: command not found az

This is because by default, Azure CLI 2.0 will update the bash profile or .bash_profile in order to load the Azure CLI environment setup. If you didn’t read the last prompt carefully during the installation, you just hit the enter key for it, then you didn’t configure your zsh shell properly, that’s why zsh did not know where to find the az command.

In order to get zsh shell to know where to find the Azure CLI environment. You simply enter the path for your .zshrc location when the last prompt comes up,

===> Enter a path to an rc file to update (leave blank to use '/Users/username/.bash_profile'): ~/.zshrc

If you run az again in your terminal, you should see Azure CLI is now up and running!!

    /  \    _____   _ _ __ ___
   / /\ \  |_  / | | | \'__/ _ \
  / ____ \  / /| |_| | | |  __/
 /_/    \_\/___|\__,_|_|  \___|

Welcome to the cool new Azure CLI!

Chat with me?

Feel free to contact me on Twitter if you have any questions about this post.

Linode Referrals

If you are looking a great performance and cheap VPS hosting, you can get a Linode VPS with root access, 2GB RAM and SSD disk for only $10/month. As always, if you found this post useful, pretty please with whipped cream and cherries on top, sign it up with my Linode referral link.

And use promo code DOCS10 for $10 credit on a new account.

Subscribe to the RSS feed to get notified of new posts.