Can I use an existing NIC?

My company has strict policies around SSH to VMs running in Azure. I’m trying to use the AzureRM provisioner to create images, but I’m getting stuck when the SSH connection is attempted. I have added the VM to an existing subnet and vnet, which gives me the necessary connectivity to get electrons from where I’m running Packer to the VM that is being built, but firewall restrictions are blocking port 22.

Is it possible to attach an existing NIC to the VM, instead of using a new one, so I can essentially reuse the same IP address every time? This would allow my security team to open port 22 to a specific destination.

Yes, it is possible to attach an existing Network Interface Card (NIC) to a virtual machine (VM) in Azure, which would allow chris rock 2023 you to reuse the same IP address for multiple VM instances.

yes, you can use. use data block to get details of NIC and use in your VM main code.

any examples you’re aware of for this? note that I’m talking packer and not terraform. I know how to do it with terraform…

same ask, any example…would not find any doc:-)