Configure Prerequisites for a VM with Azure Resource Manager

This is the first part of a two part video on configuring the prerequisite and deploying a virtual machine in Microsoft Azure Resource Manager.  The video gives an introduction to Azure Resource Manager and Resource Groups as well as Virtual Networks and Storage Accounts.  This video is intended for people new to Azure or Azure RM.  The script used in this video can be found below.

Click here for part two.

Copy the code and paste the code below into Microsoft PowerShell ISE.

#List Variables
# Ls variable:*
#Remove Variables
# Remove-Variable * -ErrorAction SilentlyContinue

#Get locations (locations will be different depending on subscription)
Get-AzureLocation | FL DisplayNam,Name,StorageAccountTypes

#Set Variables (storageName needs to be LC and numbers)
$location = "Central US"
$rgName = "Resource Group Name"
$netName = "vNet Name"
$storageType = "Standard_LRS"
$storageName = "Storage Account Name"

#Create the Resource Group
New-AzureRmResourceGroup -Location $location -name $rgName

#Create the Subnet and Network
$svrSubnet = New-AzureRmVirtualNetworkSubnetConfig -Name 'ServerSubnet' -AddressPrefix ''
New-AzureRmVirtualNetwork -name $netName -Location $location -AddressPrefix -Subnet $svrSubnet -ResourceGroupName $rgName

#Create new storage account
New-AzureRmStorageAccount -ResourceGroupName $rgName -Name $storageName -Type $storageType -location $location

This information is as-is with no warranty, expressed or implied.  Test it before you trust it!

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.