How to Connect to Azure AD Account using PowerShell on Mac


This article assumes you have already installed PowerShell on your Mac.

How to install PowerShell on Mac?

If you want to connect to Azure AD using PowerShell on Mac then follow the below steps.

  • Step 1: Open the Terminal App and switch to PowerShell using pwsh command.
  • Step 2: We install the Install Azure PowerShell Module using the below command,
    Install-Module -Name Az

    Type Y when prompted.

    Untrusted repository
    You are installing the modules from an untrusted repository. If you trust this repository, change its InstallationPolicy value 
    by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from 'PSGallery'?
    [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "N"): Y
  • Step 3: Once complete, to connect to Azure AD Account, run the below command,
    Connect-AzAccount
  • Step 4: You will be taken to your browser and asked to sign into the Microsoft Azure Account.
    Microsoft Azure Sign-in Page
  • Step 5: That's it you are now connected to the Azure AD Account.

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright ยฉ Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap