Hi Varma, You have two options here. Either you exempt your packer resource group from the deny public IP policy or use an existing vNet and execute the packer build from a VM in this vNet.
If you want to exempt the resource group you can read the post by Emily here: https://www.seb8iaan.com/create-an-exemption-rule-to-exclude-a-resource-from-a-security-recommendation/
The packer JSON can use these lines to use an existing vNet.
"virtual_network_name": "packerpoc",
"virtual_network_resource_group_name" : "packerpoc",
"virtual_network_subnet_name" : "packerpoc",