Forum Discussion

benor1470's avatar
benor1470
Frequent Visitor
2 years ago

jdbc connector receives TCP/IP error against the warehouse

Hi, after successfully connection using oauth flow and reciveing a token for scope 
https://analysis.windows.net/powerbi/api/Warehouse.ReadWrite.All

using my access code I can get a refresh code and using that refresh code I can get multiple access codes so that session is working fine and the code is also working to connect to snowflake using azure so I don't think the error is on that side
once I use the same connection for I get 
"The TCP/IP connection to the host pbipwus9-westus.pbidedicated.windows.net\<some id> (redirected from <same some id>.datawarehouse.fabric.microsoft.com), port 1433 has failed. Error: "null. Verify the connection properties. Make sure that an instance of SQL Server is running on the host and accepting TCP/IP connections at the port. Make sure that TCP connections to the port are not blocked by a firewall."."


the connection propertis are accessToken, encrypt=true trustServerCertificate=true
and connection string jdbc:sqlserver://<SQL connection string> taken from the UI 

the only guess I can find is that TCP/IP is turned off and we're using shared memory that is working for Sql Server but can't work for JDBC

11 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,benor1470 

    Regarding the issue you raised, my solution is as follows:
     

    1.First of all, there is the "check if TCP/IP is enabled" you mentioned: make sure that SQL Server is configured with the TCP/IP protocol and is listening on port 1433. You can verify this in SQL Server Configuration Manager as follows:

    2.Second, you can try using the telnet command to test the connection:

    What you may want to note is that you need to turn on the following settings in advance:

    Here is a screenshot of the official document:

     

     

     

    Troubleshooting connectivity - JDBC Driver for SQL Server | Microsoft Learn

    3.Then, make sure your network configuration allows TCP/IP connections from the client to SQL Server. If you're using a VPN or proxy server, you may need to make configuration adjustments accordingly.

     

    4.Finally, make sure that the SQL Server instance is running and can accept external connections. You can check the status of your instance through SQL Server Management Studio (SSMS).


    Of course, if you have any new ideas, you are welcome to contact us.
     

    Best Regards,

    Leroy Lu

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


     

    • benor1470's avatar
      benor1470
      Frequent Visitor

      Thank you but non of those helped
      1) first since it's a fabric database I can't access it's config to change TCP/IP config

      as far as I can see this tool can only be used to make local connections

      2/3) I can telnet to the public address, the issue isn't with the network connection on my side
      4) I managed to connect using SSMS

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi, benor1470 

        Regarding the issue you raised, my solution is as follows:

        1.First of all, I observed that the database you checked is from warehouse, but the error message is from SQL server, so we want you to check if the data source that warehouse is connected to has this problem.
         

        2.Secondly, since the error is related to the port, we also hope that you can check whether your port is allowed or not, and the following documents hope to help you:
        Add Power BI URLs to allowlist - Microsoft Fabric | Microsoft Learn

         
        Of course, if you have any new ideas, you are welcome to contact us.
         

        Best Regards,

        Leroy Lu

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

  • anyone knows? is this thing supported? am I asking in the right place?

  • benor1470's avatar
    benor1470
    Frequent Visitor

    Hi, upgraded msal4j as I saw you had a new version and now the error is different
    "Login failed due to invalid authentication methods."

    not sure if it's because of the upgrade and I can't find any resources about this error message
    maybe it's because of the scope, I tried
    https://analysis.windows.net/powerbi/api/Warehouse.ReadWrite.All
    https://analysis.windows.net/powerbi/api/Connection.Read.All
    https://sql.azuresynapse-dogfood.net/user_impersonation
    but non of them works, is there a different scope I should be using?