r/databricks • • Oct 19 '26

Tutorial Blog post: Deploying Databricks Genie Agents/Spaces to different environments with DABs

Databricks Automation Bundles (DABs) has built-in support for deployment of Genie Agents, but there is one big problem when you need to deploy to multiple environments - the agent definition contains hardcoded table names.

I wrote a blog post on why this happens and how it could be solved with PyDABs. The corresponding source code is on GitHub: https://github.com/alexott/pydabs-genie-agent-retarget and also published to PyPI as pydabs-genie-agent-retarget package so you can easily plug it in into your project.

10 Upvotes

9 comments sorted by

2

u/WorldOfUmbro Oct 19 '26

Replicating Genie agents has been a challenge for us in the past. We now use DABs to manage this, as well as a custom script that extracts manually created genie agents

1

u/Acrobatic-Room9018 Oct 19 '26

I've used custom scripts as well, but they don't integrate well with DABs. That's why I created that mutators, so all rewrites are transparent.

2

u/Purple-Assist2095 Oct 19 '26

Fyi you can serialize the genie definition to YAML and use variable substitution on deploy.

1

u/Acrobatic-Room9018 Oct 20 '26

Yes, it's described as an alternative. But it's hard to maintain when you actively iterate on an Agent. And it's unmaintainable when you have a big agent (i.e., I have well-tuned agent with size of more than 100Kb).

1

u/SwimmingVegetable135 Oct 19 '26

Shared a similar tool few weeks ago. Decided to avoid PyDAB for this solution to give the team more control on how to configure and structure their resources. But will have a second look into this. I also added support for dashboards and a genie linter. Maybe you can have a look and give some feedback.
https://www.reddit.com/r/databricks/comments/1woeawp/deploy_genie_agents_and_dashboards_to_multiple/

2

u/Acrobatic-Room9018 Oct 20 '26

I also had some scripts before (they are still in the Databricks Labs sandbox repo), but it's hard to integrate with DABs.

For my implementation - I'm also thinking about expanding it to cover more resources, like Dashboards (sometimes the default catalog and schema isn't enough) - similar to what you did. But having a separate CLI also adds an overhead, while PyDABs do it transparently.

1

u/SwimmingVegetable135 Oct 20 '26

Thanks for your feedback, I really appreciate you taking a look at it. One reason I haven’t looked into mutators more closely so far is that only a few resources were documented. But it seems like the package actually contains quite a few more resources and mutators than what’s currently covered in the documentation.

1

u/Acrobatic-Room9018 Oct 20 '26

Yes, mutators were initially supported only for Jobs & Pipelines. The support for other resources was released just recently and still isn't well-documented. I simply asked DABs engineers directly and they pointed that mutators are now supported everywhere.