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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
stephanvierkant
Regular Visitor

How to get ReadWrite permission?

I've created an app to get an embed token and that's working fine. But when I try to trigger a refresh for the specified dataset (Required scope: Dataset.ReadWrite.All), I get a `401 Unauthorized` response. I'm using the Rest API with a password grant.

 

These are the values of my access token:

array:6 [
"token_type" => "Bearer"
"scope" => "Capacity.Read.All Dashboard.Read.All Dataset.Read.All Group.Read Report.Read.All Workspace.Read.All"
"ext_expires_in" => "3600"
"expires_on" => "1573226297"
"not_before" => "1573222397"
"resource" => "https://analysis.windows.net/powerbi/api"

]

 

How can I get `Dataset.ReadWrite.All` in my scope? In the Azure Portal I've added all permissions to my app, but it still gives me read access. When I use the 'demo client' in the documentation (https://docs.microsoft.com/nl-nl/rest/api/power-bi/datasets/refreshdataset#code-try-0) it works, but in my CLI app it doesn't. 

1 REPLY 1
Jayendran
Solution Sage
Solution Sage

Hi @stephanvierkant ,

 

Could you please try giving the Admin consent to your application which you reg in AD

grantpermission

 

Then try to generate the token check whether you scope is updated correctly

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.