The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I’m currently using Airflow to orchestrate some notebooks in Microsoft Fabric. My setup leverages the FabricUser connection and FabricRunItemOperator for earlier steps, and everything works smoothly up to this point.
However, when I attempt to use the PowerBIDatasetRefreshOperator in the final step with the same FabricUser connection, I encounter the following error:
Authentication failed: AADSTS7000215: Invalid client secret provided. Ensure the secret being sent in the request is the client secret value, not the client secret ID, for a secret added to app 'b39a6123-149f-4fad-8659-55f249cb5e9a'.
Trace ID: 9516efd5-2ead-4059-8cae-957fdd72f600
Correlation ID: 8ec4dfbf-8e41-497e-aaec-1061d6204919
Timestamp: 2024-11-27 16:17:48Z
Despite these checks, the issue persists.
Thank you in advance for your help.
It looks like you’re running into a classic AADSTS7000215 invalid client secret issue, which often comes up with Airflow operators that connect via Azure AD. Based on your steps, you’ve already confirmed the basics, but here are a few things worth trying:
1. Double-check secret validity and expiration
In Azure AD, ensure the client secret hasn’t expired. Even if it looks fine, try regenerating a new secret and updating your FabricUser connection. Sometimes a refresh clears hidden mismatches.
2. Verify redirect URIs and API permissions
Make sure your app registration includes the correct redirect URI for Airflow and has API permissions for Power BI (e.g., Dataset.ReadWrite.All). Without these, the operator may fail authentication.
3. Use a Service Principal instead of FabricUser (if possible)
While the FabricUser connection works well for orchestrating notebooks, PowerBIDatasetRefreshOperator is often more stable with a Service Principal–based connection. You can configure this in Azure AD and update your Airflow connection accordingly.
4. Cross-check Airflow logs for token caching issues
Sometimes Airflow workers cache tokens incorrectly, especially if multiple DAGs are using the same connection. Clearing the token cache or restarting the Airflow worker can resolve intermittent auth errors.
For more details, Microsoft has a helpful guide on using Service Principals for Power BI API authentication, https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal?tabs=azure-por... which may give you additional clarity.
Since you mentioned needing consistent results, treating this as part of a guaranteed work process is crucial ensure secrets are rotated securely and connections are validated before each DAG run. You may also want to review the community thread on Airflow Power BI operator configuration, https://community.fabric.microsoft.com/t5/Power-Query/Authentication-issues-with-Power-BI-service-pr... where users shared fixes that align closely with your situation.
Hi,
I've summarized the full setup in this article, hope it helps!
Orchestrate Fabric Data workloads with Airflow - Mattias De Smet
Hi, @EmmanouilTroula
Please refer to the following links hopefully it will help you.
Refresh Power BI semantic model with Apache Airflow Job - Microsoft Fabric | Microsoft Learn
Solved: Unauthorized Error in Airflow Task with Microsoft ... - Microsoft Fabric Community
How do I mitigate "AADSTS7000215: Invalid client secret is provided" ? - Microsoft Q&A
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI @EmmanouilTroula,
According to your description, it seems like your requirement is more related to the data factory airflow. I will help you move to that forum to get further support.
Apache Airflow Job - Microsoft Fabric Community
Regards,
Xiaoxin Sheng
I'm not familiar with Airflow yet, but these problems also occur in the API. Does your principal have sufficient rights in the Fabric workspace to refresh the dataset?
yes, i follow this tutorial
https://www.youtube.com/watch?v=_RXpvWjgZE8&t=330s&ab_channel=KratosBI