Open BhargaviAnnadevara opened 3 years ago
Thank you for your reporting. Tagging and routing to the team member best able to assist.
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dnssuppgithub.
Author: | BhargaviAnnadevara-MSFT |
---|---|
Assignees: | - |
Labels: | `Network - DNS`, `Service Attention` |
Milestone: | - |
Description
We've had reports from a customer of late about the
NumberOfVirtualNetworkLinks
property having incorrect values when executed without-Name
and-ResourceGroupName
parameters.Steps to reproduce
Get-AzPrivateDnsZone
with and without-ResourceGroup
and-Name
parameters and note the difference in output.NumberOfVirtualNetworkLinks
property inGet-AzPrivateDnsZone
cmdlet output seems to always show0
(incorrect value), even when there are linked VNets. Correct value reflects only when-ResourceGroup
and-Name
parameters are passed along.Findings: The
Get-AzPrivateDnsZone
andGet-AzPrivateDnsZone -ResourceGroupName <RG-name>
commands apparently invoke the Private Zones - List and Private Zones - List By Resource Group REST APIs under the hood, that has theNumberOfVirtualNetworkLinks
property set to0
in the response. Whereas,Get-AzPrivateDnsZone -ResourceGroupName <RG-name> -Name <Private-Zone-Name>
command calls the Private Zones - Get REST API that populates theNumberOfVirtualNetworkLinks
property as well with the appropriate value.Post: Property 'NumberOfVirtualNetworkLinks' not reported #1885
Workaround: To work around this behavior, one has to run the
Get-AzPrivateDnsZone
cmdlet twice to obtain the extended properties, as follows:Ask: IMHO, this experience can confuse customers especially when they're new to using Azure PowerShell modules/cmdlets to manage their resources and mislead them when such data discrepancies are observed. Would love to know your thoughts on the expected behavior and how this experience can be improved.
Environment data
Module versions