azuredatabricksazure-databricks

Identify Public Outbound IP Address for a databricks instance


We have an azure databricks instance deployed with SCC ( secure Cluster Connectivity ) in EAST US2 Region.

we have a Public IP Address space created and a NAT Gateway associated with that address space to allow outbound access to resources. This NAT gateway is in-turn bound to the VNET that the databricks workspace is deployed in.

i am trying to find the outbound public IP Address of that databricks instance so that i can get it whitelisted with our infra team for one of the products we are trying to use.

is there a way i could find that?

Whitelisting the IP of the NAT Gateway doesn't seem to work for databricks.

so if SCC dictates it's own IP for databricks, is there a way for me to get that?


Solution

  • If your databricks is sending outbound traffic though the NAT gateway, the IP shown to the outside world would be the IP of the NAT gateway. Unless there is some Enterprise firewall or proxy which is altering the IP shown to the product you are trying to connect to.

    One way to confirm what the IP is to the outworld is fire a simple Rest API call to https://webhook.site. To your specific url, visit https://webhook.site and use the url assigned to you from the search bar. Use some simple python code to send a sample POST message from a notebook in your databricks

    import requests
    
    url = 'https://webhook.site/XXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
    body = "{ \"TESTING\" : \"true\" }"
    response = requests.post(url, data=body, verify=True)
    if response.status_code != 200:
        print(response.status_code)
    if i%10 == 0:
        print(i)
    

    You will be able to see the IP where the message was sent from on the website like so enter image description here

    You can check where does this public IP belong to. Your public VNET? Your NAT gateway? The Azure public assigned IPs?

    Anyhow if you need help in creating a VNET injected workspace integrated with a natgateway, you can follow this link.