Setting up Azure CLI on Mac
Azure CLI is a cross platform CLI that can be used to automate all things Azure as well as one-off interactions with Azure. The best way to install is using Homebrew. Azure CLI is built with python3 and has a few dependencies which are taken care of when you install using homebrew.
- Install homebrew (if you don't already have it)
- Install Azure CLI
brew update && brew install azure-cli
If you receive errors during brew install that complaint about permissions, read carefully the path to which permission is denied. The usual brew way is to download a formulae, build a keg and then create a symbolic link. A keg is placed at
Permission issues usually occur if your current user does not have write access to:
- /usr/local/Frameworks etc...
These messages are usually of the form
Linking /usr/local/Cellar/python/3.7.0... Error: Permission denied @ dir_s_mkdir - /usr/local/Frameworks
To fix this, follow the steps below:
- Create the directory manually and change ownership to the user in question. E.g.
sudo mkdir /usr/local/Frameworks
sudo chown user:group /usr/local/Frameworks
- Then, run brew link to link the keg
brew link python
Configure az cli
To configure the cli:
This will store settings at /Users/username/.azure/config
Hope that helps!