You can use this JSON to deploy and image from Azure Compute Gallery and also capture it to Azure Compute Gallery.
{
"builders": [
{
"type": "azure-arm",
"client_id": "",
"client_secret": "",
"tenant_id": "",
"subscription_id": "",
"shared_image_gallery": {
"subscription": "",
"resource_group": "rg-avd-images",
"gallery_name": "gal_avd",
"image_name": "avd_w11",
"image_version": "1.0.0"
},
"shared_image_gallery_destination": {
"subscription": "",
"resource_group": "rg-avd-images",
"gallery_name": "gal_avd",
"image_name": "avd_w11_new",
"image_version": "1.0.0",
"replication_regions": ["WestEurope"],
"storage_account_type": "Standard_LRS"
},
"build_resource_group_name": "myPackerGroup",
"os_type": "Windows",
"vm_size": "Standard_D4s_v5",
"winrm_insecure": true,
"winrm_timeout": "5m",
"winrm_use_ssl": true,
"winrm_username": "packer"
}
]
}