microsoft / microsoft/STL

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

Open
#4,682 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

external infrastructure
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

I tried to take advantage of https://github.com/Azure/azure-powershell/pull/24869 in Azure PowerShell 12.0.0 by changing

https://github.com/microsoft/STL/blob/63354c3fa9c1fb2ab1fccb58c47d23c6af1c290f/azure-devops/create-1es-hosted-pool.ps1#L294-L305

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

https://github.com/microsoft/STL/blob/63354c3fa9c1fb2ab1fccb58c47d23c6af1c290f/azure-devops/create-1es-hosted-pool.ps1#L311-L317

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. 🐈

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with azure-devops/create-1es-hosted-pool.ps1 around the referenced lines 294-317 and reproduce the failure using New-AzGalleryImageDefinition and New-AzGalleryImageVersion. Distill the existing script into a self-contained reproduction that demonstrates the difference between TrustedLaunch and TrustedLaunchSupported, then report it upstream.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, powershell
Domain
cloud, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.