How to install Azure CLI on MacOS

The Azure CLI 2.0 is Microsoft’s command line interface for managing Azure resources. First install the CLI through brew

brew update && brew install azure-cli

Then run the login command which will launch a browser session for your login credentials

jvzoggel$ az login
Fail to load or parse file /Users/jvzoggel/.azure/azureProfile.json. It is overridden by default settings.
Fail to load or parse file /Users/jvzoggel/.azure/az.json. It is overridden by default settings.
Fail to load or parse file /Users/jvzoggel/.azure/az.sess. It is overridden by default settings.
Note, we have launched a browser for you to login. For old experience with device code, use "az login --use-device-code"
You have logged in. Now let us find all the subscriptions to which you have access...
{
  "cloudName": "AzureCloud",
  "id": "xxxxxx",
  "isDefault": true,
.....
},

The first time the 3 Azure configuration files in your home/.azure will automatically be created.

 

References