deploy Azure VM without boot diagnostics feature using Azure Powershell
I use azure Powershell to deploy VMs. But I can not deploy VMs without boot diagnostics feature.
Please tell me how to disable the boot diagnostics feature when I deploy a VM (or VMs) with azure powershell.
If no idea to do that,Can you add a option to disable the boot diagnostics feature ?
Sham SV is on the right way. That works for me. Next code is part of the one I used:
$VirtualMachine = New-AzureRMVMConfig -VMName $VMName -VMSize $VMSize -AvailabilitySetId $AsId
$VirtualMachine = Set-AzureRmVMOperatingSystem -VM $VirtualMachine -Linux -ComputerName $VMName -Credential $cred #-DisablePasswordAuthentication
$VirtualMachine = Set-AzureRmVMSourceImage -VM $VirtualMachine -PublisherName $pubName -Offer $offerName -Skus $SKU -Version "latest"
$VirtualMachine = Add-AzureRMVMNetworkInterface -VM $VirtualMachine -Id $Interface.Id
$VirtualMachine = Set-AzureRmVMOSDisk -VM $VirtualMachine -Name $OSDiskName -CreateOption fromImage
$VirtualMachine = Set-AzureRmVMBootDiagnostics -VM $VirtualMachine -Disable
write-host "Creating New VM, please wait..." -ForegroundColor Yellow;
New-AzureRmVM -ResourceGroupName $ResourceGroupName -Location $ResourceGroupLocation -VM $VirtualMachine
Thank for your help!
Sham SV commented
You can use the following line in the PS Script:
$newVM = Set-AzureRmVMBootDiagnostics -VM $newVM -Disable
This would disable BootDiagnostics during deployment.
I'm also looking for the same solution. MS please respond to this..