migueesc123 / PowerBIRESTAPI

A Microsoft Power BI Data Connector or Power Query Connector for the Power BI REST API
MIT License
237 stars 74 forks source link

Power BI Event Activity permissions #49

Closed migueesc123 closed 3 years ago

migueesc123 commented 3 years ago

Hi Miguel,

Great Custom Connector; thank you!

I am able to access details on Workspaces / reports etc. without any problems using the custom connector.

Unfortunately I too am unable to access the "Event Activity Log" due to permissions. I suspect my account would require Tenant Level Audit Log reads rather than my Power BI Service Admin permissions which (in theory) enable me to read Power BI specific Audit Log entries only...

Kind regards,

Marc PBIDesktop_ecCLpCppWx PBIDesktop_HTrIUhBjpf PBIDesktop_mD5AOrocWY

Originally posted by @marcmahmoodivc in https://github.com/migueesc123/PowerBIRESTAPI/issues/48#issuecomment-744586901

migueesc123 commented 3 years ago

hey @marcmahmoodivc This is usually because your application doesn't have the correct permissions to access this endpoint. I'd suggest that you check your application to make sure that you've provided the right permissions for it to happen.

Hope this helps! -Miguel

marcmahmoodivc commented 3 years ago

Hi Miguel,

Yes, I believe in order for your custom connector to use the Get Activity Log functions, the user would need Tenant level security privileges.

My Power BI Service Administration privileges do not work with this connector. They work with the PowerShell cmdlets though.

I have attached a picture of the "Yes" column where consent is required.

Kind regards,

Marc k15s95EcKZ

migueesc123 commented 3 years ago

Hey! I believe the powershell uses MSAL and this connector basically uses ADAL for the authentication, so scopes and permissions work a bit differently, but not so much. Maybe this is one of those weird cases where there's an actual difference?

I'd suggest that you check your network connectivity with a tool such as fiddler to see exactly what type of response you're getting from the API that's preventing you from querying the data. Is it a 403 response? or is it something else?

I can confirm that this is working for me, but my app does have everything set as "Yes" and with consent for my whole tenant. Here's how it should work: https://www.poweredsolutions.co/2020/01/18/power-bi-event-activity-log-api-easy-way-to-get-it/

At this point we can say that the issue is related to your application not providing the right permissions for the endpoint, but it's strange since it does seem that you have it all enabled as Yes (in terms of Read operations).

marcmahmoodivc commented 3 years ago

Thank you very much Miguel. I will investigate further because your custom connector is so awesome and post any of my findings.

Kind regards,

Marc