An extension of Azure for running apps in an on-premises environment and delivering Azure services in a datacenter.
Welcome to Microsoft Q&A Platform, thanks for posting your query here.
After packer is completed, download the image to local and upload it to an storage account. Then in the Admin portal, you can add the image into Azure Stack Hub by Add and remove a custom VM image to Azure Stack Hub.
Images generated with Packer are supported, as long as they meet the requirements described within this article.
Ref:
https://learn.microsoft.com/en-us/azure/virtual-machines/windows/build-image-with-packer
https://learn.microsoft.com/en-us/azure/virtual-machines/linux/build-image-with-packer
Hope this helps.
If you need further help on this, tag me in a comment.
If the suggested response helped you resolve your issue, please 'Accept as answer', so that it can help others in the community looking for help on similar topics.