Manage network policies for serverless egress control
To avoid breaking the connection between BDC and SAP Databricks, refer to the SAP documentation before configuring serverless egress control.
Network policies control outbound network connections from your serverless workloads in SAP Databricks. Use them to restrict egress to trusted destinations and to test rules in dry-run mode before you enforce them.
Requirements
- Permissions for managing network policies are restricted to account admins.
Accessing network policies
To create, view, and update network policies in your account:
- From the account console, click Security.
- Click the Networking tab.
- Under Policies, click Context-based ingress & egress control.
Create a network policy
-
Click Create new network policy.
-
Enter a Policy name.
-
Click the Egress tab.
-
Choose a network access mode:
- Allow access to all destinations: Unrestricted outbound internet access. If you choose Full access, outbound internet access remains unrestricted.
- Restricted access to specific destinations: Outbound access is limited to specified destinations.

Configure network policies
The following steps outline optional settings for restricted access mode:
Set egress rules
Before setting egress rules, note:
- When your metastore and cloud storage containers bucket of your UC external location are located in different regions, you must explicitly add the bucket to your egress allowlist for access to succeed.
- The maximum number of supported destinations is 2500.
- The number of storage destinations (
allowed_storage_destinations) that can be added is limited to 100 per policy. - The number of FQDNs that can be added as allowed domains is limited to 100 per policy.
- Domains added as Private Link entries for a network load balancer are implicitly allowlisted in network policies. When a domain is removed or the private endpoint is deleted, it might take up to 24 hours for network policy controls to fully enforce the change.
- OpenSharing buckets are implicitly allowlisted in network policies.
-
To grant your serverless compute access to additional domains, click Add destination above the Allowed domains list.

The FQDN filter allows access to all domains that share the same IP address.
noteModel serving provisioned throughput endpoints don't support granular FQDN filtering. When you set network access to restricted, all internet access is blocked for these endpoints.
-
To allow your workspace to access additional cloud storage containers, click the Add destination button above the Allowed storage destinations list.
Direct access to cloud storage services from user code containers, such as REPLs or user-defined functions (UDFs), is not permitted by default. To enable this access, add the storage resource's FQDN under Allowed Domains in your policy. Adding only the storage resource's base domain could inadvertently grant access to all storage resources in the region.
Policy enforcement
Dry-run mode allows you to test your policy configuration and monitor outbound connections without disrupting access to resources. When dry-run mode is enabled, requests that violate the policy are logged but not blocked. You can select from the following options:
-
Databricks SQL: Databricks SQL warehouses operate in dry-run mode.
-
AI model serving: Model serving endpoints operate in dry-run mode.
-
All products: All SAP Databricks services operate in dry-run mode, overriding all other selections.

Block internet destinations
This feature is in Public Preview and available to SEG-eligible workspaces. For workspaces on the Enterprise tier that are not yet SEG-eligible, blocked destinations are supported only in the default policy when network access is set to Full access.
Block specific internet destinations from your serverless workloads. Use blocked destinations as a lightweight alternative to Restricted access mode for blocking known-bad domains without switching the overall enforcement mode.
Configure blocked destinations through the network policies REST API. The API requires an account admin OAuth token. Personal access tokens are not supported for account-level APIs.
Blocked destinations behave as follows:
- Each entry specifies a
destination(a fully qualified domain name, or FQDN) and aninternet_destination_typeofDNS_NAME. - IP ranges and storage destinations are not supported.
- Blocked destinations are always enforced regardless of the policy's network access mode.
- Blocked destinations take precedence over allowed destinations.
- The API rejects configurations where an allowed destination is a subdomain of a blocked destination. However, the "allow broadly, block narrowly" pattern is permitted (for example, allowing
example.comand blockingapi.example.com).
To block an internet destination:
-
Retrieve your network policy. Run the following command:
Bashcurl --location --request GET \'https://<ACCOUNT_HOST>/api/2.0/accounts/<ACCOUNT_ID>/network-policies/<NETWORK_POLICY_ID>' \--header 'Authorization: Bearer <OAUTH_TOKEN>'Save the response body as
network-policy.json. -
Edit
network-policy.jsonto addblocked_internet_destinationsunderegress.network_access. The following example blocks a single domain in Full access mode:JSON{"network_policy_id": "my-policy","account_id": "...","egress": {"network_access": {"restriction_mode": "FULL_ACCESS","blocked_internet_destinations": [{"destination": "malicious-domain.example.com","internet_destination_type": "DNS_NAME"}]}}} -
Submit the updated policy with a
PUTrequest to the same endpoint using the following command. ThePUTbody must contain the full network policy. Any fields you omit are cleared.Bashcurl --location --request PUT \'https://<ACCOUNT_HOST>/api/2.0/accounts/<ACCOUNT_ID>/network-policies/<NETWORK_POLICY_ID>' \--header 'Content-Type: application/json' \--header 'Authorization: Bearer <OAUTH_TOKEN>' \--data @network-policy.json
Update the default policy
Each SAP Databricks account includes a default policy. The default policy is associated with all workspaces with no explicit network policy assignment, including newly created workspaces. You can modify this policy, but it cannot be deleted.
Associate a network policy to workspaces
If you have updated your default policy with additional configurations, they are automatically applied to workspaces that do not have an existing network policy.
To associate your workspace with a different policy, do the following:
- Select a workspace.
- In Network Policy, click Update network policy.
- Select the desired network policy from the list.
- Click Apply policy.

