I tried to create 2 virtual machines with the same parameters but with 2 different ways:
The Powershell cmdlet:
New-AzVm -ResourceGroupName $rg -Name "Testing1img" -Credential $credential -Image UbuntuLTS
Azure CLI from Powershell:
az vm create `
--name "Testing2img" `
--resource-group $rg `
--admin-username $credential.UserName `
--admin-password $credential.Password `
--image "UbuntuLTS"
Both create an Ubuntu LTS VM on the same resource group (different name). The problem I have is that they create VMs with slightly different settings.
In the first case it creates:

In the second case we have:

Why these (even small) differences? Shouldn't they both create the same exact VMs? Someone asking for an UbuntuLTS would expect the latest available image and not 16.04.
For New-AzVM you can specify the Ubuntu version with... -Image Canonical:UbuntuServer:18.04-LTS:latest
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With