@koosha
I tested this end-to-end using Databricks CLI v1.22.1 with the direct deployment engine, and confirmed that a Genie Space and an AI/BI Dashboard can be deployed together in a single bundle deploy, without hardcoding IDs or requiring a second deployment.
The key is to use .id, not .space_id:
In yaml
overrideId: ${resources.genie_spaces.test_genie.id}
Important distinction: space_id does exist in the Genie API response, but ${resources.genie_spaces.test_genie.space_id} is not available as a bundle resource reference in CLI v1.22.1.
In my tests, .space_id passed bundle validate but failed during deployment planning with:
field "space_id" not found in resources.GenieSpaceConfig
The bundle reference must use .id, even though the Genie API returns the identifier as space_id.
Another useful finding: Both approaches worked in my tests:
- Inline serialized_dashboard, using structured YAML or a JSON string.
- External .lvdash.json referenced through file_path.
So switching to inline serialized_dashboard isn't necessary with the tested CLI version.
Minimal configuration
In `databricks.yml`:
bundle:
name: genie-dashboard
engine: direct
variables:
warehouse_id: {}
resources:
genie_spaces:
test_genie:
title: Genie test
warehouse_id: ${var.warehouse_id}
serialized_space:
version: 2
data_sources:
tables:
- identifier: samples.nyctaxi.trips
dashboards:
test_dashboard:
display_name: Genie integration test
warehouse_id: ${var.warehouse_id}
file_path: ./dashboard.lvdash.json
In the existing valid dashboard.lvdash.json, configure:
"uiSettings": {
"genieSpace": {
"isEnabled": true,
"enablementMode": "ENABLED",
"overrideId": "${resources.genie_spaces.test_genie.id}"
}
}
What I am have validated:
- First deployment: Both resources were created successfully in one deployment.
- API verification: The dashboard's persisted overrideId exactly matched the newly created Genie Space's space_id.
- Published dashboard end-to-end validation: Asking Genie successfully returned data, and clicking Open Genie Agent opened the exact bundle created Genie Space, confirmed by its ID in the URL.
- Dependency resolution: Genie was created before the dashboard without an explicit depends_on.
- Redeployment: Resource IDs remained stable.
- Second fresh target: The dashboard correctly referenced its own newly created Genie Space.
- Dashboard update: The link remained correct after a definition change.
Earlier I was using CLI v0.290.0 and it did not expose genie_spaces in its bundle schema.
Conclusion: With CLI v1.22.1, the existing file_path approach supports automatic resolution of the Genie Space ID. There's no need for custom JSON templating or a two-stage deployment for this scenario.
Hope this helps and answers your question.
References:
- Databricks bundle resource reference
- Genie Space bundle resource types