Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Could someone please advise me where I may be going wrong here. I am attempting to create a sample dataset after retrieving what I believe to be a correct access token after prompting the end-user to login using the following URL:
https://login.windows.net/common/oauth2/authorize?response_type=code&client_id={client_app_id}&resource=https://analysis.windows.net/powerbi/api&redirect_uri={my_redirect_uri}
To create the sample dataset I used the following URL:
POST https://api.powerbi.com/v1.0/myorg/datasets
with the headers:
{ "Authorization" => "Bearer {auth_code}", "Content-Type" => "application/json" }
and the body:
"{\"name\":\"SalesMarketing\",\"tables\":[{\"name\":\"Product\",\"columns\":[{\"name\":\"ProductID\",\"dataType\":\"int\"},{\"name\":\"Manufacturer\",\"dataType\":\"string\"},{\"name\":\"Category\",\"dataType\":\"string\"},{\"name\":\"Segment\",\"dataType\":\"string\"},{\"name\":\"Product\",\"dataType\":\"string\"},{\"name\":\"IsCompete\",\"dataType\":\"bool\"}]}]}"
but when I send the request, all I receive is a 403 error with no message.
Any suggestions?
Many Thanks,
Carl
I think you are using the SPN approach, where SPN doesn't have access to Myworkspace. So basically you have use the legacy autentication (username and password)
Basically I'm making a request (post) on:
https://login.windows.net/common/oauth2/token
With the Body parameters:
grant_type = password
scope = openid
resource = https: //analysis.windows.net/powerbi/api
client_id = MY_CLIENT_IS
username = MY_USER_NAME
password = MY_PASSWORD
Hi, Jayendran,
I have send a post request that follow up your screenshot but I get an error:"
Thanks @Jayendran,
I don't believe I am able to use this endpoint as my organisation has enabled two-factor authentication unless you're aware of a way to bypass it for this?
This is the error I received:
"error": "interaction_required", "error_description": "AADSTS50076: Due to a configuration change made by your administrator, or because you moved to a new location, you must use multi-factor authentication to access '00000009-0000-0000-c000-000000000000'.\r\nTrace ID: 83cc52bf-55e5-473e-9c83-92ac9b622200\r\nCorrelation ID: add98fba-18cb-4759-9fa4-f3526aa7341b\r\nTimestamp: 2019-09-25 12:33:35Z", "error_codes": [ 50076 ],
Hi @cgreenwood
I don't think you can bypass the MFA ,you have to disable the MFA to work this legacy approach.
Another workaround will be use the same approach you have, but instead of publishing this to Myworkspace try in a different worksapce, like below
https://api.PowerBI.com/v1.0/myorg/groups/{group_id}/datasets
And make sure that SPN have Admin access to that workspace