cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

Lookup dashboard ID in bundle variables

ddundovic
New Contributor III

Hi all,

I have an asset bundle that contains the following dashboard_task:

resources:
  jobs:
    my_job:
      name: my_job_name

      tasks:
        - task_key: refresh_my_dashboard
          dashboard_task:
            dashboard_id: ${var.my_dashboard_id}

Here I would like to use the `my_dashboard_id` variable, so that it automatically substitutes the ID of the dashboard when deployed on different workspaces. So in my `databricks.yml` file, at bundle level, I have the following variables mapping:

variables:
  my_dashboard_id:
    lookup:
      dashboard: My_Dashboard_Name

 However, this returns an error during bundle validation:

Error: failed to resolve dashboard: My_Dashboard_Name, err: Dashboard named 'My_Dashboard_Name' does not exist

I am certain that the dashboard exists and that I have the necessary permissions.

Furthermore, when I run `databricks dashboards list`, no dashboards are found. I saw in the databricks cli documentation that `databricks dashboards` are commands for modifying legacy dashboards. This would explain why no dashboards are found when I run that. Is it possible that the lookup in the bundle configuration also looks for legacy dashboards?

Any help with getting this work would be much appreciated. Thanks! 

1 ACCEPTED SOLUTION

Accepted Solutions

ddundovic
New Contributor III

Thanks! That does make sense. When I run `databricks lakeview list` I do get the dashboard I want:

[
  {
    "create_time": "2025-06-23T08:09:49.595Z",
    "dashboard_id": "id000000000000000000000",
    "display_name": "My_Dashboard_Name",
    "lifecycle_state": "ACTIVE",
    "warehouse_id": "id0000000000000"
  }
]

Will just have to be patient then 🙂 thanks!

View solution in original post

2 REPLIES 2

jhonnmick
New Contributor II

You're right to be confused, what's happening is that the dashboard lookup in your bundle only works with legacy dashboards, not the newer Lakeview dashboards. That’s why the lookup fails and databricks dashboards list comes up empty. Unfortunately, the bundle system doesn’t yet support looking up Lakeview dashboards by name. For now, the best workaround is to manually grab the dashboard ID from the Databricks UI or API and pass it through your .env file or with a --var flag when deploying. Hopefully, full support will come in a future update!

ddundovic
New Contributor III

Thanks! That does make sense. When I run `databricks lakeview list` I do get the dashboard I want:

[
  {
    "create_time": "2025-06-23T08:09:49.595Z",
    "dashboard_id": "id000000000000000000000",
    "display_name": "My_Dashboard_Name",
    "lifecycle_state": "ACTIVE",
    "warehouse_id": "id0000000000000"
  }
]

Will just have to be patient then 🙂 thanks!