We just created a NIC, but without the public IP, we can't reach that network interface and the virtual machine associated with it from the public internet. In this recipe, we will create a public IP address and associate it with the network interface.
Azure allocates the public IP address using one of two methods, static or dynamic. An IP address allocated with the static method will not change, irrespective of the power cycle of the virtual machine; whereas, an IP address allocated with the dynamic method is subject to change. In this recipe, we will create a public IP address allocated with the Static method.