Σημείωμα
Η πρόσβαση σε αυτήν τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να εισέλθετε ή να αλλάξετε καταλόγους.
Η πρόσβαση σε αυτήν τη σελίδα απαιτεί εξουσιοδότηση. Μπορείτε να δοκιμάσετε να αλλάξετε καταλόγους.
Important
This feature is in Beta. To enable this feature preview in the workspace, opt into the Databricks Sandbox setting in the workspace Previews page. See Manage Azure Databricks previews.
Databricks Sandbox lets you run untrusted code in an isolated environment through the Databricks REST API, SDK, or Databricks CLI. The sandbox provides serverless, on-demand compute for running code dynamically.
Each sandbox includes a persistent home directory. You can stop and start a sandbox at any time, and the data in your home directory persists.
The sandbox is ideal for:
- Running an agent harness.
- Executing user-written or AI-written code.
- Running background tasks or workers.
- Launching interactive IDE or SSH sessions.
Prerequisites
Your workspace must be in a supported region. See Features with limited regional availability.
To use the SDK, Python 3.10 or above.
To use the Databricks CLI over SSH, install the Databricks CLI and authenticate it with
databricks auth login:databricks auth login # authenticate to a Databricks workspace
Get started
To create a sandbox and run code in it, see Databricks Sandbox quickstart. The quickstart covers each way to use a sandbox:
- A sandbox tool for agents that you build with the Agent Bricks CLI.
- The Databricks SDK for Python, the recommended way to work with sandboxes from code.
- The Databricks CLI, to connect to a sandbox over SSH.
Compute size
Databricks Sandbox comes with 4 vCPUs and 8 GB of RAM. This size is not configurable.
Storage
Warning
At the end of the Beta period, Databricks might perform a one-time purge of data stored in sandboxes. Do not store anything you cannot afford to lose.
Databricks Sandbox comes with network-attached storage.
- Data in your home directory (
/home/sandbox-agent) persists for the lifetime of your Databricks Sandbox. Even after stopping your Databricks Sandbox, the data in your home directory is available when you start your next session. - Your home directory can store up to 100 GB. At this time, this cannot be changed.
- You can store up to 10 GB outside your home directory, but this data is deleted when you stop your sandbox.
Networking
There are no restrictions on network egress from a sandbox, and egress is not configurable.
Custom images
You can create a sandbox from your own container image stored in Artifact Registry, so every sandbox starts with your packages, tools, and configuration already installed. See Create a sandbox from a custom image.
Usage costs
Databricks does not currently charge for usage of this feature. However, cost and pricing for features in Beta are subject to change.
For complete billing usage information, see Databricks pricing. Databricks anticipates billing sandbox usage for:
- Runtime compute: Billed hourly while your Databricks Sandbox is running.
- Persistent storage: You are billed for the data stored in your home directory until your Databricks Sandbox is deleted. Storage incurs billing as long as the Databricks Sandbox instance exists. To stop paying for storage, you must delete the sandbox.
- Data transfer
Limitations
- Quotas are enforced. You can have at most 200 active sandboxes per user (800 total across all states), and a workspace can have at most 400 active sandboxes (2,000 total).
- You cannot connect over SSH to a sandbox that you create with the Databricks SDK. To connect over SSH, create the sandbox with the Databricks CLI. See Use the Databricks CLI to create a sandbox.
- Databricks Sandbox is a compute primitive for running code, not a general-purpose Spark runtime. For Spark workloads, use Connect to serverless compute.
- The public IP addresses of your Databricks Sandbox can change at any time. The default ingress of the sandbox is closed to all traffic. This cannot be changed at this time.
- Changes outside your home directory do not persist after you stop a sandbox. To start every sandbox with the same packages and configuration, use a custom image. See Create a sandbox from a custom image. To reuse files across sessions of one sandbox, store them in your home directory.