@Bikram
Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.
I understand that you would like to assign a static IP to your Azure VM.
Please note that, for any Azure VM, changing the IP assigned via OS is not recommended.
This would result in misconfig between the Platform assigned IP and OS configured IP and would break the VM.
You have to use the Portal to configure any IP/DNS changes.
- Navigate to the VM
- Go to the Networking tab and Click on the NIC of the VM
- In the NIC, go to IP Configurations Tab.
- Click on the Ipconfig which you would like to set as Static
- Under "Assignment", select Static and set the appropriate IP from the subnet.
- Refer : Change IP address settings
Kindly let us know if the above helps or you need further assistance on this issue.
Thanks,
Kapil
Please don’t forget to close the thread by clicking "Accept the answer" wherever the information provided helps you, as this can be beneficial to other community members.