Anton Kuryan
Anton Kuryan

Reputation: 607

How to remove Inbound rule from Azure loadbalancer

I have an Azure loadbalancer v2 created and wish to remove a rule from it. So, I will get a load balancer object:

$loadBalancer = Get-AzureLoadBalancer -Name myLoadbalancer -ResourceGroupName myResourceGroup

Then, I will try to remove a rule:

Remove-AzureLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -Name RuleName

But, the rule stays there... Maybe I am missing something obvious? There is no examples which i can base on :(

Upvotes: 0

Views: 992

Answers (2)

Yves Pitsch
Yves Pitsch

Reputation: 131

Cmdlets with “Config” suffix only change in-memory data ($loadBalancer object in this case).

After Remove-AzureLoadBalancerInboundNatRuleConfig -LoadBalancer $loadBalancer -Name RuleName

Do Set-AzureLoadBalancer -LoadBalancer $loadBalancer

Let me know

Upvotes: 2

Anton Kuryan
Anton Kuryan

Reputation: 607

As far as I understood - it is not working like this. I was able to reach this goal by using same resource manager template, which is used to provision this resource and modifying it to remove/update required rules

Upvotes: 0

Related Questions