Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Dear All,
I would like to know if it is possible to enable automatic dashboard refresh when the data is connected through a Web API. Currently, I am using the Power BI Free Desktop Version, but I am considering upgrading to a Power BI Pro License. I would like to know if this upgrade is necessary to solve my problem. Your suggestions and recommendations would be greatly appreciated.
Problem Statement : When attempting to refresh the dashboard that retrieves data from a Web API (using Postman to generate authentication and bearer token, then importing it into Power BI through ODATA), the refresh option is not functioning. An error is displayed as (500): Internal Server Error. What steps can be taken to resolve this issue?
Additionally, during the process of continuously refreshing, I may encounter an error. However, at some point, the refresh button will finally work and my dashboard will be refreshed after approximately thirty minutes. It's worth mentioning that I am performing all of these actions within a Virtual Machine.
I urgently require a solution for the problem I am currently facing. It is of utmost importance that I obtain this solution in a timely manner.
Thank you for your assistance in advance.
Solved! Go to Solution.
Hi. You don't need pro license if you just want to build a report that automatically refreshes for yourself. You need licenses when you want to start collaborating or sharing with others.
Regarding the error it's not a Power Bi error. As you describe sometimes it work and other doesn't, the error 500 means that something went wrong at the server side (the api side). The API creater has created that exception of 500 when something is wrong. It might be the amount of data, it might be getting the data for odata or it can simple be that the api can't handle that amount of requests. Usually the api creators reserve the 500 error when they are not sure about the specific thing that went wrong. You can try different things regarding amount of records or if one of the tables has the issue, but it's not something you can fix even if you find the pattern. For example, you try different things and find out that when you ask for data from two years it fails, but one year works everytime. You can't change that, you can just adapt.
I hope that make sense
Happy to help!
Hi, @Arbind
First of all, you should set the API permissions correctly in Auzre AD and get the correct secret and client ID, which are necessary parameters to get the access token.
Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn
In the following document, the necessary parameters for requesting an access token are described and the meaning of each parameter is explained:
Understand the OAuth 2.0 authorization code flow in Azure AD - Microsoft Entra | Microsoft Learn
Error of invalid credentials You can try the following authorization URL:
Auth URL: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/organizations/oauth2/token
You can learn how to authorize the Power BI API in Azure AD through the following links:
How to Get Your Question Answered Quickly
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I would like to express my sincere gratitude for the tremendous support you have provided. I am pleased to inform you that the issue has been resolved successfully. I am truly grateful to the entire community for their invaluable assistance.
Hi. You don't need pro license if you just want to build a report that automatically refreshes for yourself. You need licenses when you want to start collaborating or sharing with others.
Regarding the error it's not a Power Bi error. As you describe sometimes it work and other doesn't, the error 500 means that something went wrong at the server side (the api side). The API creater has created that exception of 500 when something is wrong. It might be the amount of data, it might be getting the data for odata or it can simple be that the api can't handle that amount of requests. Usually the api creators reserve the 500 error when they are not sure about the specific thing that went wrong. You can try different things regarding amount of records or if one of the tables has the issue, but it's not something you can fix even if you find the pattern. For example, you try different things and find out that when you ask for data from two years it fails, but one year works everytime. You can't change that, you can just adapt.
I hope that make sense
Happy to help!
Thank you for your support, I really appreciate your response. I have a feeling that the problem may be on the API side. If possible, could you provide guidance? It would be very helpful for me. The amount of data is around 80-90 thousand or even more. As I mentioned, I am using Postman (WEB API) to retrieve data from the PSAOP Data Server. If you have any documents or procedures to help me overcome this issue, it would be greatly appreciated as it is urgent. This is considering the possibility of an issue with the API server.
Additionally i have this query
let
token_url = "https://localhost:8181/api/oauth2/token",
api_base_url = "https://localhost:8181/api",
qry_str = "/IplProofTests",
body="grant_type=password&username=GatewayService&password=PSAOP@Gateway_Service!",
Source = Json.Document(Web.Contents(token_url,
[
Headers = [#"Content-Type"="application/x-www-form-urlencoded"],
Content=Text.ToBinary(body)
]
)
),
token = Source[access_token],
data= Json.Document(Web.Contents(api_base_url&qry_str,
[
Headers = [
#"Authorization"="Bearer "&token,#"Content-Type"="application/json"]
]
)
)
in
data
If there are any suggestions or changes needed in the query to help me perform auto token refresh, I am willing to make those changes. Currently, the query is giving an error of invalid credentials.
Hi, @Arbind
First of all, you should set the API permissions correctly in Auzre AD and get the correct secret and client ID, which are necessary parameters to get the access token.
Power BI REST APIs for embedded analytics and automation - Power BI REST API | Microsoft Learn
In the following document, the necessary parameters for requesting an access token are described and the meaning of each parameter is explained:
Understand the OAuth 2.0 authorization code flow in Azure AD - Microsoft Entra | Microsoft Learn
Error of invalid credentials You can try the following authorization URL:
Auth URL: https://login.microsoftonline.com/organizations/oauth2/v2.0/authorize
Access Token URL: https://login.microsoftonline.com/organizations/oauth2/token
You can learn how to authorize the Power BI API in Azure AD through the following links:
How to Get Your Question Answered Quickly
Best Regards
Jianpeng Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.