Powershell vs Azure CLI when creating an Episerver environment.

It doesn’t really matter if you use Powershell or Azure CLI to setup your Azure resources. It’s more a matter of taste. Up til now I’ve been using Powershell modules, but I wanted to learn more about Azure CLI. So, I decided to convert this script that sets up an Episerver environment to use Azure CLI instead of Powershell modules. 

Prerequisites

You just need to install Azure CLI, and then open Powershell.

Alternatively you can just run the script at https://shell.azure.com/.

The script

The Azure CLI script is less verbose than using Powershell modules, and it’s (kind of) idempotent out of the box. I don’t need to check if the resource already exists before creating it.

I also like the consistency of the commands, and by using the -h (or –help) switch I could create the script above without looking at the online documentation.

I think Azure CLI just won me over 😊

Leave a Reply