🔥 Articles, eBooks, Jobs, Columnist, Forum, Podcasts, Courses 🎓

How to install Azure CLI on macOS | ecode10.com


How to install Azure CLI on macOS

The easiest way to install the Azure CLI on macOS

image

The easiest way to install the Azure CLI on macOS is via the Homebrew package manager.

Install with Homebrew (Recommended)

This method is officially supported by Microsoft and simplifies updates and uninstalls.

  • Prerequisites: Ensure you have Homebrew installed.
  • Installation: Open your terminal and run the following command:

brew update && brew install azure-cli

Alternative Installation (MacPorts)

If you prefer MacPorts, you can install it using pip within that environment.

  • Installation:
sudo port install python310
sudo port select --set python3 python310
pip install azure-cli

Verify the Installation

After installation, verify that the CLI is working by checking its version:

az version

4. Sign In to Azure

To begin managing resources, authenticate your session:

bash
az login

This will open your default browser for an interactive sign-in.

Managing the Installation

  • Update: To get the latest features and bug fixes, run:

    brew update && brew upgrade azure-cli
    

    For versions 2.11.0 and higher, you can also use az upgrade.

  • Uninstall: If you need to remove the CLI:

    brew uninstall azure-cli
    

    To remove all local configuration data, delete the hidden directory: rm -rf ~/.azure.





Related articles




Top