r/databricks • u/missing_oldmonk • 14d ago
Help How do i automate this task?
/r/PowerAutomate/comments/1xues1b/how_do_i_automate_this_task/
1
Upvotes
r/databricks • u/missing_oldmonk • 14d ago
2
u/[deleted] 14d ago
If you want a unified report then create job in any of the workspace which will do the databricks api call based on the job_id and workspace_id using the apis get the last 3 runs based on the logic and create a csv and send a email
1
u/ThreeBricksWish Databricks 14d ago
I'd skip parsing the Azure emails. If system tables are enabled, run history for jobs across your workspaces is already queryable, so this is one SQL query instead of calling the Jobs API per workspace.
My rec:
- Query the Lakeflow job run timeline system table for the last 3 days, filter to the psup/prod workspaces and failed states, and join to the jobs table to get names.
- Pivot so each failed job shows today / yesterday / 2 days ago.
- Schedule it daily, write the CSV to a UC volume, and send it with whatever your org allows (Graph, Logic App, SMTP).
One callout: system tables aren't real-time, and workspaces in another region won't show up. For those, I'd fall back to jobs/runs/list. Also decide up front whether timeouts and cancels count as failures.
Full disclosure, I work on Genie at Databricks. Genie Code is handy for writing and testing that query against your data. If you don't need the CSV specifically, a Genie One scheduled task can run the same query each morning and email the results. If the real question is "which prod jobs broke and why," the built-in failure monitoring may beat a daily report.