Power BI Support - Use Case - Refresh Data set
Describe the current behavior
N/A
Describe the proposed behavior
We note that airflow has support for refreshing a Power BI dataset, we have coded this up by hand for now. However we figured that this is possibly a candidate for inclusion as a default future capability in Prefect.
We have permissioned the same Managed Identity the requisite Azure Container Instance uses to the Power BI Workspace. We then use the DefaultAzureCredential(managed_identity_client_id={the Client Id of the managed identity}). It need to get a token given the Power BI scope (https://analysis.usgovcloudapi.net/powerbi/api/.default) – note this is for the US GCC endpoint.
We’re using the following API:
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-datasets-in-group - to map from name to ID
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/refresh-dataset-in-group - to initiate the refresh
https://learn.microsoft.com/en-us/rest/api/power-bi/datasets/get-refresh-history-in-group - to track completeness
It’s similar to the DBT Cloud Job functionality – that then waits for the job to complete.
This also in hindsight also ties back to the Snowpipe functionality we raised, and making it a standard block behavior.
Example Use
No response