Forum Discussion
Getting an error while importing data from SQL Server
Hi all, I'm getting the following error while importing data from a SQL Server.
DataSource.Error: Microsoft SQL: A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
Details:
DataSourceKind=SQL
DataSourcePath=****; ****
Message=A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
ErrorCode=-2146232060
Number=-2146893019
Class=20
State=0
ConnectionId=4017e5f5-aedd-452d-9f43-9b95282392df
Power BI can connect to your SQL Server, but the SSL certificate on the SQL Server is not trusted by your computer.
This happens when:
The SQL Server is using a self-signed certificate
The certificate expired
The certificate was issued by an authority your machine doesn’t trust
Your organization recently enabled encrypted connections
Please try following:
Open Power BI Desktop
Go to File → Options and settings → Data source settings
Select your SQL Server connection → Edit Permissions
Under Encryption, choose "Enable SQL Server certificate trust"
"Encrypt connection" OFF (depending on your Power BI version),This instantly fixes the problem for most users.
OR
Update SQL Server certificate (if you control the server)
If you manage SQL Server:
Open SQL Server Configuration Manager
Go to SQL Server Network Configuration → Protocols for MSSQLSERVER
Open Properties → Certificate tab
Install or bind a valid SSL certificate issued by:
Your company CA, or
A trusted CA (e.g., Microsoft, DigiCert)
Restart SQL Server.
Can you please share your Power BI version and whether your SQL Server uses a self-signed or company SSL certificate.
Please also try this:
Install the certificate on your local machine (client-side fix)
If the server uses a self-signed corporate certificate:
Export the certificate (.cer)
Install it in your machine:
Trusted Root Certification Authorities
Restart Power BI
This tells Windows that the certificate is safe.
Ask your IT / DBA
If you don’t manage SQL Server, share this message with your IT:
"Power BI is failing to connect because the SQL Server SSL certificate is not trusted.
Kindly confirm if encrypted connections are enabled and provide the trusted root certificate or disable ‘force encryption’ on SQL Server."Hi AdityaND
This is a common one. That error means the TLS/SSL certificate presented by the SQL Server isn’t trusted by the client (Power BI / gateway). The SQL driver opens a TCP connection fine, but during the SSL handshake Windows/.NET rejects the certificate chain. Error -2146893019 -> untrusted issuer / chain problem.
Try doing this:Install CA root & intermediates on client/gateway (Local Computer → Trusted Root CA).
Ensure SQL Server cert CN/SAN matches the server name you use.
Ensure SQL Server sends full chain; replace cert if needed.
Restart any services (SQL Server and gateway).
Test with Power BI Desktop; if using gateway, test from Power BI Service after gateway restart.
Only use TrustServerCertificate=true for testing; replace with proper trust ASAP.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Jaywant Thorat | MCT | Data Analytics Coach
Linkedin: https://www.linkedin.com/in/jaywantthorat/
5 Replies
- 123abcCommunity Champion
Power BI can connect to your SQL Server, but the SSL certificate on the SQL Server is not trusted by your computer.
This happens when:
The SQL Server is using a self-signed certificate
The certificate expired
The certificate was issued by an authority your machine doesn’t trust
Your organization recently enabled encrypted connections
Please try following:
Open Power BI Desktop
Go to File → Options and settings → Data source settings
Select your SQL Server connection → Edit Permissions
Under Encryption, choose "Enable SQL Server certificate trust"
"Encrypt connection" OFF (depending on your Power BI version),This instantly fixes the problem for most users.
OR
Update SQL Server certificate (if you control the server)
If you manage SQL Server:
Open SQL Server Configuration Manager
Go to SQL Server Network Configuration → Protocols for MSSQLSERVER
Open Properties → Certificate tab
Install or bind a valid SSL certificate issued by:
Your company CA, or
A trusted CA (e.g., Microsoft, DigiCert)
Restart SQL Server.
Can you please share your Power BI version and whether your SQL Server uses a self-signed or company SSL certificate.
- Jaywant-ThoratSuper User
Hi AdityaND
This is a common one. That error means the TLS/SSL certificate presented by the SQL Server isn’t trusted by the client (Power BI / gateway). The SQL driver opens a TCP connection fine, but during the SSL handshake Windows/.NET rejects the certificate chain. Error -2146893019 -> untrusted issuer / chain problem.
Try doing this:Install CA root & intermediates on client/gateway (Local Computer → Trusted Root CA).
Ensure SQL Server cert CN/SAN matches the server name you use.
Ensure SQL Server sends full chain; replace cert if needed.
Restart any services (SQL Server and gateway).
Test with Power BI Desktop; if using gateway, test from Power BI Service after gateway restart.
Only use TrustServerCertificate=true for testing; replace with proper trust ASAP.
Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!
Jaywant Thorat | MCT | Data Analytics Coach
Linkedin: https://www.linkedin.com/in/jaywantthorat/ - 123abcCommunity Champion
Please also try this:
Install the certificate on your local machine (client-side fix)
If the server uses a self-signed corporate certificate:
Export the certificate (.cer)
Install it in your machine:
Trusted Root Certification Authorities
Restart Power BI
This tells Windows that the certificate is safe.
Ask your IT / DBA
If you don’t manage SQL Server, share this message with your IT:
"Power BI is failing to connect because the SQL Server SSL certificate is not trusted.
Kindly confirm if encrypted connections are enabled and provide the trusted root certificate or disable ‘force encryption’ on SQL Server." - v-venuppuCommunity Support
Hi AdityaND ,
Thank you for reaching out to Microsoft Fabric Community.
Thank you Jaywant-Thorat 123abc for the prompt response.
I wanted to check if you had the opportunity to review the information provided and resolve the issue..?Please let us know if you need any further assistance.We are happy to help.
Thank you.