Subnet snet-pe (10.1.1.0/24) in virtual network myVNet contains:
- virtual machine vm-jump
- private endpoint pe-foundry for a Microsoft Foundry resource
- private endpoint pe-search for an Azure AI Search service
Network security group nsg-pe is associated with snet-pe, and nsg-pe already filters traffic to vm-jump. Private endpoint network policies on snet-pe are currently Disabled.
An engineer runs the commands in the exhibit because the security team asked for NSG filtering of pe-foundry.
$net = @{
Name = 'myVNet'
ResourceGroupName = 'myResourceGroup'
}
$vnet = Get-AzVirtualNetwork @net
$sub = @{
Name = 'snet-pe'
VirtualNetwork = $vnet
AddressPrefix = '10.1.1.0/24'
NetworkSecurityGroupId = ($vnet.Subnets | Where-Object { $_.Name -eq 'snet-pe' }).NetworkSecurityGroup.Id
PrivateEndpointNetworkPoliciesFlag = 'NetworkSecurityGroupEnabled'
}
Set-AzVirtualNetworkSubnetConfig @sub
$vnet | Set-AzVirtualNetwork
Which statement describes how nsg-pe filters traffic after the commands complete?
Private endpoint network policies are a subnet setting. They apply only to private endpoints and affect every private endpoint in that subnet. Enabling NSG support on snet-pe therefore brings both pe-foundry and pe-search under nsg-pe. Other resources such as vm-jump were already controlled by the NSG's security rules, so they are unaffected.
- Not correct: nsg-pe filters neither endpoint until route table support is also enabled. Network policies can be enabled for network security groups only. NetworkSecurityGroupEnabled is enough for NSG rules to apply to the private endpoints.
- Not correct: nsg-pe filters pe-foundry; pe-search and vm-jump are unchanged. The setting is configured on the subnet and affects all private endpoints in it. pe-search is filtered as well, not only pe-foundry.
- Not correct: nsg-pe filters pe-foundry, pe-search and, for the first time, vm-jump. The setting applies only to private endpoints. Access to other resources such as vm-jump was already controlled by NSG rules, so nothing changes for the VM.
- Correct: nsg-pe filters pe-foundry and pe-search; vm-jump is unchanged. The setting applies to every private endpoint in snet-pe. vm-jump is not a private endpoint, so the NSG continues to control its access as before.