The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
5 | |
4 | |
3 | |
2 | |
2 |