Skip to content

Azure PowerShell: For New-AzGalleryImageDefinition, 'TrustedLaunch' and 'TrustedLaunchSupported' aren't synonyms #4682

Open

Description

I tried to take advantage of Azure/azure-powershell#24869 in Azure PowerShell 12.0.0 by changing

New-AzGalleryImageDefinition `
-Location $Location `
-ResourceGroupName $ResourceGroupName `
-GalleryName $GalleryName `
-Name $ImageDefinitionName `
-OsState 'Generalized' `
-OsType 'Windows' `
-Publisher $ImagePublisher `
-Offer $ImageOffer `
-Sku $ImageSku `
-Feature @(@{ Name = 'SecurityType'; Value = 'TrustedLaunch'; }) `
-HyperVGeneration 'V2' | Out-Null

to omit -Feature @(@{ Name = 'SecurityType'; Value = 'TrustedLaunch'; }) and -HyperVGeneration 'V2'. This caused the following command

$ImageVersion = New-AzGalleryImageVersion `
-Location $Location `
-ResourceGroupName $ResourceGroupName `
-GalleryName $GalleryName `
-GalleryImageDefinitionName $ImageDefinitionName `
-Name $ImageVersionName `
-SourceImageVMId $VM.ID

to fail with

New-AzGalleryImageVersion: C:\GitHub\STL\azure-devops\create-1es-hosted-pool.ps1:279
Line |
 279 |  $ImageVersion = New-AzGalleryImageVersion `
     |                  ~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | The security type 'TrustedLaunchSupported' is not supported for the source id ''. Currently only Vhd Blob, User
     | Image and Gallery Image Version sources are supported for 'TrustedLaunchSupported' images. ErrorCode:
     | InvalidParameter ErrorMessage: The security type 'TrustedLaunchSupported' is not supported for the source id ''.
     | Currently only Vhd Blob, User Image and Gallery Image Version sources are supported for 'TrustedLaunchSupported'
     | images. ErrorTarget: galleryImageVersion.properties.storageProfile.osDiskImage.source.id StatusCode: 400
     | ReasonPhrase: Bad Request OperationID : 352dcb67-3fe5-4a4b-98ba-640efe5ecd0f

It appears that the new default of 'TrustedLaunchSupported' is not a synonym for 'TrustedLaunch'.

We should report this upstream, but we'll need to distill our script into a self-contained repro. I'm a lazy kitty, so I'll do this later. 🐈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    externalThis issue is unrelated to the STLinfrastructureRelated to repository automation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions