K_Anudeep
Databricks Employee
Databricks Employee

Hello @pepco ,

Is it possible to use environments with notebook tasks?

Yes—but only in a very specific way.

Notebook tasks can use base environments, but you don’t attach them in the job’s YAML. You pick the base env in the notebook’s Environment side panel, and notebook job runs inherit that. If you put environment_key on a notebook task, the Jobs API rejects it with the exact error you saw—that setting is for task environments on non-notebook tasks (Python script / wheel / dbt)

Doc:https://docs.databricks.com/aws/en/admin/workspace-settings/base-environment

Anudeep

View solution in original post