packer: the Shared Gallery Image to which to publish the managed image version to does not exist in the resource group

Zebee Johnstone 10 Reputation points
2023-05-10T02:22:03.07+00:00

I have created a resource group which is owned by the packer service principal

in there is an image gallery also owned by the packer service principal.

In there is an image definition and yes, also owned by the packer service principal. These were all created by terraform.

In the portal we have:

soe-rhel8-raw (gitnonprdinfra_images/soe-rhel8-raw) VM image definition Australia East

in the packer template the vm is created in a different resource group and published to the shared image gallery in the rg I created

variables:

"image_name": "soe-rhel8-raw",

"resource_group": "tg-packer-test-rg",

build:

  "builders": [{
            "type": "azure-arm",
            "client_id": "{{user `client_id`}}",
            "client_secret": "{{user `client_secret`}}",
            "subscription_id": "{{user `subscription_id`}}",
            "os_type": "Linux",
            "image_publisher": "redhat",
            "image_offer": "rhel-raw",
            "image_sku": "86-gen2",
            "image_version": "latest",
            "managed_image_name": "{{user `image_name`}}",
            "managed_image_resource_group_name": "{{user `resource_group`}}",
            "shared_image_gallery_destination":
            {
                "subscription": "{{user `subscription_id`}}",
                "resource_group": "rg-git-ti-dev-images-ae",
                "gallery_name": "gitnonprdinfra_images",
                "image_name": "soe-rhel-8-raw",
                "image_version": "2.0",
                "replication_regions": "{{user `location`}}",
                "storage_account_type": "Standard_LRS"
            }

there's more in the build such as provisioners but it doesn't get that far

it says

the Shared Gallery Image to which to publish the managed image version to does not exist in the resource group rg-git-ti-dev-images-ae

but I can see that image in the gallery. so what is going on?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,392 questions
{count} votes

1 answer

Sort by: Most helpful
  1. deherman-MSFT 34,686 Reputation points Microsoft Employee
    2023-05-15T17:46:30.3066667+00:00

    @Zebee Johnstone

    To troubleshoot this, we're going to enable a free, one time technical support ticket. Please email the following to AzCommunity@microsoft.com and we'll get back to you promptly:

    • Subject: "Attn: deherman - "

    • Email body: Your Subscription ID

    • Email body: A link to this thread so we can validate and expedite the request

    If you don't receive a response within 24 hours, please reply to the thread so we can investigate.

    0 comments No comments