GetNamespaceInfo.ps1 example does not function when a Relay has a Private Endpoint
RyanTBerry opened this issue · comments
Actual Behavior
When using example script to obtain IPs for outbound whitelisting purposes: https://github.com/Azure/azure-relay-dotnet/blob/master/tools/GetNamespaceInfo.ps1, it does not function when using relays that have a private link.
-
PowerShell Script Output:
Namespace: arn-pf01tst1-PRD1Namespace : arn-pf01tst1-PRD1.servicebus.windows.net
Deployment : ARN-PF01TST1-PRD1
CloudServiceDNS : arn-pf01tst1-PRD1.privatelink.servicebus.windows.net
CloudServiceVIP : 13.92.180.208
GatewayDnsFormat : g{0}-arn-pf01tst1-prd1-sb.servicebus.windows.netResolve-DnsName arn-pf01tst1-PRD1.privatelink.servicebus.windows.net -Type A
Name Type TTL Section NameHost
arn-pf01tst1-PRD1.privatelink. CNAME 30 Answer ns-sb2-prod-bl3-011.cloudapp.net
servicebus.windows.netName : ns-sb2-prod-bl3-011.cloudapp.net
QueryType : A
TTL : 45
Section : Answer
IP4Address : 13.92.180.208 -
Issue is a result of a relay with a private link returning the privatelink FQDN as the name as shown above. It appears that this PowerShell script was authored before relay supported private links.
Expected Behavior
- Should return the list/block of public IP addresses used by the relay and work with or without privatelink enabled.
Versions
- OS platform and version: All
- NuGet package version or commit ID:
I added a couple updates to the proposed changes in RyanTBerry#1. I was still seeing issues resolving namespaces with private endpoints, this seems to make that work. Can we merge that in as well?