question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

az sig image-version create --tags break in version 2.38.0-1

See original GitHub issue

Install latest version Azure CLI on ubuntu 1804 run az sig image-version create .... --tags test=true encounter this error Parameter 'tags' must be of type 'dict[str, str]', downgrade version into 2.37.0-1, it works well.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:3
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
zhoxing-mscommented, Aug 1, 2022

I have submitted a PR #23393 to fix this issue, and it will be released in this sprint 09-06

2reactions
SuperJC710ecommented, Jul 15, 2022

We’ve been experiencing the same issue in our pipeline build.

As a work-around, we broke the tagging portion out into a separate az tag create operation. We were able to derive the required --resource-id flag using the same variables/parameters we were feeding to the original az sig image-version create command. This is working.

  - task: AzureCLI@2
    displayName: Publish the Managed Image to the Shared Image Gallery
    enabled: true
    inputs:
      azureSubscription: ${{ parameters.azureSubscription }}
      scriptType: bash
      scriptLocation: inlineScript
      inlineScript: |
        az sig image-version create \
         --gallery-image-definition ${{ parameters.sigGalleryImageDefinition }} \
         --gallery-image-version ${{ parameters.sigGalleryImageVersion }} \
         --gallery-name ${{ parameters.sigGalleryName }} \
         --resource-group ${{ parameters.sigResourceGroup }} \
         --managed-image "/subscriptions/${{ parameters.srcImageSubscriptionId }}/resourceGroups/${{ parameters.srcImageResourceGroupName }}/providers/Microsoft.Compute/images/${{ parameters.srcImageName }}" \
         --subscription ${{ parameters.sigSubscriptionId }} \
         --target-regions ${{ parameters.sigTargetRegions }}; \
        az tag create \
         --resource-id "/subscriptions/${{ parameters.sigSubscriptionId }}/resourceGroups/${{ parameters.sigResourceGroup }}/providers/Microsoft.Compute/galleries/${{ parameters.sigGalleryName }}/images/${{ parameters.sigGalleryImageDefinition }}/versions/${{ parameters.sigGalleryImageVersion }}" \
         --tags \
         "Department"="${{ parameters.stdTagDepartment }}" \
         "Owner"="${{ parameters.stdTagOwner }}" \
         "Environment"="${{ parameters.stdTagEnvironment }}" \
         "Subscription"="${{ parameters.stdTagSubscription }}" \
         "Project"="${{ parameters.stdTagProject }}" \
         "Application"="${{ parameters.stdTagApplication }}"

Also, it looks like there could be another approach using the --set flag, as outlined here: https://github.com/Azure/azure-cli/issues/23191#issuecomment-1185400727

Read more comments on GitHub >

github_iconTop Results From Across the Web

az sig image-version | Microsoft Learn
Create a new image version. This operation might take a long time depending on the replicate region number. Use "--no-wait" is advised. Azure...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found