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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Dres
New Member

Can't update dataset parameter programmatically

Hi, 


we're using the C# SDK (Microsoft.PowerBI.Api.V2)  to automate the process of creating new workspaces with a single dataset/report by cloning an existing one (kind of like a template). The datasource is a web endpoint, and it uses a paramter which needs to be upated for the new dataset.  Unfortunately that last step returns a forbiden error (operation is only supported for the dataset owner), which makes no sense because the operation is being run under the same account that creates the dataset to begin with.  Here are the steps we're taking

 

  1. Create a new instance of the  PowerBIClient class using the app registration accoutn details (works)
  2. Create a new workspace (works)
  3. Get the template dataset and "clone it" into the new workspace. This is done by reading the file and using the  PostImportWithFileAsyncInGroup function (works)
  4. Ge the new dataset's name (works)
  5. Use the UpdateParametersAsync function to update the paramter so it points to a different datasource (fails, forbbiden error)

 

var paramRequest = new UpdateDatasetParametersRequest(new UpdateDatasetParameterDetails("paramName", "paramValue"));
await client.Datasets.UpdateParametersAsync(group.Id, newDataset.Name, paramRequest);

 


Not sure if I'm missing something obvious, but it makes little sense that the account that's creating the dataset in the firstplace, can't update the parameter because of permissions.   If I navigate to the PowerBI App and check the new dataset access, it show the app registration as the owner.  If I check the dataset settings, some of the options (including the parameters section) are disabled because "This dataset has been configured by AppRegistrationName (App ID: 00000-0000-0000-0000-00000000). Would you like to take over the settings?" 

 

That's a clear indication that the app registration account is indeed the owner of that dataset, which also happens to be the account that runs the whole process, so why would I get a forbidden error??

 

Any help would be greatly appreciated

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

A couple weeks back there was a fantastic Power BI Dev Camp that talked about this in great depth. 

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

A couple weeks back there was a fantastic Power BI Dev Camp that talked about this in great depth. 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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