Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi All,
I am calling the same API in Power BI desktop and Fabric Data Factory. It works ok with Power BI desktop (and service) but I am facing an authentication error in Data Factory. In desktop and service it is Oauth2but data factory does not have this option so I used basic authentication. I am new to working with APIs and API authentication.
Is there a way to use the same authentication I am using for power bi desktop (just my org username) with data factory? Or I have to create a Service Principal for this API?
API: https://management.azure.com/subscriptions/{subscriptionID}/resourceGroups/{resourceGroupID}/provide... CPU&top=100&aggregation=average&api-version=2023-10-01®ion={region}&metricNamespace=microsoft.compute/virtualmachines&$filter=Microsoft.ResourceId eq '*'"
Data Factory Error:
Rest call failed with client error, status code 401 Unauthorized, please check your activity settings.
Response: {"error":{"code":"AuthenticationFailedInvalidHeader","message":"Authentication failed. The 'Authorization' header is provided in an invalid format."}}
I tried getting a token by loging in here but I am getting an error:
https://login.microsoftonline.com/common/oauth2/authorize returns error: The request body must contain the following parameter: 'client_id'
Do I have to register theAPP like below or there is an easier way?
Register an App to request authorization tokens and work with APIs - Azure Monitor | Microsoft Learn
Thanks,
Sam
Solved! Go to Solution.
Hi @Samco23 ,
I think you firstly need to Navigate to the Azure portal -> Subscription -> add your service principal as a Contributor/Owner role in the subscription like below.
Then I think in the linked service, configure it like below, fix them with the values.
Finally I test the linked service with a copy activity, it works fine.
You can also look at this document for a further study: Register a Microsoft Entra app and create a service principal - Microsoft identity platform | Micros...
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Samco23 ,
I think you firstly need to Navigate to the Azure portal -> Subscription -> add your service principal as a Contributor/Owner role in the subscription like below.
Then I think in the linked service, configure it like below, fix them with the values.
Finally I test the linked service with a copy activity, it works fine.
You can also look at this document for a further study: Register a Microsoft Entra app and create a service principal - Microsoft identity platform | Micros...
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Fabric update to learn about new features.