Hi,
Yesterday morning I created a new VM within Azure using a PowerShell script that I've been using for a while now. This morning I've tweaked the script in order to provision another new VM and it no longer works. The script should build a B2S VM using premium storage along with an additional data disk (also premium). I build the VM object up using a number of cmdlets (see below) and pull this into New-AzureRmVM to create the VM, all standard stuff.
Here is the VM object I am creating:
$vmConfig = New-AzureRmVMConfig -VMName $vmName -VMSize $vmsize | Set-AzureRmVMOperatingSystem -Windows -ComputerName $vmName -Credential $cred -ProvisionVMAgent -EnableAutoUpdate | Set-AzureRmVMSourceImage -PublisherName $publisher -Offer $offer -Skus $sku -Version $version | Set-AzureRmVMOSDisk -Name $osdiskname -DiskSizeInGB $osdiskSize -StorageAccountType $diskaccountType -CreateOption fromImage -Windows | Add-AzureRmVMDataDisk -Name $datadisk1.Name -CreateOption Attach -ManagedDiskId $datadisk1.id -Lun 0 | Add-AzureRmVMNetworkInterface -Id $nic.Id -Primary | Set-AzureRmVMBootDiagnostics -Enable -ResourceGroupName $resourcegroupname -StorageAccountName $storagediag.StorageAccountName New-AzureRmVM -ResourceGroupName $resourceGroupName -Location $location -VM $vmConfig
I use the Set-AzureRMVMOSDisk cmdlet to enable me to label the OS disk and also set it to premium storage. However it seems that this cmdlet is no longer working and I'm getting the following error:
Has something changed in the Azure PowerShell recently that would have broken this?
Any help or thoughts gratefully received.
Rob