Hello @Pavlićević, Božidar
If you switch the public IP address of your Azure Virtual Machine from dynamic to static, the IP address will be retained and will not change even if you restart the server from the Azure console. When you switch the public IP address to static, Azure reserves the IP address for your use and ensures that it is not assigned to any other resource. This means that the IP address will remain the same until you release it or delete the resource. However, please note that if you delete the resource associated with the static IP address, the IP address will be released and can be assigned to another resource. So, make sure to keep the resource associated with the static IP address if you want to retain the IP address.
I hope this helps! Let me know if you have any other questions.
If I have answered your query, please click "Accept as answer" as a token of appreciation