SC-100 Design security solutions for infrastructure • Set 5
SC-100 Design security solutions for infrastructure Practice Test 5 — 15 questions with explanations. Free, no signup.
Refer to the exhibit. You run the PowerShell script to apply an NSG to a subnet. However, connectivity tests show that the NSG rule is not being applied. What is the most likely reason?
Refer to the exhibit. Set-AzContext -Subscription 'Production' $vnet = Get-AzVirtualNetwork -Name 'VNet-Prod' -ResourceGroupName 'RG-Prod' $subnet = Get-AzVirtualNetworkSubnetConfig -Name 'Subnet-DB' -VirtualNetwork $vnet $config = New-AzNetworkSecurityGroup -Name 'NSG-DB' -ResourceGroupName 'RG-Prod' -Location 'eastus' $rule = New-AzNetworkSecurityRuleConfig -Name 'AllowSQL' -Access Allow -Protocol Tcp -Direction Inbound -Priority 100 -SourceAddressPrefix '10.0.1.0/24' -SourcePortRange * -DestinationAddressPrefix '10.0.2.0/24' -DestinationPortRange 1433 $config | Add-AzNetworkSecurityRuleConfig -NetworkSecurityRule $rule Set-AzNetworkSecurityGroup -NetworkSecurityGroup $config Set-AzVirtualNetworkSubnetConfig -Name 'Subnet-DB' -VirtualNetwork $vnet -NetworkSecurityGroup $config $vnet | Set-AzVirtualNetwork