Apply network policy changes
Most network configuration updates automatically propagate to your serverless compute in ten minutes. This includes:
- Adding a new Unity Catalog external location or connection.
- Attaching your workspace to a different metastore.
- Changing the allowed storage or internet destinations.
You must restart your compute if you modify the internet access or dry-run mode setting.
Restart or redeploy serverless workloads
You only need to update when switching internet access mode or when updating dry-run mode.
To determine the appropriate restart procedure, refer to the following list by product:
- Databricks ML Serving: Redeploy your ML serving endpoint.
- Serverless SQL warehouse: Stop and restart the SQL warehouse.
- Jobs: Network policy changes are automatically applied when a new job run is triggered or an existing job run is restarted.
- Notebooks:
- If your notebook does not interact with Spark, you can terminate then reattach serverless compute to refresh the network policy.
- If your notebook interacts with Spark, your serverless resource refreshes and automatically detects the change. Most changes will be refreshed in ten minutes, but switching internet access modes, updating dry-run mode, or changing between attached policies that have different enforcement types can take up to 24 hours. To expedite a refresh on these specific types of changes, turn off all associated notebooks and jobs.
Declarative Automation Bundles UI dependencies
When you use restricted access mode with serverless egress control, Declarative Automation Bundles UI features require access to specific external domains. If outbound access is completely restricted, users might see errors in the workspace interface when working with Declarative Automation Bundles.
To keep Declarative Automation Bundles UI features working with restricted network policies, add these domains to the Allowed domains in your policy:
- github.com
- objects.githubusercontent.com
- release-assets.githubusercontent.com
- checkpoint-api.hashicorp.com
- releases.hashicorp.com
- registry.terraform.io
Verify network policy enforcement
You can validate that your network policy is correctly enforced by attempting to access restricted resources from different serverless workloads.
- Run a test query in the SQL editor or a notebook that attempts to access a resource controlled by your network policy.
- Verify the results:
- Trusted destination: The query succeeds.
- Untrusted destination: The query fails with a network access error.
Update a network policy
You can update a network policy any time after it is created. To update a network policy:
- On the details page of the network policy in your accounts console, modify the policy:
- Change the network access mode.
- Enable or disable dry-run mode for specific services.
- Add or remove FQDN or storage destinations.
- Click Update.
- Refer to Apply network policy changes to verify that the updates are applied to existing workloads.
Limitations
- Artifact upload size: When using MLflow's internal Databricks File System with the
dbfs:/databricks/mlflow-tracking/<experiment_id>/<run_id>/artifacts/<artifactPath>format, artifact uploads are limited to 5GB forlog_artifact,log_artifacts, andlog_modelAPIs. - Denial log delivery for short-lived garbage collection (GC) workloads: Denial logs from short-lived GC workloads lasting less than 120 seconds might not be delivered before the node terminates due to logging delays. Although access is still enforced, the corresponding log entry might be missing.