Forum Discussion
Uploading PBIX File in C# sample (HELP!)
- 7 years ago
Hi brunozanoelo
You don't need dedicated capacity now. It has no connection with the autentication.
Are you running behind the code behind any proxy ? Which blocks your autentication ?
Can you try executing in Post man ?
Success using the fiddler
More permissions
But in the app, the errorstill persist.
Hi brunozanoelo
Previously you said that autentication is not passed which means it should have a 200 status code. In such scenario you should see the error in fiddler.
However you said that fiddler is successful. It doesn't make sense !
However, Can you change your code to like the below
HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer " + AccessToken);
client.DefaultRequestHeaders.Add("Accept", "application/json");
HttpResponseMessage response = client.GetAsync(restUri).Result;
var content = response.Content.ReadAsStringAsync().Result;
Console.WriteLine(content);this way you can get what is the result of the API.
- brunozanoelo7 years agoPost Patron
I believe I'm getting an sucessfully authentication, since I get the IDToken from the
Console.WriteLine(userAuthnResult.IdToken);
The consolewriteline result an empty string, BUT, take a look of this message when I debug... When the application uses the Workspace function, I get the status code 403 - Forbidden.
Status code 403??empty string403
I´m logging in with my PowerBI PRO account, I don´t have any embedded capacity in Azure portal, I need to create it and change my workspace to "dedicated capacity"? https://community.powerbi.com/t5/Service/PowerBI-Embedded-Service-403/td-p/71382 - Jayendran7 years agoSolution Sage
Hi brunozanoelo
You don't need dedicated capacity now. It has no connection with the autentication.
Are you running behind the code behind any proxy ? Which blocks your autentication ?
Can you try executing in Post man ?
- brunozanoelo7 years agoPost Patron
Got it! I´ve found the problem!
I will post this source in github in a few days. I just need to fix a few details. (I think this will help a lot of ppl too) :)
I´m facing one problem that when I send my dataset, he doesn't replace, even if is the same pbix name, there´s any possibility to replace the dataset? I need this because I have tons of configurations to auto refresh data.
Thank you a lot my friend.
Warm Regards, - Jayendran7 years agoSolution Sage
Hi brunozanoelo
Glad you solved your problem.
Yes there is way to replace the dataset, using the ImportConflictHandlerMode by assigning CreateOrOverwrite
https://api.powerbi.com/v1.0/myorg/imports?datasetDisplayName={datasetDisplayName}&nameConflict={nameConflict}Reference:
https://docs.microsoft.com/en-us/rest/api/power-bi/imports/postimport#importconflicthandlermode
- Anonymous7 years agoNot applicable
Looking forward to see how you solved this, please post the solution on github and share here. Thank you !
- brunozanoelo7 years agoPost Patron
Jayendran , there´s no property in the dataset object to use the dataset/refresh history;
https://powerbi.microsoft.com/en-us/blog/announcing-data-refresh-apis-in-the-power-bi-service/I´m trying to implement this, will keep in touch...