Wednesday, March 20, 2019

Using powershell on Azure

This is create VM on Azure cloud, Setup SQL Server and migrate SQL server onprem to cloud.


  1. Go to https://shell.azure.com/powershell   
  2. Create a resource group


PS Azure:\> new-AzResourceGroup -Name SAIK

cmdlet New-AzResourceGroup at command pipeline position 1
Supply values for the following parameters:
(Type !? for Help.)
Location: EastUS


ResourceGroupName : SAIK
Location          : eastus
ProvisioningState : Succeeded
Tags              :

Azure:/ PS Azure:\> New-AzVm -ResourceGroupName "SAIK" -Name "SqlVM" -Location "East US" -VirtualNetworkName "SAIKNet" -SubnetName "SAIKSubnet" -SecurityGroup "SAIKSecurityGroup" -PublicIpAddressName "SAIKPublicIpAddres s" -OpenPorts 80,3389 cmdlet New-AzVM at command pipeline position 1 Supply values for the following parameters: Credential User: nkanne Password for user xxxxx: ******************** ResourceGroupName : SAIK Id : /subscriptions/xxx/resourceGroups/SAIK/providers/Microsoft.Compute/virtualMachines/SqlVM VmId : xxx Type : Microsoft.Compute/virtualMachines Location : eastus Tags : {} HardwareProfile : {VmSize} NetworkProfile : {NetworkInterfaces} OSProfile : {ComputerName, AdminUsername, WindowsConfiguration, Secrets, AllowExtensionOperations} ProvisioningState : Succeeded StorageProfile : {ImageReference, OsDisk, DataDisks} FullyQualifiedDomainName : xxx.East US.cloudapp.azure.com

work in progress.