Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Jeff_973
Frequent Visitor

PowerBI.API.V2 Dataset.DeleteDatasetByIdInGroupWithHttpMessagesAsync Unauthorized response.

When I try and use the operation DeleteDatasetByIdInGroupWithHttpMessagesAsync I get an "Operation returned an invalid status code 'Unauthorized'". I have granted all permissions to the PowerBI Service for my Registered App. Is anyone else having a similar issue or aware of any work arounds. 

I am able to delete a report.

1 ACCEPTED SOLUTION

I had an error in my code - the identifier I was using for the data-set was incorrect. It works now, thank you for your response.

View solution in original post

3 REPLIES 3
Eric_Zhang
Microsoft Employee
Microsoft Employee


@Jeff_973 wrote:

When I try and use the operation DeleteDatasetByIdInGroupWithHttpMessagesAsync I get an "Operation returned an invalid status code 'Unauthorized'". I have granted all permissions to the PowerBI Service for my Registered App. Is anyone else having a similar issue or aware of any work arounds. 

I am able to delete a report.


@Jeff_973

The DeleteDatasetByIdInGroupWithHttpMessagesAsync works fine in my test, when

1. I have edit permission in the app workspace.

2. All permissions are granted in the registered APP.

 

As you mentioned that you can deleted report, do you mean the report in the same app workspace?

 

As to the permissions, please have a double confirm  that your application is granted with sufficient permissions. See Apply permissions to your application within Azure AD. If the highlighted permission is not checked, please check it and save. Then click "Grant Permissions"

Capture.PNG

Capture.PNG

 

 

 

 

 

I had an error in my code - the identifier I was using for the data-set was incorrect. It works now, thank you for your response.

I double checked that all of the permissions are checked in the app workspace and I made sure that I granted the permissions.  Yes, I am able to delete a report in the same app workspace just not a dataset. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.