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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to edit datasource credentials of imported PBIX file - Power BI API?

I have problem with credentials of datasource. I use .NET library PowerBI.API, I´m importing PBIX file, which has connection to Excel file. I have installed On-Premises Data Gateway. When file is imported, I can´t refresh dataset because the credentials are invalid.

 

img1.PNG

 

When I click on Edit credentials, it show this.

 

img2.PNG

 

I click on Sign in and refreshing works fine. But I need make it by API. I tried many ways, but nothing works.

 

I will be happy for any advice.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your screenshot, I know that you are using Personal Gateway. As far as I know, Power BI doesn't support us to configure data source credential for Personal Gateway by Rest API. I think use "Edit Credential" option in Power BI Service should be the best workaround to update the credential. 

Or you can download Standard om-premise data gateway  .

Standard on-premise data gateway has many differences with Personal Gateway.

For reference:On-premises data gateway vs. on-premises data gateway (personal mode)

1.png

After you download standard on-premises data gateway, you can try to create data source or update data source credential by Power BI Rest API.

For reference:Power BI Rest API - Gateways

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your screenshot, I know that you are using Personal Gateway. As far as I know, Power BI doesn't support us to configure data source credential for Personal Gateway by Rest API. I think use "Edit Credential" option in Power BI Service should be the best workaround to update the credential. 

Or you can download Standard om-premise data gateway  .

Standard on-premise data gateway has many differences with Personal Gateway.

For reference:On-premises data gateway vs. on-premises data gateway (personal mode)

1.png

After you download standard on-premises data gateway, you can try to create data source or update data source credential by Power BI Rest API.

For reference:Power BI Rest API - Gateways

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hariharan_R
Solution Sage
Solution Sage

Hi - if you want to use gateway then you need to configure the excel datasource in gateway and then you can map it in Power BI dataset settings. You dont need to configure the credentials for each dataset. Configure it on Power BI data gateway data source.

 

Use your windows authentication option.

 

Thanks

Hari

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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