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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DiegoPiau
Frequent Visitor

Error to connect and refresh dynatrace rest API in PBI Report Server

Hi All,

Hope you're doing well.

 

I am facing a connection problem in dynatrace API with Power BI and I would like to know if you could help me or know anyone that could help me.

 

Just to explain, the code below is working normally in my desktop, I can connect and download the data from Dynatrace API and update the report that I have created.

= Json.Document(Web.Contents("https://gmon-payment.group.echonet/e/e594390f-33a0-4016-abba-41d8cc503dca/api/v2/metrics/query?metri...", [Headers=[Accept="application/json", Authorization=" Api-Token XxXXx.XxXxx"]]))

DiegoPiau_1-1710330620747.png
Below is a print with the connection permissions:

DiegoPiau_0-1710332630192.png

Type: Anonymous
Privacity: None

 

But when I publish it in our Report Server, the problem starts.

As the print below, the Authorization didn't save inside the connection string, because the API Token is configurated in the Headers.

I have tried many diferent ways to configure the personal Token inside the connection string but I got another error and couldn't connect to the API doing this.

The authentication should be Anonymous, but I don't know how can I solve this credential error.

I don't know if it needs to be a diferent authorization type, like Oauth2, or a token that isn't personal.

 

DiegoPiau_4-1710330788483.png

DiegoPiau_3-1710330713159.jpeg

As an alternative, once a week I open the report in my desktop, update manually and publish it updated to Report Server.

But it should be updated automatically.
I have searched during 2 weeks and didn't find any post or youtube video that could help me with this problem.

I would be glad if someone could help me to find a soluction.

Best Regards.

 

 

 

1 ACCEPTED SOLUTION

Hi @v-rongtiep-msft ,

 

Thank you for your answer.

I have searched for a way to embed the API Token within the Power Query M code again, as I have tried many diferent ways and nothing worked.

Finally I found a Dynatrace documentation explaining how to use the API Token inside the connection String.
The print below shows the configuration with HTTP Header that I was using to connect in the API:

DiegoPiau_0-1710424778378.png

Then I saw a tab to use Query Parameter embedding the Token inside the connection String, and finally I got the expected result and now I am able to refresh and connect in the rest API automatically in Report Server.
Below is the code that I used to solve my problem:

DiegoPiau_1-1710425062601.png

curl --request GET \
--url 'https://mySampleEnv.live.dynatrace.com/api/v1/config/clusterversion?api-token=abcdefjhij1234567890' \

 

Thank you, your answer helped me to focus on embed the Token and it solved my problem.
Best Regards!

View solution in original post

2 REPLIES 2
v-rongtiep-msft
Community Support
Community Support

Hi @DiegoPiau ,

When you run a report on the report server, the data source connections and credentials must use sufficient permissions to retrieve the data on the report server.

Verify that the credentials that you use are the correct credentials. For example, you might have permission to retrieve data from a Table or View, but not for a specific column. Or, you might not have sufficient permissions to run a stored procedure that populates a view.

Troubleshoot data retrieval issues with Reporting Services reports - SQL Server Reporting Services (...

Please ensure that the API token is embedded securely within the Power Query M code.

How to Get Your Question Answered Quickly - Microsoft Fabric Community

 

If it does not help, please provide more details.

 

Best Regards
Community Support Team _ Rongtie

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

Hi @v-rongtiep-msft ,

 

Thank you for your answer.

I have searched for a way to embed the API Token within the Power Query M code again, as I have tried many diferent ways and nothing worked.

Finally I found a Dynatrace documentation explaining how to use the API Token inside the connection String.
The print below shows the configuration with HTTP Header that I was using to connect in the API:

DiegoPiau_0-1710424778378.png

Then I saw a tab to use Query Parameter embedding the Token inside the connection String, and finally I got the expected result and now I am able to refresh and connect in the rest API automatically in Report Server.
Below is the code that I used to solve my problem:

DiegoPiau_1-1710425062601.png

curl --request GET \
--url 'https://mySampleEnv.live.dynatrace.com/api/v1/config/clusterversion?api-token=abcdefjhij1234567890' \

 

Thank you, your answer helped me to focus on embed the Token and it solved my problem.
Best Regards!

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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