Thursday, November 20, 2014

Creating a new Vm and cloud service with static public Ip address in Azure

Cursor won't show in azure power shell : Set your own cursor size using the following command
[Console]::CursorSize = 25
How to reserve a new ip: just goto azure power shell and run the following command
 
PS C:\> New-AzureReservedIP -ReservedIPName "Any name" -Label "Any label" 
-Location "A valid location"
 
Creating a new VM plus cloud service with static public ip assigned: First of 
all set the current storage account for your subscription
 
PS C:\> Set-AzureSubscription -SubscriptionName "Subscription Name" 
-CurrentStorageAccountName "StorageAccountName"
 
Get the images in a variable so you can use them later
 
PS C:\> $images = Get-AzureVMImage
 
then create a new cloud service and the vm under that cloud service using this 
command 
 

PS C:\> New-AzureVMConfig -Name "VM Name" -InstanceSize Small 
-ImageName $images[60].ImageName | Add-AzureProvisioningC
onfig -Windows -AdminUsername admin -Password abc123 | New-AzureVM 
-ServiceName "myservice" -ReservedIPName "Reserved Ip name"
 -Location "Southeast Asia"
 
btw if you want to remove an existing public ip just enter the following command 
in 
azure powershell 

PS C:\> Remove-AzureReservedIP -ReservedIPName "Name of Reserved IP"
 
To view a specific reserved ip the following command can be used 
 
PS C:\> Get-AzureReservedIP -ReservedIPName "FirewallIP"
 
PS C:\> Get-AzureReservedIP    will show all ips

No comments:

Post a Comment