Using Custom DHCP on Azure VMs is Unsupported by Microsoft: Running a DHCP service on an Azure VM is not officially supported by Microsoft.
However, you can change the NIC settings "IP Configurations" from "Dynamic" to "Static".
If you're creating Virtual Machines using templates or scripts, you can choose you IP configurations to static and choose the relevant configuration.
If you're creating VMs from the Azure Portal, you can;
- Navigate to your VM: Search for and select "Virtual machine".
- Select VM: Choose the specific VM (e.g., "myVM") from the list.
- Open Networking Settings: On the VM page, under "Settings," select "Networking."
- Access Network Interface: Select the network interface name listed next to "Network interface."
- Modify IP Configurations: Under "Settings" in the Network interface page, select "IP configurations."
- Change Assignment to Static: In "IP configurations," choose the relevant configuration (e.g., "ipconfig1"). Under "Assignment," select "Static" and, if desired, change the private IP address.
- Save Changes: Save the new settings.
Hope this helps!