Create Azure VM using PowerShell off another Image with Static Public IP

Provisioning Azure VM off existing image with static IP can be done via PowerShell script. In order to kick start this process you need to install Azure PowerShell tool and then login into your Azure Subsciption. 

Here is an outline of what needs to be done in order to provision Azure VM with Static IP.

Step 1: Login via Azure PowerSheel into your Azure Account via "Add-AzureAccount" command line. This command will prompt you to provide your user id and password for Azure Subscription.

Step 2: Run Azure Import command "import-module azure" to being all of the cmlets into Azure PowerShell sessions

Step 3: Select your Azure subscription where you want to provision your VM. You can find out your subscription name by running this command line: get-azuresubscription. After you learn you subscription name, you can run select subscription cmdlet select-azuresubscription "Pay-As-You-Go"

Step 4:  Set up Public Static IP via the following command New-AzureReservedIP –ReservedIPName “myReservedIP” –Label “myReservedIPLabel” –Location “East US”

Step 5: Set you subwscription name and storate account where you want to place your VM via Set-AzureSubscription -SubscriptionName "Pay-As-You-Go" -CurrentStorageAccount "myStorage"

Fiunally, run the following command with all appropriate names set up ahead of time. You also need to make sure that your VNET is set up and subnet is provisioned if you want to add your VM to your own Private Virtual Network.

New-AzureVMConfig -Name "myVM" -InstanceSize "Medium" -ImageName "myVMSourceImage" -Label "myVMLabel" | Add-AzureProvisioningConfig -windows -adminusername “myAdminUserName” -password “myAdminUserPassword” | Set-AzureSubnet "mySubnet" | Add-AzureEndpoint -LocalPort 3389 -Name 'RDP' -Protocol tcp -PublicPort 61030 | Add-AzureEndpoint -LocalPort 80 -Name 'HTTP' -Protocol tcp -PublicPort 80 | Add-AzureEndpoint -LocalPort 443 -Name 'HTTPS' -Protocol tcp -PublicPort 443 | New-AzureVM -ServiceName "myServiceName" -ReservedIPName "myReservedIP" -Location "East US" -VNetName "myVNetName"

Featured pages

Services

Windows Azure has several services available for use when you first sign up with Azure. Some of the…

PowerShell

Azure PowerShell scripts are integral part of Microsoft Azure environment. It is designed to help A…

Errors

Azure Cloud Services are very information when it comes to producing error messages. Some of the co…

Pricing

Windows Azure has difference services and pricing normally calculated via Online Azure Pricing Calc…