@Eric ,
No, you can't choose a specific public ip.
If your end goal to assign a public ip address within the OS, it's not recommended and could lead to the lost connectivity:
---------------------------------------------------------
You could also review THIS article with outlined steps on how add IP addresses to a VM OS:
---------------------------------------------------------
Private
Private IPv4 or IPv6 addresses enable a virtual machine to communicate with other resources in a virtual network or other connected networks.
By default, the Azure DHCP servers assign the private IPv4 address for the primary IP configuration of the Azure network interface to the network interface within the virtual machine operating system. Unless necessary, you should never manually set the IP address of a network interface within the virtual machine's operating system.
There are scenarios where it's necessary to manually set the IP address of a network interface within the virtual machine's operating system. For example, you must manually set the primary and secondary IP addresses of a Windows operating system when adding multiple IP addresses to an Azure virtual machine. For a Linux virtual machine, you must only need to manually set the secondary IP addresses. See Add IP addresses to a VM operating system for details. If you ever need to change the address assigned to an IP configuration, it's recommended that you:
- Ensure that the virtual machine is receiving a primary IP address from the Azure DHCP servers. Do not set this address in the operating system if running a Linux VM.
- Delete the IP configuration to be changed.
- Create a new IP configuration with the new address you would like to set.
-
Manually configure the secondary IP addresses within the operating system (and also the primary IP address within Windows) to match what you set within Azure. Do not manually set the primary IP address in the OS network configuration on Linux, or it may not be able to connect to the Internet when the configuration is re-loaded.
- Re-load the network configuration on the guest operating system. This can be done by simply rebooting the system, or by running 'nmcli con down "System eth0 && nmcli con up "System eth0"' in Linux systems running NetworkManager.
- Verify the networking set-up is as desired. Test connectivity for all IP addresses of the system.
By following the previous steps, the private IP address assigned to the network interface within Azure, and within a virtual machine's operating system, remain the same. To keep track of which virtual machines within your subscription that you've manually set IP addresses within an operating system for, consider adding an Azure tag to the virtual machines. You might use "IP address assignment: Static", for example. This way, you can easily find the virtual machines within your subscription that you've manually set the IP address for within the operating system.
In addition to enabling a virtual machine to communicate with other resources within the same, or connected virtual networks, a private IP address also enables a virtual machine to communicate outbound to the Internet. Outbound connections are source network address translated by Azure to an unpredictable public IP address. To learn more about Azure outbound Internet connectivity, read the Azure outbound Internet connectivity article. You cannot communicate inbound to a virtual machine's private IP address from the Internet. If your outbound connections require a predictable public IP address, associate a public IP address resource to a network interface.
---------------------------------------------------------
Sincerely,
Olga Os