I have a public Ip address in Azure that is associated with a load balancer. I am trying to use the Java client to dissociate the LB from the IP.
I have attempted quite a few things but the last attempt was the following:
LoadBalancer lb = myPublicIpAddress.getAssignedLoadBalancerFrontend().parent();
LoadBalancerFrontend frontEnd = myPublicIpAddress.getAssignedLoadBalancerFrontend();
lb.update().updatePublicFrontend(frontEnd.name()).withoutPublicIPAddress().parent().apply()
From this I get the error:
CloudException: Frontend IP Configuration must reference either a Subnet, Public IP Address or Public IP Prefix
myPublicIpAddress is a PublicIpAddress object retrieved directlty from azure. The exception confuses me because the frontend is attatched to a public IP
edit: Also of note, This post here uses Azure commands and goes through the NIC. I've tried to replicate this with the java client but the NIC in my project isn't setup the same and this doesn't work.
To replicate: Create a public IP in Azure. Create a LB in Azure and associate it to the IP. Attempt to dissociate via the method above.