我完全遵循Microsoft文档中的内容,但是没有运气
我正在尝试将优先级规则从120
更新为4040
set-azurermnetworksecurityruleconfig
我遵循的代码:
$nsg = Get-AzureRmNetworkSecurityGroup -Name EA-NSG-AAA -ResourceGroupName EA-RG
$nsg | Get-AzureRmNetworkSecurityRuleConfig -Name name-02
Set-AzureRmNetworkSecurityRuleConfig -Name name-02 -NetworkSecurityGroup $nsg -Priority 4040
答案 0 :(得分:0)
您不会在Azure中更新网络安全组,只会修改您的本地Powershell对象。您需要将更改推向蔚蓝。示例代码:
$nsg = Get-AzureRmNetworkSecurityGroup -ResourceGroupName %rg_name% -Name %nsg_name%
Set-AzureRmNetworkSecurityRuleConfig -NetworkSecurityGroup $nsg `
-Name %rule-name% `
-Access Allow `
-Protocol Tcp `
-Direction Inbound `
-Priority 777 `
-SourceAddressPrefix %data% `
-SourcePortRange * `
-DestinationAddressPrefix * `
-DestinationPortRange 3389
$null = Set-AzureRmNetworkSecurityGroup -NetworkSecurityGroup $nsg