Forum Discussion

AdityaND's avatar
AdityaND
New Member
8 months ago
Solved

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:

    1. Open Power BI Desktop

    2. Go to File → Options and settings → Data source settings

    3. Select your SQL Server connection → Edit Permissions

    4. 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:

    1. Open SQL Server Configuration Manager

    2. Go to SQL Server Network Configuration → Protocols for MSSQLSERVER

    3. Open Properties → Certificate tab

    4. 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:

    1. Export the certificate (.cer)

    2. Install it in your machine:

      • Trusted Root Certification Authorities

    3. 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

  • 123abc's avatar
    123abc
    Community 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:

    1. Open Power BI Desktop

    2. Go to File → Options and settings → Data source settings

    3. Select your SQL Server connection → Edit Permissions

    4. 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:

    1. Open SQL Server Configuration Manager

    2. Go to SQL Server Network Configuration → Protocols for MSSQLSERVER

    3. Open Properties → Certificate tab

    4. 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.

     

  • 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/ 

     

     

  • 123abc's avatar
    123abc
    Community Champion

    Please also try this:

    Install the certificate on your local machine (client-side fix)

    If the server uses a self-signed corporate certificate:

    1. Export the certificate (.cer)

    2. Install it in your machine:

      • Trusted Root Certification Authorities

    3. 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-venuppu's avatar
    v-venuppu
    Community 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.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi AdityaND ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.