Forum Discussion
Generate Power BI API Token Without User Interaction for Scheduled Report Exports
- 1 year ago
Hi Himanshu_G,
Can try using a Service Principal (App Owns Data) is a secure, scalable, and reliable way to automate Power BI report exports. It lets your system access Power BI without needing a user to log in, making it perfect for scheduled tasks. This approach ensures that reports are delivered consistently and securely, while also reducing manual work—providing a better experience for your team and your customers.
Please refer to below documentation for same and let me know if this helps.
https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal?tabs=azure-portalThanks,
Prashanth Are
MS Fabric community support
Hi Himanshu_G,
to automate Power BI report export and email delivery in a User Owns Data (UoD) scenario without manual login, using the ROPC (Resource Owner Password Credentials) OAuth2 flow. However, there are important conditions and security considerations:
-
ROPC is supported by Azure AD, and works with Power BI REST APIs in delegated (UoD) mode.
-
Microsoft does not recommend ROPC for public clients or high-risk environments.
-
It only works if:
-
Conditional Access policies allow ROPC
-
MFA is not enforced on the user account
-
The account is a trusted internal (first-party) user
-
security and best practices:
-
Use a dedicated service user account (not a personal account)
-
Store credentials securely, e.g., in Azure Key Vault
-
Assign minimum necessary delegated permissions
-
Use secure environments only (internal automation, no public-facing code)
-
Monitor and rotate credentials periodically
Thanks,
Prashanth Are
MS Fabric community support
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly and give Kudos if helped you resolve your query