Hi @Ole Henrik Oftedal ,
Thank you for reaching out to Microsoft QnA.
I see @Ronen Ariely has already answered your query, and yes unfortunately it is not possible to get back the previous ip. I would like to add in to @Ronen Ariely 's answer.
If you want to change your Public IP address assignment from dynamic to static, first note down the public ip name and then disassociate the public IP from the IP configurations of the network interface (NIC).
After disassociating, search for the public ip name under the Public IP address service. Select the public IP that you just disassociated from the NIC, and now you will no longer see the IP address assignment as greyed out, you can then change it to Static.
In short, you cannot change the IP address assignment method (Static or Dynamic) for a Public IP while the IP is still associated or attached to a NIC. It needs to be first disassociated, only then can the assignment type change, post which you will have to re-associate the IP to the NIC via IP configurations.
I hope this answers your question.
Please refer to the snippets below.
Please 'Accept as answer' if the provided information is helpful to help others in the community.
No problem :-)
In this case, these steps might solve your issue
(1) Click on the Public IP address
(2) Move to the "overview"
(3) Copy to notepad the value of the "Associated to" so you will remember it for next steps
(4) Click the Dissociate at the top and then Yes to confirm - you will lost current the IP address but should fix it for next IP
(5) Under Configuration while the IP is not Associate, change the "IP address assignment" to static and add a DNS name label and then Save
Back to "Overview" and click on "Associate" -> fine the Network Interface with the name you copied to notepad in step 3