Forum Discussion

Shivakumarh's avatar
Shivakumarh
Icon for Helper I rankHelper I
11 months ago
Solved

Unable to connect to SQL server in Power bi desktop

While connecting i am getting the below error message:-

We encountered an error while trying to connect.
Details: "Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

 

  • Hi Shivakumarh ,

     

    we need more information on this to help you further.can you follow below checklist and see if it works?

    • Use Azure Synapse Analytics connector
      Get Data > Azure > Azure Synapse Analytics
    • Enter correct server name
      yourworkspace.sql.azuresynapse.net (for dedicated pool)
      yourworkspace-ondemand.sql.azuresynapse.net (for serverless pool)
    • Choose authentication method
      - Azure Active Directory - Organizational Account
      - Basic (SQL username/password)
      - Windows (if domain-joined)
    • Clear cached credentials
      File > Options and settings > Data source settings > Clear Permissions
    • Test port connectivity.try below command in power shell.
    Test-NetConnection -ComputerName yourworkspace.sql.azuresynapse.net -Port 1433

     

    • Test-NetConnection -ComputerName yourworkspace.sql.azuresynapse.net -Port 1433
      - Ping server to verify DNS resolution try below command in command prompt.
    ping yourworkspace.sql.azuresynapse.net
    • Check Synapse firewall settings
      Enable public network access
      Add your client IP to allowed list
      Enable “Allow Azure services to access this workspace”
    • Try Azure Data Studio for connection test
    • Download Azure Data Studio
    • Use .pbids file to force correct connector
      Create .pbids with server and connector settings
    • Verify workspace type and database context
    • Check for private endpoint configuration
      - Ensure you're on same VNet or using VPN
      - Configure private DNS zone if needed
    • Inspect Conditional Access Policies
      Confirm AAD policies aren’t blocking Power BI Desktop
    • Monitor Synapse logs for failed login attempts
      Use Azure Monitor or Diagnostic Settings in Synapse workspace

    Please give kudos or mark it as solution if it helps.

     

    Thanks and Regards,

    Praful

11 Replies

  • Hey, Shivakumarh ,

    can be a lot of things, but most likely your device does not have access to the server you entered, or you misspelt the server name. It can happen, for example, if you're connecting to an On-premise server, while you don't have an active VPN, for example. Or if you're on virtual machine, that virtual machine doesn't have direct access allowerd to the server.

    • danextian's avatar
      danextian
      Icon for Super User rankSuper User

      This is very common scenario. Just because one has the address and the credentials doesn't mean the server would allow connection to it. My company's are in the cloud and even with the correct credentials I can't just connect directly.

  • v-sgandrathi's avatar
    v-sgandrathi
    Icon for Community Support rankCommunity Support

    Hi Shivakumarh,

    Thank you danextian  vojtechsima for your response to the query.

    Just wanted to follow up and confirm that everything has been going well on this. Please let me know if there’s anything from our end.
    Please feel free to reach out Microsoft fabric community forum.

  • v-sgandrathi's avatar
    v-sgandrathi
    Icon for Community Support rankCommunity Support

    Hi Shivakumarh,

     

    Just looping back one last time to check if everything's good on your end. Let me know if you need any final support happy to assist if anything’s still open.

     

    Thankyou.

    • Shivakumarh's avatar
      Shivakumarh
      Icon for Helper I rankHelper I

      I am connecting to Azure SQL DB which is in Cloud, and i am try to that same DB in Power BI Desktop and I am getting the below error message.

      Details: "Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)"

  • while connecting to Azure Synapse SQL in power bi i am getting the below error:  v-sgandrathi  Still i am facing the same issue
    Details: "Microsoft SQL: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server.

     

    i dont have SSMS in my machine to verfiy the cerdentials are correct or not and i dont know how i need resolve this issue

  • v-sgandrathi's avatar
    v-sgandrathi
    Icon for Community Support rankCommunity Support

    Hi Shivakumarh,

     

    Thank you for clarifying. From your description, it appears that the connection problem with Azure Synapse SQL in Power BI Desktop is likely due to network or firewall settings rather than an issue with credentials. The error “Named Pipes Provider, error: 40 – Could not open a connection to SQL Server” typically indicates Power BI cannot reach the Synapse endpoint over the network.

    To address this, first check that you’re connecting through the right method in Power BI: go to Home > Get Data > Azure > Azure Synapse Analytics (SQL), and enter the fully qualified server name (like yourworkspace.sql.azuresynapse.net) in the Server field, without “https://” or any database name. Enter your database name if needed, select Import or DirectQuery, and choose the correct authentication method for your setup.

    Next, confirm your network can reach the Synapse endpoint. You can use this PowerShell command to test connectivity: Test-NetConnection yourworkspace.sql.azuresynapse.net -Port 1433. If it fails, outbound traffic on port 1433 may be blocked by your firewall or VPN. Contact your network administrator or disconnect from the VPN to test again.

    Also, review your Azure Synapse firewall settings in the Azure portal. Add your current client IP address under Networking > Firewall rules and save the changes. If you’re using a private endpoint, ensure your machine can access it.

    If you need to check your credentials, use Azure Synapse Studio (web) or the Query editor in the Azure portal to connect and run a simple query like SELECT 1;. If that works, your credentials are fine and the issue is with network access.

    Once you’ve followed these steps, try connecting again from Power BI Desktop.

    Thank you.

  • v-sgandrathi's avatar
    v-sgandrathi
    Icon for Community Support rankCommunity Support

    Hi Shivakumarh,

     

    Just wanted to follow up and confirm that everything has been going well on this. Please let me know if there’s anything from our end.
    Please feel free to reach out Microsoft fabric community forum.

     

    Thank you.

    • Shivakumarh's avatar
      Shivakumarh
      Icon for Helper I rankHelper I

      v-sgandrathi  Still i am facing the same issue ,all the out bound connections are open i have checked with my Network team but still i am not able to create connection with Azure synampse SQL server in powerbi 

      • Praful_Potphode's avatar
        Praful_Potphode
        Icon for Super User rankSuper User

        Hi Shivakumarh ,

         

        we need more information on this to help you further.can you follow below checklist and see if it works?

        • Use Azure Synapse Analytics connector
          Get Data > Azure > Azure Synapse Analytics
        • Enter correct server name
          yourworkspace.sql.azuresynapse.net (for dedicated pool)
          yourworkspace-ondemand.sql.azuresynapse.net (for serverless pool)
        • Choose authentication method
          - Azure Active Directory - Organizational Account
          - Basic (SQL username/password)
          - Windows (if domain-joined)
        • Clear cached credentials
          File > Options and settings > Data source settings > Clear Permissions
        • Test port connectivity.try below command in power shell.
        Test-NetConnection -ComputerName yourworkspace.sql.azuresynapse.net -Port 1433

         

        • Test-NetConnection -ComputerName yourworkspace.sql.azuresynapse.net -Port 1433
          - Ping server to verify DNS resolution try below command in command prompt.
        ping yourworkspace.sql.azuresynapse.net
        • Check Synapse firewall settings
          Enable public network access
          Add your client IP to allowed list
          Enable “Allow Azure services to access this workspace”
        • Try Azure Data Studio for connection test
        • Download Azure Data Studio
        • Use .pbids file to force correct connector
          Create .pbids with server and connector settings
        • Verify workspace type and database context
        • Check for private endpoint configuration
          - Ensure you're on same VNet or using VPN
          - Configure private DNS zone if needed
        • Inspect Conditional Access Policies
          Confirm AAD policies aren’t blocking Power BI Desktop
        • Monitor Synapse logs for failed login attempts
          Use Azure Monitor or Diagnostic Settings in Synapse workspace

        Please give kudos or mark it as solution if it helps.

         

        Thanks and Regards,

        Praful

  • v-sgandrathi's avatar
    v-sgandrathi
    Icon for Community Support rankCommunity Support

    Hi Shivakumarh,

     

    Thank you Praful_Potphode for your answer to the query.


    If the response provided by the community member addressed your query, could you please confirm? It helps us ensure that the solutions provided are effective and beneficial for everyone. 

    Thank you for your understanding!