Search code examples
azureazure-virtual-networkazure-vm-scale-setazure-load-balancerazure-public-ip

Regarding Deleting public IP without effecting VM


In my current azure platform I have created vm scale set using az cli command. Then by default it created a load balancer and public ip and got associated with it. Now I want to delete this public ip, because I don't have any need with this. I am trying to delete this , but getting error that this IP is associated with vm, I am trying to disassociate it, but not able to find that option. I have checked to delete from LB frontend IP configuration or backend pool, but couldn't do so. I need to get rid this without effecting my VM which is running. Could someone help me.

Let me know if more details are needed

I am expecting for an answer to delete the public IP without deleting the existing VM.

I tried below

enter image description here

enter image description here


Solution

  • Created virtual machine scale set and load balancer associated with public Ip:

    enter image description here

    Load balancer frontend Ip:

    enter image description here

    When I tried to delete the public IP of vmss, I got same error.

    enter image description here

    Note that, you cannot delete the public IP of vmss without deleting it from the load balancer. For that, you need to create new public IP in load balancer and then delete the previous IP that is associated with vmss.

    In my case, created one new public Ip inside load balancer you must have Ip for load balancer even its not necessary for vmss :

    enter image description here

    Now, I can delete the public Ip of vmss:

    enter image description here

    Once refresh the vmss public Ip is deleted successfully:

    enter image description here