Databricks Dashboard run from Job issue

anilsampson
New Contributor III

Hello, i am trying to trigger a databricks dashboard via workflow task.

1.when i deploy the job triggering the dashboard task via local "Deploy bundle" command deployment is successful.

2. when i try to deploy to a different environment via CICD while deploying validation is successful. but deploy bundle is failing on the dashboard task with below error:

cannot create job: No task defined for dashboard task

 

im using below in resource.yml

tasks:
- task_key: dashboard_task
dashboard_task:
subscription:
subscribers:
- user_name: ${workspace.current_user.userName} # Replace this with the email of snapshot subscriber email
paused: false
warehouse_id: ${var.warehouse_id}
dashboard_id: ${resources.dashboards.nyc_taxi_trip_analysis.id}

SP_6721
Honored Contributor II

Hi @anilsampson ,

The error means your dashboard_task is not properly nested under the tasks section.

tasks:

- task_key: dashboard_task
  dashboard_task:
    dashboard_id: ${resources.dashboards.nyc_taxi_trip_analysis.id}
    warehouse_id: ${var.warehouse_id}
    subscription:
      subscribers:
        - user_name: ${workspace.current_user.userName}
    paused: false

Make sure dashboard_task is indented under the task item (not at the same level as tasks:)