azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Not at all clear documentation.

Open HarshitaSingh-MSFT opened this issue 4 years ago • 5 comments

Description of the new feature

Transferring this issue#1877 from azure-docs-powershell to azure-powershell repo.

FYI @dcaro and @Raag007

Proposed implementation details (optional)


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 2b963d11-ab7f-b257-2ec2-89e1327f1b0a
  • Version Independent ID: dc1846a2-4d0a-fd2b-ecd1-1670435e86b6
  • Content: Set-AzNetworkSecurityRuleConfig (Az.Network)
  • Content Source: src/Network/Network/help/Set-AzNetworkSecurityRuleConfig.md
  • Service: virtual-network
  • GitHub Login: @dcaro
  • Microsoft Alias: dcaro

Description: https://github.com/MicrosoftDocs/azure-docs-powershell/issues/1877#issuecomment-913783460 On your sandbox, when you get a chance please try to run these commands provided in this document.

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

HarshitaSingh-MSFT avatar Sep 07 '21 03:09 HarshitaSingh-MSFT

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @aznetsuppgithub.

Issue Details

Description of the new feature

Transferring this issue#1877 from azure-docs-powershell to azure-powershell repo.

FYI @dcaro and @Raag007

Proposed implementation details (optional)


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

  • ID: 2b963d11-ab7f-b257-2ec2-89e1327f1b0a
  • Version Independent ID: dc1846a2-4d0a-fd2b-ecd1-1670435e86b6
  • Content: Set-AzNetworkSecurityRuleConfig (Az.Network)
  • Content Source: src/Network/Network/help/Set-AzNetworkSecurityRuleConfig.md
  • Service: virtual-network
  • GitHub Login: @dcaro
  • Microsoft Alias: dcaro

Description: https://github.com/MicrosoftDocs/azure-docs-powershell/issues/1877#issuecomment-913783460 On your sandbox, when you get a chance please try to run these commands provided in this document.

$nsg = Get-AzNetworkSecurityGroup -Name "NSG-FrontEnd" -ResourceGroupName "TestRG"
$nsg | Get-AzNetworkSecurityRuleConfig -Name "rdp-rule"
Set-AzNetworkSecurityRuleConfig -Name "rdp-rule" -NetworkSecurityGroup $nsg -Access "Deny"
Author: HarshitaSingh-MSFT
Assignees: -
Labels:

Network, feature-request, Doc - Reference, Service Attention, needs-triage

Milestone: -

ghost avatar Sep 08 '21 07:09 ghost

@Raag007 , Get-AzNetworkSecurityRuleConfig tries to find rule config according to the name. It doesn't explain how security in example was created. It should have a rule named rdp-rule. If your security group doesn't contain it, the command will show error.

https://github.com/Azure/azure-powershell/blob/2a56655a3ccfd9b2d0fc6d674a42f512d457e6ae/src/Network/Network/NetworkSecurityGroup/NetworkSecurityRule/GetAzureNetworkSecurityRuleConfigCommand.cs#L43

dingmeng-xue avatar Sep 08 '21 07:09 dingmeng-xue

Technically, it should fix below code and avoid to return Get-AzNetworkSecurityRuleConfig: Sequence contains no matching element

https://github.com/Azure/azure-powershell/blob/2a56655a3ccfd9b2d0fc6d674a42f512d457e6ae/src/Network/Network/NetworkSecurityGroup/NetworkSecurityRule/GetAzureNetworkSecurityRuleConfigCommand.cs#L50

dingmeng-xue avatar Sep 08 '21 07:09 dingmeng-xue

Get-AzNetworkSecurityRuleConfig

The behavior of outputting that message, prevents the usage of Get-AzNetworkSecurityRuleConfig on conditional clauses like:

~ (Get-AzNetworkSecurityRuleConfig -Name 'AzureBasicInfrastructure' -NetworkSecurityGroup $nsg) -eq $null Get-AzNetworkSecurityRuleConfig: Sequence contains no matching element

pmsousa avatar Mar 09 '22 11:03 pmsousa

Hello, Just checking if this issue was already resolved. The documentation says the ""rdp-rule" is "user defined" which appears to explain how the security rule in the example was created. Does that satisfy this request? 2023-10-11 05_47_55-Get-AzNetworkSecurityRuleConfig (Az Network) _ Microsoft Learn

aaronpena avatar Oct 11 '23 10:10 aaronpena