Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi community,
I do have the following issue:
I do try to tap this end point https://api.powerbi.com/v1.0/myorg/datasets/{datasetId}/executeQueries from ADF pipline but I get an error:
Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 403 Forbidden, please check your activity settings. Request URL: https://api.powerbi.com/v1.0/myorg/datasets/***********************************************/executeQ.... Response: ,Source=Microsoft.DataTransfer.ClientLibrary,'
This is my set-up:
Azure:
1. AD application registered in AAD
2. Security Group that the above application is a member of
PBI:
3. Allow service principals to use PowerBI API enabled in PBI admin and applicable to the above security group
4. The same security group added as admin to a workspace where dataset is published to
ADF:
5. I have 1 linked service, 1 activity and 1 data set:
a. REST linked service for PowerBI api (https://api.powerbi.com/) using service prinicpal ID - test connection works
b. REST data set, using above link service with this relative URL: v1.0/myorg/datasets/*****************************/executeQueries
c. web activity "GetBearerToken" that send POST request to https://login.microsoftonline.com/microsoft.onmicrosoft.com/oauth2/token with this body:
@concat('grant_type=client_credentials&client_id=',pipeline().parameters.ClientID,'&resource=https://analysis.windows.net/powerbi/api&client_secret=',pipeline().parameters.Secret)
to get access token back - it does work and I get TOKEN back
c. copy data activity with a source that uses REST dataset (see paragraph b.) and POST method with this body:
{
"queries": [
{
"query": "EVALUATE VALUES('SRRR_TWS Franklaw')"
}
],
"serializerSettings": {
"includeNulls": true
}
}
and this authotisation header:
@concat('Bearer ',activity('GetBearerToken').output.access_token)
This activity does fail with the folowing error:
Failure happened on 'Source' side. ErrorCode=RestCallFailedWithClientError,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=Rest call failed with client error, status code 403 Forbidden, please check your activity settings. Request URL: https://api.powerbi.com/v1.0/myorg/datasets/***********************************************/executeQ.... Response: ,Source=Microsoft.DataTransfer.ClientLibrary,'
Would anyone have any idea what I'm doing wrong here.
Thanks,
WJ
Hi @lupa0682
I have not tried it with ADF, but with the error 403 it does indicate that there is an authentication error as far as I can see.
Can you also make sure that this is enabled in your Power BI Admin Tenant settings as shown below.
An update:
It does work now... In my REST linked service for https://api.powerbi.com/, I changed Authentication type from 'service principal' to 'Anonymous'.
I do have a web activity to get a BearerToken, where I POST AD app credentials in request body to https://login.microsoftonline.com/********************.onmicrosoft.com/oauth2/token
REQUEST BODY:
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.