The Wayback Machine - https://web.archive.org/web/20220317132356/https://github.com/Azure/azure-powershell/issues/15820
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not at all clear documentation. #15820

Open
HarshitaSingh-MSFT opened this issue Sep 7, 2021 · 4 comments
Open

Not at all clear documentation. #15820

HarshitaSingh-MSFT opened this issue Sep 7, 2021 · 4 comments

Comments

@HarshitaSingh-MSFT
Copy link

@HarshitaSingh-MSFT HarshitaSingh-MSFT commented Sep 7, 2021

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: MicrosoftDocs/azure-docs-powershell#1877 (comment)
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"
@msftbot
Copy link

@msftbot msftbot bot commented Sep 8, 2021

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: MicrosoftDocs/azure-docs-powershell#1877 (comment)
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: -
@dingmeng-xue
Copy link
Member

@dingmeng-xue dingmeng-xue commented Sep 8, 2021

@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.

@dingmeng-xue
Copy link
Member

@dingmeng-xue dingmeng-xue commented Sep 8, 2021

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

@pmsousa
Copy link

@pmsousa pmsousa commented Mar 9, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment