Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Himanshu_G
Helper I
Helper I

Generate Power BI API Token Without User Interaction for Scheduled Report Exports

We need to export Power BI reports using the Power BI REST API and send them via email on a scheduled basis in a User Owns Data scenario. The challenge is that obtaining an access token requires user authentication, but we need a way to generate the token automatically without user interaction to support scheduled email delivery.

Requirement

We are looking for a solution to:

  • Programmatically authenticate and retrieve an access token for Power BI APIs without manual login.
  • Automate report exports and send them via email at scheduled intervals.
  • Ensure compliance with User Owns Data authentication requirements while maintaining security best practices.

Has anyone successfully implemented this? What are the best practices to achieve this securely? Any guidance would be greatly appreciated!

1 ACCEPTED SOLUTION

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-por...

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

View solution in original post

13 REPLIES 13
Himanshu_G
Helper I
Helper I

We need to export Power BI reports using the Power BI REST API and send them via email on a scheduled basis in a User Owns Data scenario. The challenge is that obtaining an access token requires user authentication, but we need a way to generate the token automatically without user interaction to support scheduled email delivery.

Requirement

We are looking for a solution to:

  • Programmatically authenticate and retrieve an access token for Power BI APIs without manual login.
  • Automate report exports and send them via email at scheduled intervals.
  • Ensure compliance with User Owns Data authentication requirements while maintaining security best practices.

Has anyone successfully implemented this? What are the best practices to achieve this securely? Any guidance would be greatly appreciated!

Hi @Himanshu_G ,

 

I hope this information provided is helpful. Feel free to reach out if you have any further questions or would like to discuss this in more detail. If responses provided answers your question, please accept it as a solution so other community members with similar problems can find a solution faster.

 

Thank you!!

@rohit1991  Thank you for the suggested solution. However, it doesn't align with our specific use case.

Hi @Himanshu_G ,

 

Thank you for reaching out to Microsoft Fabric Community.

 

using service account or service principal are the possible solutions.

 

Could you share a bit more about the constraints or requirements you're working with? For example:

  • Are service principals or app registrations not allowed in your environment?

  • Is the report being exported tied to per-user row-level security (RLS)?

Once I have a better idea of the exact boundaries, we can provide you the best solution possible. 

 

If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

 

Thank you!!

Hi @Himanshu_G ,

 

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If the responses has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.

 

Thank you!!

Hi @Himanshu_G ,

 

Thank you for reaching out to Microsoft Fabric Community.

Thank you @Himanshu_G  for the prompt response.

 

May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

 

Thank you.

Hi @Himanshu_G 

To programmatically generate a Power BI API access token without user interaction for scheduled report exports in a User Owns Data scenario, the recommended and secure approach is to implement service principal authentication using Azure AD app registrations.

 

While User Owns Data typically involves delegated permissions and user context, automation without manual login is achievable by shifting to a Service Principal or Service Account model with appropriate permissions assigned. In this setup, you register an application in Azure AD, grant it API permissions to Power BI, and use a client secret or certificate to authenticate via OAuth2.0 to obtain tokens programmatically. This allows your backend service or script to fetch a token and call the Power BI REST API to export reports and send them via email at scheduled intervals using tools like Power Automate, Azure Functions, or custom code.

 

It’s important to ensure that the service principal has access to the necessary workspaces and datasets, and to store secrets securely (e.g., in Azure Key Vault). While this approach leans toward the App Owns Data model, it is often adapted in User Owns Data workflows when automation is a priority.

 

Passionate about leveraging data analytics to drive strategic decision-making and foster business growth.

Connect with me on LinkedIn: Rohit Kumar.



v-prasare
Community Support
Community Support

Hi @Himanshu_G,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if the solution provided for your issue worked? or let us know if you need any further assistance here?

 

 

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

Himanshu_G
Helper I
Helper I

Thank you all for the suggestions — they were very helpful. Unfortunately, they don't align with our requirements.

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-por...

 

 

 

Thanks,

Prashanth Are

MS Fabric community support

v-prasare
Community Support
Community Support

Hi @Himanshu_G,

 

As we haven’t heard back from you, we wanted to kindly follow up to check if your issue got resolved? or do you need any additional help here?

 

 

 

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

v-prasare
Community Support
Community Support

Hi @Himanshu_G, As we haven’t heard back from you, we wanted to kindly follow up to check if your issue got resolved? or do you need any additional help here?

 

 

 

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

v-prasare
Community Support
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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.