A few updates and examples for the AZRM-VMDeploy tool after some feedback from folks. 😊

A few updates and examples for the AZRM-VMDeploy tool after some feedback from folks. 😊

There have been a few updates to the tool which I wanted to make folks aware of.

  • Now supports adding ssh public key to authorized hosts file for Linux deployments
  • Now supports managed storage as well as managed data disks for VM deployment
  • Minimum version requirements for Azure PowerShell are now 3.6
  • Updates to script images include Ubuntu 16, PFSense ver 2331

Updated version available here.

I also wanted to provide some updated examples I have recently gotten questions or feedback on from users (below).

Example 1: Deploy a new Windows 2016 VM leveraging managed storage to a new VNET in a new Resource Group with a Public IP

AZRM-VMDeploy.ps1 -ActionType create -vmMarketImage w2k16 -vmstrtype managed -VMName dns1 -rg BETA -vnetrg BETA -ConfigIPs Single -AddVnet -VNetName vnet

Example 2: Deploy a new CentOS 7.2 VM leveraging un-managed storage to an existing Resource Group with an existing VNET with a private dynamic IP address

AZRM-VMDeploy.ps1 -ActionType create -vmMarketImage centos72 -vmstrtype unmanaged -VMName app1 -rg BETA -vnetrg BETA -ConfigIPs NoPubSingle -VNetName vnet

Example 3: Deploy a new PFSense VM using managed storage to a specific subnet on an existing VNET in an existing Resource Group with a single Public IP

AZRM-VMDeploy.ps1 -ActionType create -vmMarketImage pfsense -vmstrtype managed -VMName vpn1 -rg BETA -vnetrg BETA -ConfigIPs Single -VNetName vnet -Subnet1 1

Example 4: Deploy a new Ubuntu 16 VM leveraging managed storage and a managed data disk in an existing Resource Group on an existing VNET with SSH authorization enabled

AZRM-VMDeploy.ps1 -ActionType create -vmMarketImage ubuntu16 -vmstrtype managed -VMName web1 -rg BETA -vnetrg BETA -ConfigIPs NoPubSingle -VNetName vnet -addssh

A few notes about how the SSH Key functionality is implemented. The Public SSH Key you wish to provide should be placed in a text file on your local drive. Within the script you will need to update the path $sshPublicKey = Get-Content '.\Pspub.txt' to reflect the name of the text file you are using with the Public SSH Key. At runtime this file will be referenced to deploy the key to the new Linux VM.

Thanks John really appreciate your work on this amendment, thanks

Like
Reply

Currently there is a ton of logic to prevent deploying to an existing storage account, most of the recommeded practices I have followed frown upon placing multiple VMs in the same storage account. I do recognize that this has shifted somewhat over the last 6 months in terms of consolidated diagnostic storage accounts and other new paths azure provides. I will be adding an override flag to the script to allow for deploying to existing storage accounts today and will provide an update this evening.

Like
Reply

Update - If I use -StorageName switch onto an existing storage account in same RG group it still randomly creates a new one, thanks.

Like
Reply

This is great work John, is there a way to deploy to an existing Storage account by any chance.

Like
Reply

To view or add a comment, sign in

More articles by John Lewis

Others also viewed

Explore content categories