Packer doesn`t read shared image gallery

Hi All ,

packer does`nt read shared image gallery when i do packer build mypacker.hcl
its giving error like

Error: cannot create vm: Code=“VMMarketplaceInvalidInput” Message=“Creating a virtual machine from Marketplace image or a custom image sourced from a Marketplace image requires Plan information in the request. VM: ‘/subscriptions/cee76754-ef49-49f7-b371-f6841fa82182/resourceGroups/iterative-haNQPkbDM/providers/Microsoft.Compute/virtualMachines/iterative-haNQPkbDM’.”

but am using a sharead image gallery why its mistakenly assuming it as marketplace image