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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
BI-Nomad
Advocate I
Advocate I

Setting up Dataset Refresh for Web Sources (Admin APIs) using Service Principal not working

Hi,

I am trying to setup a dataset refresh for a Datasource which is connected to Power BI Admin APis and it is not functioning and giving error 400. Does anyone have any idea how i can get it up and running?

Background:

I want to setup a monitoring of the Power BI Tenant. I have gotten everything working in the Desktop app. I have succesffuly called all the APIS i need (Activities, WOrkspaces, Users) etc. Using powerquery i have already authorised the sources using client ID and Client secret. However when i deploy it to the Power BI service using service principal it isnt working for me.

2024-09-16 13_34_47-Window.png

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi,@BI-Nomad .I am glad to help you.

According to your description, you have a problem with status code 400 when using data source credentials validation with a service subject as a web data source.
Generally a problem with status code HTTP400 indicates that there is a problem with the request sent by the client and the server is unable to process it.
The possible problems are as follows:

1.Incorrect request format: The format of the request does not meet the requirements of the server. For example, necessary parameters are missing or parameters are not formatted correctly.
2.Invalid credentials: The authentication information provided (e.g., API key, token, etc.) is invalid or has expired.
3.Privilege issue: The requested operation requires higher privileges and the current user or service subject does not have sufficient privileges.
4.Resource does not exist: The requested resource does not exist on the server, either because of a URL error or because the resource has been deleted.
5.The request body is too large: the request body sent exceeds the size limit allowed by the server

Please focus on checking the parameter section of the service body settings to ensure that the necessary access privileges have been granted, that the correct setting buttons have been enabled on the service, and that the parameters of the service body have been filled in correctly.
You can refer to the following suggestions:


Log in to the power bi service to set the validation method for the report semantic model with data source  (select Service principal) I test with sharepoint datasorce(web)

 

These are the data you need to fill in:

Tenant ID:APP Directory (tenant) ID

Service principal ID: APP Object ID

Service principal key: Your app authentication key value

vjtianmsft_0-1726551791737.png

It is important to note that you need to get the token correctly before you can fill in this information.
 

vjtianmsft_1-1726551804155.png

Tenant ID:Green Area

Service principal ID:Red area

Service principal key:Pink area

vjtianmsft_2-1726551823897.png

 

Please double-check that your API permissions and other information configurations are set correctly (correct API permissions need to be configured)

 

vjtianmsft_4-1726551838652.png

You will need to contact your organization's administrator to see if the required permissions are turned on in your organization on the Power BI service

vjtianmsft_5-1726551854447.png

 

Please make sure that your organization has the necessary permissions turned on.
I also found some information on the subject that I hope will help you:

URL:
Embed Power BI content in an embedded analytics application with service principal and an applicatio...
HOW TO: Configure Service Principal for Microsoft Power BI (informatica.com)
Steps to Have a Service Principal Take Over a Dataset in Power BI When Using Data Gateways – SQLSwim...
Solved: How to configure service principal for a data sour... - Microsoft Fabric Community

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
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

1 REPLY 1
Anonymous
Not applicable

Hi,@BI-Nomad .I am glad to help you.

According to your description, you have a problem with status code 400 when using data source credentials validation with a service subject as a web data source.
Generally a problem with status code HTTP400 indicates that there is a problem with the request sent by the client and the server is unable to process it.
The possible problems are as follows:

1.Incorrect request format: The format of the request does not meet the requirements of the server. For example, necessary parameters are missing or parameters are not formatted correctly.
2.Invalid credentials: The authentication information provided (e.g., API key, token, etc.) is invalid or has expired.
3.Privilege issue: The requested operation requires higher privileges and the current user or service subject does not have sufficient privileges.
4.Resource does not exist: The requested resource does not exist on the server, either because of a URL error or because the resource has been deleted.
5.The request body is too large: the request body sent exceeds the size limit allowed by the server

Please focus on checking the parameter section of the service body settings to ensure that the necessary access privileges have been granted, that the correct setting buttons have been enabled on the service, and that the parameters of the service body have been filled in correctly.
You can refer to the following suggestions:


Log in to the power bi service to set the validation method for the report semantic model with data source  (select Service principal) I test with sharepoint datasorce(web)

 

These are the data you need to fill in:

Tenant ID:APP Directory (tenant) ID

Service principal ID: APP Object ID

Service principal key: Your app authentication key value

vjtianmsft_0-1726551791737.png

It is important to note that you need to get the token correctly before you can fill in this information.
 

vjtianmsft_1-1726551804155.png

Tenant ID:Green Area

Service principal ID:Red area

Service principal key:Pink area

vjtianmsft_2-1726551823897.png

 

Please double-check that your API permissions and other information configurations are set correctly (correct API permissions need to be configured)

 

vjtianmsft_4-1726551838652.png

You will need to contact your organization's administrator to see if the required permissions are turned on in your organization on the Power BI service

vjtianmsft_5-1726551854447.png

 

Please make sure that your organization has the necessary permissions turned on.
I also found some information on the subject that I hope will help you:

URL:
Embed Power BI content in an embedded analytics application with service principal and an applicatio...
HOW TO: Configure Service Principal for Microsoft Power BI (informatica.com)
Steps to Have a Service Principal Take Over a Dataset in Power BI When Using Data Gateways – SQLSwim...
Solved: How to configure service principal for a data sour... - Microsoft Fabric Community

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.