How to update NSG rule

Blake 1 Reputation point
2021-07-21T03:01:47.24+00:00

The command interface using the method provided on the website does not work

$nsg = Get-AzNetworkSecurityGroup -Name "NSG-FrontEnd" -ResourceGroupName "TestRG"
$nsg | Get-AzNetworkSecurityRuleConfig -Name "rdp-rule"
Set-AzNetworkSecurityRuleConfig -Name "rdp-rule" -NetworkSecurityGroup $nsg -Access "Deny"

Want to know why

Azure Virtual Network
Azure Virtual Network
An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
2,425 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. suvasara-MSFT 10,041 Reputation points
    2021-07-22T08:40:50.583+00:00

    @Blake , I have tested this and reported the PS bug to the respective PS content owners. They will be working on the resolution part as soon as possible. Also, i have tested this on CLI where it got deployed successfully. In case your deployment is code independent then you can use this CLI block for time saving.

    az network nsg rule update -g Networking-AppGateway-Lab --nsg-name AG-VM-nsg -n RDP --access Deny  
    

    Here is the GitHub Issue for tracking https://github.com/Azure/azure-powershell/issues/15517

    ----------

    Please do not forget to "Accept the answer" wherever the information provided helps you to help others in the community.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.