Hi @somnii
If You Are Running on Serverless Compute
Serverless workloads run within the Databricks-managed control plane. Outbound internet calls from Serverless Compute are governed by Serverless Egress Policies at the Account level:
Restricted Egress Mode: By default, serverless network policies for many accounts are in a restricted mode to prevent arbitrary outbound internet access.
How to Fix (Account Admin Required):
Log into the Databricks Account Console (accounts.cloud.databricks.com or platform equivalent).
Navigate to Security > Networking > Context-based ingress & egress control
Locate the policy associated with your trial workspace
On the Egress tab, ensure Internet access is set to "Allow access to all destinations" or explicitly add your external API domain (FQDN) to the Allowed Destinations list.
Restart your serverless session and re-run your request.
2. If You Are Running on Classic Compute (Single Node / Multi-Node Clusters)
Classic clusters run in the cloud virtual networks (VPC/VNet). Trial workspaces often deploy into a Databricks-managed Default VPC/VNet:
Egress Restrictions / Firewall Rules: If your trial workspace was provisioned using a Customer-Managed VPC (VNet Injection) then outbound internet traffic is governed by your cloud networks' Security Groups, NAT Gateway, or Egress Firewall.
IP Whitelisting on the External API: If the API endpoint you are calling is enforcing IP whitelisting then calls made from a Databricks cluster would originate from the public IP of your NAT Gateway or Public Node IP. You will need to whitelist these public egress IPs on the external API side.
PySpark UDF Internet Access Restriction: If your API request is wrapped in a PySpark User-Defined Function (UDF) spanning across worker nodes, be sure node-to-node security group rules allow outbound 80/443 traffic.
Quick Troubleshooting Verification
Try executing a simple Python request directly from a notebook attached to a Classic All-Purpose Cluster:
Python
import requests
try:
response = requests.get("https://api.your-endpoint.com/health", timeout=10)
print("Status:", response.status_code)
except Exception as e:
print("Connection Failed:", e)
If Classic Compute succeeds but Serverless fails: This indicates a Serverless Egress Policy restriction in the Account Console.
If both fail with a DNS/Timeout error: This indicates a cloud network firewall, proxy configuration, or the target API is blocking Databricks egress IPs.