During the lifecycle of an Azure Virtual Machines (VM), you may encounter situations where you need to change the subnet, or maybe the Virtual Network (VNET) where your VM has been created. It is worth mentioning that in Azure Resource Manager (ARM) it is mandatory t...
Set-AzureSubscription -SubscriptionId $SubID -CurrentStorageAccountName $StorageAccountName #Create VM config for existing VHD $vm = New-AzureVMConfig -DiskName $DiskName -InstanceSize $Size -Name $VmName #-AvailabilitySetName $AVsetName #Setup networking VNet and static IP, if ...
To change the size of a virtual machine by using a PowerShell script Create a PowerShell script with the following commands. Function HowTo-SetAzureVMSize{ [CmdletBinding()] param( [parameter(Mandatory=$true)] [string]$ServiceName, [parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] [st...
is DNS where you cannot have a reliable DNS resolution system as long as your DNS servers do not have static IPs and may change their IPs whenever they get rebooted. This Wiki article shares how you can assign a static IP to an Azure VM to overcome the previous limitation of Azure. ...
Portal Azure PowerShell Azure CLI Go to the Azure portal. Select the affected Virtual Machine. Select Networking and then select the network Interface of the VM. Select IP configurations. Select the IP. If the Private IP assignment isn't Static, change it to Static. Change the IP address ...
Azure managed disks are block-level storage volumes that are presented to Azure Virtual Machines. Block level storage refers to raw volumes of storage that are created and can be treated as an individual hard drive. These block devices can be managed within ...
Get-AzVM-ResourceGroupName TestRG-Name VM01|Select-Object-Property id On the Azure Portal, navigate to the VM, and on the overview page, select the JSON view link on the right-hand side. That will open the JSON output of the resource, but on top of that, you ...
This shouldn’t be rocket science here. It’s very clear that “this is an error” is, in fact, an error. So, with this universal fact determined, let’s run it on an Azure VM. Copy Set-AzVmRunCommand-ResourceGroupName$rg-VMName$vm-Location$loc-RunCommandName"MyRuncommand"-SourceScrip...
To find the name of the storage and the key, just go into the Azure management console and select Manage Access Keys, you’ll get the info you need to setup both accounts.Once setup, you can now have a view like this:Stop your VM and you’re good to copy/paste your VM from one ...
You can use this same cmdlet at VM creation time to configure the subnet, but you can also use to change subnet for an existing VM, PowerShell code is very simple: Get-AzureVM –Name $MyVMname –ServiceName $MyCloudServiceName ` ...