BGINFO

$srv = Read-Host “Enter service name: “
$vm = Read-Host “Enter VM name: “

$VM1 = Get-AzureVM -ServiceName $srv -Name $vm
Set-AzureVMBGInfoExtension -VM $VM1 | Update-AzureVM

Set-AzureVMaccessExtension -VM “servicename” –UserName “vmname” –Password “password” `
–ReferenceName “refname” | Update-AzureVM