Wednesday, June 10, 2020

Powershell - Azure - Create VM using templates

During my recent studies on the cloud realm, I've been experimenting with Azure PowerShell module that allows you to manage your Azure subscription remotely via an encrypted remote session. It's pretty handy when you want to automate tasks and don't want to have to go to Azure portal and click through a dozen of screens to get it done.

I've put up the following PowerShell script as my first prototype for Azure Powershell automation that would create a VM on Azure using a JSON Template.

It will validate if there's an active Azure Subscription connection for the current profile, perform it if not. Also validate if a valid URI was provided for the template.


There's a some room for improvement on logging and additional features, but I just wanted to make it quick and simple to exemplify it's usage.

Feel free to take a look and to comment it if you like!

Cheers!

Github source:
https://github.com/diogocatossi/Powershell/blob/master/AzurePowershell-CreateSimpleVMUsingTemplate.ps1



Powershell - Azure - Create VM using templates

During my recent studies on the cloud realm, I've been experimenting with Azure PowerShell module that allows you to manage your Azure s...