Home / Databricks on Azure

Databricks on AzureRunbookAdvanced

Sev1: serverless jobs, notebooks and model serving lost outbound access after a Databricks network policy change

After serverless egress control was switched to restricted or enforced, serverless workloads can't reach PyPI, APIs or storage. Find the denials in system.access.outbound_network, then fix the policy or go back to dry-run.

Deepak Bhardwaj6 min read

Applies toAzure Databricks Premium, serverless egress control (network policies), serverless jobs and notebooks, SQL warehouses, Model Serving, Databricks Apps

Symptoms

  • Serverless jobs and notebooks fail while classic clusters running the same code work.
  • pip install, %pip or environment setup fails with connection timeouts or refused connections.
  • Calls to external APIs, Azure SQL, Event Hubs or a partner SaaS time out from serverless compute.
  • Model Serving endpoints fail to build or can't call their external dependencies; Databricks Apps can't reach back-end services.
  • Reads from an abfss:// path that is not registered in Unity Catalog fail from serverless.
  • It started after an account admin attached a network policy to the workspace, changed it from Full access to Restricted access, added or removed destinations, or turned off dry-run.

Serverless egress control applies to serverless compute in the workspaces the policy is attached to. In enforced mode, connections not on the allowlist are dropped and logged. Classic compute is not affected, which is why "it works on my cluster" is a strong hint.

Step 1: confirm it is the egress policy (5 minutes)

Query the denied connections. The table is system.access.outbound_network; it needs the access system schema enabled and SELECT on it.

SELECT event_time, workspace_id, network_source_type,
       destination_type, destination, access_type
FROM system.access.outbound_network
WHERE event_time >= current_timestamp() - INTERVAL 6 HOURS
ORDER BY event_time DESC
LIMIT 200;
  • access_type = 'DROP' means the connection was blocked by an enforced policy.
  • DRY_RUN_DENIAL means it would have been blocked but was allowed because the policy is in dry-run.
  • network_source_type tells you which product made the call (for example DBSQL, General Compute, MLServing, ML Build, Apps).
  • destination_type is DNS, IP or STORAGE.

Summarise what is being blocked:

SELECT network_source_type, destination_type, destination, count(*) AS denials,
       max(event_time) AS last_seen
FROM system.access.outbound_network
WHERE event_time >= current_timestamp() - INTERVAL 24 HOURS
  AND access_type = 'DROP'
GROUP BY ALL
ORDER BY denials DESC;

Column values can change while the table is in preview; run DESCRIBE TABLE system.access.outbound_network if a filter returns nothing.

If there are no denials for your workspace in the incident window, the policy is not the cause. Check the storage firewall and network connectivity configuration instead (serverless storage firewall and NCC).

Step 2: find the policy and the change

In the account console: Security > Networking > Network policies (menu names vary by release). Note:

  • Which policy is attached to the affected workspace (Workspaces > workspace > Network policy).
  • Internet access mode: Full access or Restricted access.
  • Allowed domains and allowed storage destinations.
  • Enforcement mode and which products are in dry-run.

Find who changed it:

SELECT event_time, user_identity.email AS actor, action_name, request_params
FROM system.access.audit
WHERE service_name = 'accounts'
  AND event_date >= current_date() - INTERVAL 2 DAYS
  AND (action_name ILIKE '%network%' OR action_name ILIKE '%policy%')
ORDER BY event_time DESC;

Step 3: restore service

Choose the fastest safe option.

Situation Action
A few known destinations missing from the allowlist Add them to allowed domains or storage destinations
Many destinations failing, allowlist incomplete Switch enforcement to dry-run for the affected products (or all products)
Policy attached to the wrong workspace Re-attach the workspace's previous policy
Security requires restriction to stay Keep enforced, add destinations one by one from the denial query

Add missing destinations

Add the FQDNs from the denial query to the policy. Typical gaps:

Workload Destinations to check
Python packages pypi.org, files.pythonhosted.org, or your private feed host (for example pkgs.dev.azure.com)
Azure services The exact service FQDN, such as <server>.database.windows.net or <namespace>.servicebus.windows.net
SaaS APIs The API host used by your code, not only the vendor's website
Storage outside Unity Catalog Add the storage account as an allowed storage destination, or register it as an external location

Storage reached through Unity Catalog external locations and managed storage is handled by Unity Catalog. Direct abfss:// access to unregistered accounts is the usual source of STORAGE denials.

Move to dry-run

Set enforcement to dry-run for the products that are failing. Connections are then allowed again and logged as DRY_RUN_DENIAL, so you keep the data you need to finish the allowlist.

Warning

Dry-run removes the protection the policy was meant to give. Get agreement from the security owner, put a time limit on it and track the open denials until you can enforce again.

Policy changes can take a few minutes to apply. Restart running serverless workloads (rerun the job, restart the notebook's serverless session, redeploy the serving endpoint) after the change.

Step 4: confirm

SELECT access_type, count(*) AS events
FROM system.access.outbound_network
WHERE event_time >= current_timestamp() - INTERVAL 30 MINUTES
  AND workspace_id = '<workspace-id>'
GROUP BY access_type;
  • No new DROP events for the destinations your workloads need.
  • A rerun of one failed job from each team succeeds on serverless.
  • %pip install of a known package works in a serverless notebook.
  • Model Serving endpoints show Ready and answer a test query.

Repair failed runs instead of rerunning whole jobs where tasks already succeeded (repair failed tasks).

Step 5: rebuild the allowlist properly

From dry-run data, list every destination your workloads need over a full business cycle (month-end jobs included):

SELECT destination_type, destination, collect_set(network_source_type) AS products,
       count(*) AS hits, min(event_time) AS first_seen, max(event_time) AS last_seen
FROM system.access.outbound_network
WHERE event_time >= current_timestamp() - INTERVAL 30 DAYS
  AND access_type = 'DRY_RUN_DENIAL'
GROUP BY destination_type, destination
ORDER BY hits DESC;

Review each with the owning team, add the approved ones and enforce again product by product: SQL warehouses first (few outbound calls), then jobs and notebooks, then Model Serving and Apps.

Prevent it next time

  • Every new or changed network policy starts in dry-run. Enforce only after at least one full business cycle with no unexplained dry-run denials.
  • Keep a separate policy per environment and test changes on a non-production workspace with the same workloads.
  • Keep the allowlist in code (Terraform or the account API) with review, not in console edits.
  • Alert on DROP events from production workspaces with a scheduled SQL alert on system.access.outbound_network.
  • Mirror private package feeds so a single allowed host covers Python dependencies.