Triggering Power BI Refresh from a Python Model

I’ve been contemplating the best approach for triggering Power BI refreshes, and in particularly ensuring that dashboards are triggered according to when their underlying dependencies are updated. It occured to me that rather than representing a dashboard in dbt as an exposure, it might be possible to represent them as a Python model. I haven’t tested this theory, but hypothetically, could you…

  1. Create a python model that correlates to a Power BI dashboard
  2. Within the model, make an API call to the Power BI service to refresh the dashboard
  3. Make some kind of dummy references to dependencies, so these are captured in the DAG
  4. Any response from the API could be captured and returned as the model output – effectively acting as a log

Has anyone tried anything similar?

@najmead - did you succeed?