Forum Discussion
Power BI API Connectivity in Azure Data Factory
Hello yubandi. Thanks for following up, yes we are still experiencing difficulties with accessing the API. I tried with/without date parameters as mentioned but still receiving the PowerBINotAuthorized exception. When parameters were included the default values are included as follows with startDateTime = '2025-01-20T00:00:00Z' and endDateTime = @utcnow()
The Dataset properties in Source are set with the same values as shown below:
The full error message is below with or without input parameters specified.
"ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 401 Unauthorized, please check your activity settings.
Request URL: https://api.powerbi.com/v1.0/myorg/admin/activityevents.
Response: {"error":{"code":"PowerBINotAuthorizedException","pbi.error":{"code":"PowerBINotAuthorizedException","parameters":{},"details":[],"exceptionCulprit":1}}},Source=Microsoft.DataTransfer.ClientLibrary,'"
So it still seems to be a permissions issue but seems I have all required permissions granted. The only item that I've seen online that looks to be required is Activity.Read.All. I don't see that this is something I have, not sure how to tell if this permission is available. How would you suggest I check for this? Please let me know of any other suggestions as well. Thanks again for your assistance!
HI sbrahmbhatt ,
Thank you for the detailed explanation. To clarify, since this setup uses Service Principal, permissions like Activity.Read.All / AuditLog.Read.All won’t be listed there. These are delegated permissions, so it’s normal not to see them.
Based on your information, your configuration seems correct. The issue may be due to the limitation with ActivityEvents API and Service Principal, which can result in 401/403 errors even when everything is set up properly.
If you haven’t already, it might help to test with a Power BI Admin user login in Postman to confirm.
Thank You.