Azure custom image builder - Waiting for SSH to become available


We are trying to build a custom Azure image from shared image gallery and save it in different gallery under diff subscription. As part of the image we are trying to install softwares from internet.
The packer is installed on my local machine. Due to customer restrictions we are NOT attaching any public IPs to the temp VM of the image.

During the process it gets stuck at SSH to become available and times out eventually. Does packer requires public IPs to be attached inorder to do SSH to the machine? what other options do I have to connect privately?

Please help.