Skip to content

Commit

Permalink
Use the parent's Subscription, it can be different from the build's s…
Browse files Browse the repository at this point in the history
…ubscription (#322)
  • Loading branch information
JenGoldstrich authored Jul 19, 2023
1 parent 8d6c98a commit 52a4f88
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion builder/azure/arm/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ func (b *Builder) Run(ctx context.Context, ui packersdk.Ui, hook packersdk.Hook)
}
sourceImageSpecialized := false
if b.config.SharedGallery.GalleryName != "" {
galleryImage, err := azureClient.GalleryImagesClient.Get(ctx, b.config.SharedGallery.ResourceGroup, b.config.SharedGallery.GalleryName, b.config.SharedGallery.ImageName)
client := azureClient.GalleryImagesClient
client.SubscriptionID = b.config.SharedGallery.Subscription
galleryImage, err := client.Get(ctx, b.config.SharedGallery.ResourceGroup, b.config.SharedGallery.GalleryName, b.config.SharedGallery.ImageName)
if err != nil {
return nil, fmt.Errorf("the parent Shared Gallery Image '%s' from which to source the managed image version to does not exist in the resource group '%s' or does not contain managed image '%s'", b.config.SharedGallery.GalleryName, b.config.SharedGallery.ResourceGroup, b.config.SharedGallery.ImageName)
}
Expand Down

0 comments on commit 52a4f88

Please sign in to comment.