Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Important
This feature is in Beta. To use it, a workspace admin must turn on Project-Scoped Shared Compute from the Previews page. See Manage Azure Databricks previews.
With Shared Serverless, notebooks and files in the same Git folder or bundle share serverless compute and a Python environment in the editor. To customize the environment, add a pyproject.toml file at the folder root. Choose the compute option for your Git folder or bundle:
- Git folders, with Shared Serverless for Git Folders.
- Declarative Automation Bundles, with Shared Serverless for Asset Bundles.
Requirements
- Your workspace must meet the serverless compute requirements.
- Open your Git folder or bundle in the Git folder editor or the bundle editor. See Create and manage Git folders and Author bundles in the workspace.
- Shared Serverless requires serverless environment version 5 or above.
Shared compute and environment
- Notebooks and files in the same Git folder or bundle share compute and a Python environment in the editor. An optional
pyproject.tomlfile at the folder root defines the shared environment. - Only notebooks and files inside the associated Git folder or bundle can attach to its shared compute resource.
- Shared compute resources are isolated by user. Only the user who first attaches a notebook or file to a shared compute resource can run workloads on it.
- Notebook execution remains isolated. Python variables defined in one notebook are not available in another notebook.
- A web terminal opened from an attached notebook or file runs on the same compute resource.
Shared Serverless for Git Folders
Use Shared Serverless for Git Folders to work with notebooks and files in a Git folder.
Attach notebooks and files in the Git folder editor
In the workspace sidebar, click Workspace and navigate to the Git folder.
Click Open in editor.
Open a notebook or file in the Git folder.
Click the compute drop-down menu.
Select Shared Serverless for Git Folders.

Run the notebook or file to start the compute resource.
To use the same compute from another notebook or file, open it in the same Git folder and select Shared Serverless for Git Folders.
Collaborate through Git
Databricks recommends that each collaborator clone the repository into a Git folder in their personal workspace folder. Each collaborator then gets a separate compute resource and environment for their clone.
Use branches, commits, pushes, and pulls to exchange changes through the remote Git repository. See Collaborate in Git folders.
Shared Serverless for Asset Bundles
Use Shared Serverless for Asset Bundles to work with notebooks and files in a bundle in the workspace. The bundle root contains databricks.yml and can contain a pyproject.toml file that defines the shared environment.
Attach notebooks and files in the bundle editor
- In the workspace sidebar, click Workspace and navigate to the bundle.
- To the right of the bundle name, click Open in editor.
- Open a notebook or file in the bundle.
- Click the compute drop-down menu.
- Select Shared Serverless for Asset Bundles.
- Run the notebook or file to start the compute resource.
To use the same compute from another notebook or file, open it in the same bundle and select Shared Serverless for Asset Bundles.
To collaborate through Git, have each collaborator clone the repository into a Git folder in their personal workspace folder. See Collaborate through Git.
Manage the environment with pyproject.toml
Shared Serverless uses the pyproject.toml file at the Git folder or bundle root to manage Python dependencies for the project. Standard serverless notebooks use dependencies configured for each notebook in the Environment side pane.
Create the root pyproject.toml file and set its serverless environment version before managing its dependencies. See Create and edit pyproject.toml. You can then add dependencies with notebook commands or edit the file directly.
Use notebook commands
Open a notebook attached to Shared Serverless for Git Folders or Shared Serverless for Asset Bundles.
Run
%uv add <package>to add a dependency to the rootpyproject.tomlfile. For example:%uv add cowsay
The command updates pyproject.toml, uv.lock, and the shared environment. You do not need to run %uv sync after %uv add. Use %uv sync to apply changes made directly to pyproject.toml.
Create and edit pyproject.toml
Open a notebook attached to Shared Serverless for Git Folders or Shared Serverless for Asset Bundles.
Open the Environment side pane.
In the Managed by pyproject.toml card, click
Create pyproject.toml to create the root file. If the file already exists, click
View pyproject.toml. The file opens in the editor.

Edit the
dependencieslist. Keep the generated[tool.databricks.environment]section, or add it if missing. Setenvironment_versionto a supported version (5 and above). For example:[project] name = "my-project" version = "0.1.0" dependencies = [ "simplejson==3.18.1", ] [tool.databricks.environment] environment_version = "5"Click Apply at the top of the
pyproject.tomlfile editor.
The updated environment is available to notebooks and files attached to the same shared compute resource. To inspect the environment, open the Environment side pane. See Configure the serverless environment for information about serverless environment versions and installed dependencies.
Schedule a notebook
When you schedule a notebook attached to Shared Serverless from the Git folder or bundle editor, Azure Databricks uses the root pyproject.toml file as the job's project environment if the file exists. Deploy the bundle as described in the following steps.
- In the Git folder or bundle editor, open a notebook attached to Shared Serverless.
- If the Git folder or bundle has a root
pyproject.tomlfile, verify that it declares the dependencies needed by the task. - Click Schedule.
- In the Compute drop-down list, select serverless compute.
- Configure the schedule and click Create.
After you click Create, check the job configuration:
Git folder: If the Git folder has a root
pyproject.tomlfile, verify that Project environment in the job's task configuration points to it. To change the selection, see Configure environment for job tasks.Bundle: The bundle editor opens a generated job YAML file in the
resources/folder.- If the bundle has a root
pyproject.tomlfile, verify thatproject_environmentunder the environment'sspecpoints to it, relative to the generated YAML file. See Configure a project environment in a bundle. - Deploy the bundle to create the job.
Schedules are paused by default in development mode. See Declarative Automation Bundles deployment modes.
- If the bundle has a root
For notebook scheduling options, see Create and manage scheduled notebook jobs.
Limitations
- Compute sharing is scoped to a serverless usage policy. Notebooks and files in the same Git folder or bundle that use different usage policies are assigned separate compute resources instead of sharing one.