Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am implementing a provisioning tool using the PowerBI.CSharp.SDK, authenticating to PowerBI using a service principal.
The code is based on the AppOwnsData code sample for authentication.
I can successfully create a new workspace, import a PBIX, and modify the datasource and credentials to point to a specific Azure SQL database.
I need to assign the new workspace to a PowerBI Embedded capacity. I can do this in the powerbi portal, but my code returns "unauthorized" despite the service principal having:
The code looks like this, and I have verified that the workspace id and capacity id are valid.
Fails on the last line with Unauthorised response from the REST API.
Can anyone spot what am I doing wrong?
Hi, @Anonymous
It seems there is something wrong with authorization from the rest api. I can't reproduce your scenario, I'd like to suggest you open a support ticket here if you have a pro license for further help.
Best Regards
Allan