Forum Discussion
Urgent: Refreshing power report C#
So, I haven't look into this very much but it seems as in your scenario you should just create a regular account in Azure AD, give it a PowerBI Pro license and use that login/password in your code to retrieve a access token and use that in the authorization header when you call the REST-api.
Look at the section Access token for non-Power BI users (app owns data)
https://docs.microsoft.com/en-us/power-bi/developer/get-azuread-access-token
No need to setup a registered app with a oauth flow since you're not building an application that should consume data on behalf of the user.
Here you can check how they use the token to call the API.
I've never tried it though so I might be way off. Might give it a try this week if I have some time left.
ill try this too. could you please try and let me know exactly how can I proceed? I get error 401 when I execute the link in the above thread.
thanks