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
atpbi10
Helper I
Helper I

Self signed cerificate API powerbi power query

Hey I'm trying to retrieve the data from API which is hosted on azure VM with self signed certificate, using this code:

 

let
url = "https://***WEBSITEURL***/api/",
source_url = "***WEBSITEURL***/api/v2",
body = "{
""username"": ""***"",
""password"": ""****""
}",
Response = Json.Document(Web.Contents(url, [Headers = [#"Content-Type"="application/json"], Content = Text.ToBinary(body)])),
Source = Json.Document(Web.Contents(source_url, [Headers = [Authorization="Bearer "&Response[access]]])),
results = Source[results],

 

However Im getting the following error:

DataSource.Error: The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel.
Details:
https://***WEBSITEURL***/api/

 

What should I change in PowerBI to allow accessing such APIs that does have self signed certificates?

4 REPLIES 4
Gabriele_hbto
Helper II
Helper II

Hey buddy did you found a solution to that error?

v-yingjl
Community Support
Community Support

Hi @atpbi10 ,

Sorry for replying late. You can try this:

 

Clear the Secure Sockets Layer (SSL) state. To do this, follow these steps:

  1. In Internet Explorer, click Tools, and then click Internet Options.
  2. Click the Content tab, and then click Clear SSL state.

 

You can also refer these articles:

  1. Could not establish trust relationship for the SSL/TLS Secure Channel – Invoke-WebRequest 
  2. Power Query Sign in, Certificates and Troubleshooting 

 

Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

This did not work. Do you think maybe that changing https configuration on Azure VM on which the api is deployed on might help?

Hi @atpbi10 ,

Perhaps you could take a try and check it.

 

Best Regards,
Community Support Team _ Yingjie Li
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.