Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
11 | |
3 | |
3 | |
2 | |
2 |