Packer Azure-ARM builder working in multiple subscriptions

Hi all,
more of a question if I’m missing out on something.
Using the Azure arm builder, the latest packer version (1.7.3)

Our setup is - SUB-1 (where the shared image gallery is and the image definition) and SUB-2 (standard subscription for VM deployments, contains the network setup with VPN peered VNet to our on-prem, DBs, LBs…)

What I’m trying to do - build the VM in SUB-2 (inside the already configured VNet - needed since our Chef server is on-prem and used to configure the image)
and save the image to an image gallery in SUB-1

What works - shared_image_gallery_destination {} configured properly and image version is saved to this subscription and resource group

image is built on a VM inside the subscription and resource group defined with subscription_id and build_resource_group_name parameters

What does not work - managed_image_resource_group_name is ignored due to only one subscription_id parameter (already used for where the image is built) so the resulting image is saved to the RG where VM was built, not in the RG alongside the shared image gallery…

What am I missing and can this be configured somehow?
If not, that would require us to create a separate VNet in SUB-1 and peer it to the one in SUB-2 which seems just like a waste of resources and complicates the network side.


Any updates on this? I am also facing the same issue

I’ve created a separate VNet in SUB-1 and peered it since looks like there is no workaround so far…