I have the resoruces in the resource group with the virtual network integrated, public network access disabled and having private endpoints connectivity.
I'm trying to fetch the customer visible DNS (FQDN and Private IP) from the private endpoints using the below script:
# Set the resource group name
$resourceGroupName = "YourResourceGroupName"
# Get all private endpoints in the resource group
$privateEndpoints = Get-AzPrivateEndpoint -ResourceGroupName $resourceGroupName
foreach ($pe in $privateEndpoints) {
Write-Host "Private Endpoint Name: $($pe.Name)"
foreach ($nic in $pe.NetworkInterfaces) {
$nicDetails = Get-AzNetworkInterface -Name $nic.Id.Split("/")[-1] -ResourceGroupName $resourceGroupName
foreach ($ipConfig in $nicDetails.IpConfigurations) {
Write-Host " IP Address: $($ipConfig.PrivateIpAddress)"
}
}
foreach ($connection in $pe.PrivateLinkServiceConnections) {
Write-Host " Connection Name: $($connection.Name)"
Write-Host " FQDN URL: $($connection.PrivateLinkServiceConnectionState.Status)"
Write-Host " Group IDs: $($connection.GroupIds -join ', ')"
Write-Host " FQDNs: $($connection.Fqdns -join ', ')"
foreach ($fqdn in $connection.Fqdns) {
Write-Host " Customer-visible FQDN: $fqdn"
}
}
Write-Host "---------------------------------------------"
}
I'm getting the below output like:
Private Endpoint Name: webapp-proj-prod-uks-ui-uks-pe
IP Address: 10.x.x.x
Connection Name: webapp-proj-prod-uks-ui-uks-pe
FQDN URL: Approved
Group IDs: sites
FQDNs:
Not sure why I'm not getting the FQDN URL. could you please help me how to get the URL of the private endpoint from its dns configuration menu.
can you ty this :
The idea is to search for this differently.
try to retrieve the private IP address of the Private Endpoint through its network interfaces (NICs).
and you identify the private DNS zones linked to the virtual network (VNet) where this Private Endpoint is connected (via the Private DNS zone links).
Within these private DNS zones, you search for DNS records that match those private IP addresses — these are the FQDNs
You can do it with powershell or python sdk azure easily