PREP WITH PROOF
Menu
MICROSOFT FABRIC / PRACTICAL GUIDE

Microsoft Fabric Workspace Default Environment for Spark Notebooks

Set a published Fabric environment as the workspace default, verify Spark runtime and library versions, and troubleshoot notebooks that still use another environment.

THE QUICK ANSWER

To standardize Spark runtime and libraries in Microsoft Fabric, publish an Environment item with the approved settings. Then, as a workspace admin, open Workspace settings → Data Engineering/Science → Spark settings → Environment, turn on Set default environment, select the item, and save. Notebooks and Spark job definitions using Workspace default inherit it. Check for an explicitly attached environment or an existing Spark session if a notebook still shows another configuration.

Choose an environment when you need to standardize libraries

Changing only the workspace Spark runtime addresses the runtime choice. If authors are also installing different library versions, put the required runtime and dependencies together in an Environment item. Set the item as the default in each relevant workspace and control who can update it. This gives authors a baseline and an explicit place to check when their session behaves differently.

Save and publish the environment changes. Use Full publication mode for a library snapshot intended for scheduled and shared workloads. Wait for publication to succeed before using the release as an acceptance baseline.

Source: Microsoft Learn — Create, configure, and use a Fabric environment ↗

Work through a two-workspace rollout

A retail team maintains separate development and production workspaces. Its new notebook version depends on a fictional package, retail-ingest 1.4.2. Both workspace admins configure and publish an approved environment. Each sets the environment as the default in the relevant workspace, and the team starts fresh test sessions before scheduling the rollout.

In production, the daily sales notebook uses Workspace default and sees 1.4.2. A legacy returns notebook uses an explicitly attached environment and reports 1.3.8. Open the returns notebook’s Environment dropdown first. If it is meant to adopt the shared baseline, test it with Workspace default before promoting the change. If it still requires the older package, record the exception and keep it attached to its approved environment.

Production itemEnvironment selectionWhat to verify
Daily sales notebookWorkspace defaultFresh session sees the approved runtime and 1.4.2.
Legacy returns notebookAn explicitly selected environmentConfirm whether the older dependency is intentional.
Scheduled ingestion runExpected environment in the production itemTest the actual scheduled execution path.

Source: Microsoft Learn — Manage libraries in Fabric environments ↗

Verify what the notebook actually loaded

Run a smoke check in a fresh Spark session. The first print shows the Spark engine version. Use the environment settings separately to confirm the selected Fabric runtime, which includes more than the Spark version. For the second line, substitute the installed distribution name from your own requirements. The version check below verifies what the notebook’s Python driver can see. For production, also run a representative task on the same execution path that will use the dependency.

If a workspace-default notebook does not match the approved baseline, check the workspace and the last successful environment publication before looking for a notebook-level installation or an old session. Record the environment name and observed versions alongside the smoke-test result.

from importlib.metadata import version

print(spark.version)
print(version('retail-ingest'))  # Use your installed distribution name.

Source: Microsoft Learn — Apache Spark runtime in Fabric ↗

Choose the right level of configuration in DP-700

When the requirement is consistency across a workspace, look for a shared default. Attaching an environment to individual notebooks makes sense for an intentional exception. A notebook-level package installation can help during experimentation but does not establish a shared workspace baseline.

Open the free DP-700 sample below and choose Study mode. Its workspace setup question asks how to address inconsistent notebook runtimes and manual library installations. Pick the configuration level before reading the explanation.

Source: Microsoft Learn — DP-700 study guide ↗

KEEP THESE THREE THINGS

Your next steps

  1. Publish the environment item and set it as the workspace default.
  2. Check an item’s environment selection before assuming it inherits the default.
  3. Verify the published configuration in a fresh session and test the scheduled execution path.

Sources & official resources

Linked resources checked on 2026-11-26. Technical behavior and provider guidance can change; check the documentation for the version you use.

About this guide and its recommendations

Published by Prep With Proof with AI-assisted drafting. Study routines and examples are editorial suggestions, not official exam instructions or claims of a learner's personal results. Cited provider facts are linked; ownership of recommended Prep With Proof products is disclosed. No competitor endorsement or guaranteed certification outcome is implied.

Suggest a correction →