New-AzVmss: Can't find the image 'Win2019DataCenterGenSecond'

James Hao 5 Reputation points
2023-10-29T04:33:21.6633333+00:00

I'm testing out creating vmss with image which supports TrustedLaunch, in this case, the 2019-datacenter-gensecond. 

New-AzVmss -Credential $vmCred -ResourceGroupName $rgName -Name $vmssName -ImageName 'Win2019DataCenterGenSecond' -SecurityType TrustedLaunch 

 

New-AzVmss: Can't find the image 'Win2019DataCenterGenSecond'.

 

I tried with -ImageName '2019-datacenter-gensecond', it also says can't find the image. 

 

Is this because 'Win2019DataCenterGenSecond' is not the right image name or the subscription doesn't have the access to this image? 

 

How do I get all the UrnAlias names, especially for 2019-datacenter-gensecond? I can only see the UrnAlias for all the offline images through 'az vm image list --publisher MicrosoftWindowsServer --offer WindowsServer -o table' but the outputs doesn't have the entry for 2019-datacenter-gensecond. If I add --all to this command to list all the images including 2019-datacenter-gensecond, the outputs doesn't have the column of 'UrnAlias'. 

Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
315 questions
{count} votes

1 answer

Sort by: Most helpful
  1. kobulloc-MSFT 19,376 Reputation points Microsoft Employee
    2023-10-29T05:15:52.3433333+00:00

    Hello, @James Hao !

    How do I find a VM alias I can use with the command, New-AzVmss?

    Edit: The solution here is to use the full URN (as 2019-datacenter-gensecond won't work by itself):

    MicrosoftWindowsServer:WindowsServer:2019-datacenter-gensecond:latest

    Changing image alias is a breaking change which is scheduled with the November 2023 release of PS/CLI. Please refer to https://aka.ms/TLaD for more information.

    Old:

    The only available aliases for New-AzVmss are:

    • Win2022AzureEditionCore
    • Win2019Datacenter
    • Win2016Datacenter
    • Win2012R2Datacenter
    • Win2012Datacenter
    • UbuntuLTS
    • Ubuntu2204
    • CentOS
    • CentOS85Gen2
    • Debian
    • Debian11
    • OpenSuseLeap154Gen2
    • RHEL, RHELRaw8LVMGen2
    • SuseSles15SP3
    • FlatcarLinuxFreeGen2

    Given that list, you are probably looking for Win2019Datacenter.

    As a quick aside, az vm image list --all is a great way to find VM SKUs and URNs. A great tool is https://az-vm-image.info/ which makes navigating this information a bit easier:

    User's image


    I hope this has been helpful! Your feedback is important so please take a moment to accept answers.

    If you still have questions, please let us know what is needed in the comments so the question can be answered. Thank you for helping to improve Microsoft Q&A!

    User's image