Azure Cli Alternative with Powershell on macOS

by | Feb 15, 2021 | Powershell

Last year I didn’t post much on my blog. So here again a post that is the first for this year. Let’s see if I can find the time to do more this year.

Recently I am kept busy with Microsoft Azure and often switch between Mac OS and Windows. PowerShell is working great on Windows machines but I found it helpfull to be able to edit and run the scripts also on Mac OS. Keep in mind that not all modules and commands are available on Mac OS, this is being improved over time.

To install PowerShell on Mac OS you can open an Terminal en run the command if you have Brew (https://brew.sh/) installed:

brew install powershell

After you have installed PowerShell you can start to switch to PowerShell in the Terminal with command:

pwsh

Most popular powershell commands are available, you can list them with ‘Get-Command’.

PowerShell module Az

Next step is to install the Azure PowerShell module, this will be the ‘core’ version that is compatible with PowerShell on Mac OS. Again, this will may not include all command. Run the following inside PowerShell:

Install-Module Az

This command will ask you to install from an untrusted repository, type Y (and enter) to continue. If you receive an error message that Administrator rights are needed, then exit the current PowerShell session and run PowerShell with ‘sudo pwsh’.

Once the module is installed you have to import it before you can run the commands:

Install-Module Az

Now the commands for managing Microsoft Azure are available and you can login with:

Login-AzAccount

When you run the ‘Get-Command’ now you will see many more commands are added for Microsoft Azure.

AzureRm commands

Some of you might be used to the Windows PowerShell command from the AzureRM module. Or maybe you have scripts already that are using some AzureRM command, for example ‘Get-AzureRmVm’ or ‘Get-AzureRmSubscriptions’. To make use of those commands you will need to run the following:

Enable-AzureRmAlias

Now you can run all the AzureRm command like in Windows Powershell.

Have fun with PowerShell on the MAC.

eighty data blog

Terug naar kantoor

Terug naar kantoor

Nu het thuiswerk advies langzaam komt te vervallen trekken steeds meer mensen weer naar kantoor. Gaan we weer terug naar het oude "9 tot 5" of omarmen we het hybride werken? Met een modern ingerichte IT omgeving op basis van Microsoft 365 heb je de flexibiliteit om op...

Windows Server herstart loop

Windows Server herstart loop

Na het installeren van de recent uitgebrachte januari 2022 beveiliging updates voor Windows Server 2012R2 raakte de server in een herstart loop. Het probleem houdt verband met een Active Directory component en komt daardoor voor op domain controllers. Hoewel het in ons geval om een Windows Server 2012R2 versie gaat, blijkt uit diverse andere blogs dat het probleem ook op andere Windows Server versies voor kan komen. Wees dus voorzichtig met het installeren van deze updates. Heb je de updates al geïnstalleerd en is je server in een reboot-loop terecht gekomen? Lees dan onze stappen om de server weer operationeel te maken.

Azure Static Webapps

Azure Static Webapps We are using Azure Static Webapps to host several apps & tooling developed for our customers. However how do you setup the hosting / deployment. In the upcoming series of blogs we will share some tips and tricks to setup that multi environment...

New office and branding!

New office and branding!

New office! This month we moved in to a brand new office located on Zomerdijk 2a in Maassluis. Having our own office is a major milestone which comes with many benefits. It allows us to work together even more closely on our projects, receive customers and hosts a...

Build ASP.NET Core webapp with Docker

Build ASP.NET Core webapp with Docker

It’s a time ago I wrote something on my blog, so it is time again. In this post I want to explain how I build Microsoft NET core applications in an docker container and run them also as an docker. Since some time also Microsoft SQL server is available in an Linux...