Sitemap
Databricks Community Articles

Practical Databricks tutorials, architecture guides, AI insights, product updates, and best practices for modern data professionals + Databricks MVPs (Most Valuable Professionals)

Environment Variables in Databricks Serverless

5 min readOct 28, 2026

--

Environment variables are now available in Serverless through both the UI and DABs.

What are environment variables?

Environment variables are settings you give to your code, like which environment to use or how detailed the logs should be. You can change these settings without editing the code.

Press enter or click to view image in full size

You can access the article on the SunnyData blog for free.

Classic vs serverless

You can use environment variables with both classic and serverless compute, but you set them differently.

| Classic compute                    | Serverless jobs                    |
| ---------------------------------- | ---------------------------------- |
| Configure variables on the compute | Define named entries on the job |
| through spark_env_vars. | and select them per task. |
| Supports init scripts. | Does not support init scripts. |

Python reads both the same way, through os.environ or os.getenv.

And job parameters

  • Job parameters are useful for inputs that change between runs, like a date or country to process.
  • Environment variables are useful for application settings, like…

--

--

Databricks MVP | Advisor to Databricks Product Board | Content creator at SunnyData | creator of Databricks Community Articles publication

Databricks Community Articles
Databricks Community Articles

Published in Databricks Community Articles

Practical Databricks tutorials, architecture guides, AI insights, product updates, and best practices for modern data professionals + Databricks MVPs (Most Valuable Professionals)