Cross-tenant image injection


I’m trying to create a cross-tenant image setup. A source image gallery is used in Tenant A and a destionation is in Tenant B.

The App Registration running this process is able to see and work with both Azure Compute Galleries, across the tenants.

Our build config looks like:

shared_image_gallery {
shared_image_gallery_destination {

All variables for the settings are set (just didnt want to copy/paste them over).

After logging in with the SPN to both tenants, I can easily connect and discover, however packer is seeing it can’t see the destination compute gallery and image definition.

There error is:

Build ‘azure-arm.test-acg’ errored after 428 milliseconds 88 microseconds: the Shared Gallery Image ‘’ to which to publish the managed image version to does not exist in the resource group ‘’ or does not contain managed image ‘’

Is there a hidden tenantid setting I could use? we would greatly benefit from this over copy and pasting images over…

We’re encountering exactly the same issue and it’s been incredibly frustrating. Despite Packer having all the necessary Azure information and permissions, it seems to be completely blind to using it. We’ve spent several days attempting to resolve this and are hoping that Hashicorp can provide a solution.

1 Like