Azure / azure-relay-dotnet

☁️ .NET Standard client library for Azure Relay Hybrid Connections

Home Page:https://docs.microsoft.com/en-us/azure/service-bus-relay/relay-what-is-it

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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.

  1. PowerShell Script Output:
    Namespace: arn-pf01tst1-PRD1

    Namespace : 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.net

    Resolve-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.net

    Name : ns-sb2-prod-bl3-011.cloudapp.net
    QueryType : A
    TTL : 45
    Section : Answer
    IP4Address : 13.92.180.208

  2. 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

  1. 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?