Forum Discussion

BenT's avatar
BenT
Regular Visitor
9 days ago

LakeHouse SQL Endpoint connection disruptions

Hello,

Since a couple of weeks, we are constantly experiencing the connection issue to the SQL Endpoint our Lakehouses whenever we try to run the Python code on a local computer.
we always have to try to establish the connection to the SQL Endpoint by running a query in Fabric or trying to connect to another on-premisses database, before  being able to running any code (multiple times a day), but still the issue persist and we would have to do this multiple times for it to start working.

Are there any disruptions on the SQL Endpoint connections?

Regards,

Benjamin T

4 Replies

  • v-saisrao-msft's avatar
    v-saisrao-msft
    Icon for Community Support rankCommunity Support

    HI BenT​,
    Service Status for any ongoing service degradation. On the client side, verify that your Python connection uses the correct SQL connection string, a supported ODBC Driver (version 18 or later), and Microsoft Entra ID authentication. If you reuse connections, test with a fresh connection and capture the exact error message and timestamps when the failure occurs. If the issue persists, raise a Microsoft support request with these details to help determine whether the cause is service-side or client-side.
    Create a Fabric and Power BI Support Ticket - Power BI | Microsoft Learn
    Microsoft Fabric service status
    How to Connect - Microsoft Fabric | Microsoft Learn
    Lakehouse SQL analytics endpoint use cases - Microsoft Fabric | Microsoft Learn

    Thank you.

    • BenT's avatar
      BenT
      Regular Visitor

      Hi v-saisrao-msft​ ,

      Thanks a lot for your quick reply,

      Please find here below the error message we are getting each first time of the day we are connecting to the Lakehouse SQL Endpoint.
      And we need several tries for the connection to be finally established.

      OperationalError: (pyodbc.OperationalError) ('08001', '[08001] [Microsoft][ODBC Driver 18 for SQL Server]TCP Provider: The wait operation timed out.\r\n (258) (SQLDriverConnect); [08001] [Microsoft][ODBC Driver 18 for SQL Server]Login timeout expired (0); [08001] [Microsoft][ODBC Driver 18 for SQL Server]Invalid connection string attribute (0); [08001] [Microsoft][ODBC Driver 18 for SQL Server]A network-related or instance-specific error has occurred while establishing a connection to re7x5kzld6zuzphvdf5du7xmny-ygqk3pgpy33ephhybpupfqf33a.datawarehouse.fabric.microsoft.com,1433. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to allow remote connections. For more information see SQL Server Books Online. (258)')

      Best regards,
      Benjamin T

  • Hi BenT​,

    Your error is TCP Provider error 258 plus "Server is not found or not accessible". That means the TCP connection to port 1433 timed out before login even started, so I would look at the network path first, not the query or authentication.

    1. Firewall and proxy. Learn says the endpoint needs outbound TCP 1433 treated as MSSQL/TDS traffic, not HTTPS. It also says allowing only the endpoint FQDN is not enough, you need the Power BI and SQL service tags. A firewall or VPN that drops idle flows overnight would match your first-of-the-day pattern.
    2. Test the port. Next morning, before running Python, run Test-NetConnection <your-endpoint> -Port 1433 in PowerShell. If that fails too, it is network side.
    3. Retry with backoff. Learn recommends retries for these endpoints. Pass timeout=60 to pyodbc.connect and wrap it in a retry loop with increasing waits.
    4. "Invalid connection string attribute" means one keyword in your string is not recognized by Driver 18. Worth cleaning up, though it is probably not the cause.

    Docs: https://learn.microsoft.com/en-us/fabric/data-warehouse/connectivity

    If this helps, please mark it as the solution.

  • ShivekMaharaj's avatar
    ShivekMaharaj
    Icon for Community Champion rankCommunity Champion

    Hi BenT​,

    The additional error details make this look much more like an intermittent network connection problem than a Lakehouse query issue.

    Microsoft’s current Fabric URL allowlist guidance specifically requires outbound TCP 1433 access to the Fabric SQL endpoint domains, including *.pbidedicated.windows.net. Microsoft also documents *.datawarehouse.fabric.microsoft.com for SQL analytics endpoint traffic in relevant gateway scenarios.

    Since the failure occurs before the connection is established, I would test the endpoint from the same machine at the exact time the first connection fails:

    Test-NetConnection <your-sql-endpoint> -Port 1433

    and also check DNS resolution with nslookup.

    If either of those fails intermittently, I would involve the network/security team and check whether a corporate firewall, proxy, VPN, DNS filter, or SSL/network inspection layer is intermittently blocking or delaying the SQL connection.

    Microsoft’s SQL connectivity troubleshooting guidance also recommends using retry logic for transient connection failures. So for Python/pyodbc workloads I would definitely add retry with exponential backoff rather than relying on a single connection attempt.

    The fact that Fabric notebooks and pipelines can connect more reliably than your local Python process would also make me compare the network paths. The Fabric workload is connecting from Microsoft’s infrastructure, while the local Python process is traversing your corporate network.

    So I would first prove whether TCP 1433 and DNS resolution are stable from the affected machine. If they are, and the same endpoint still repeatedly returns error 258 only on the first connection of the day, then I would capture timestamps and raise a Fabric support case so Microsoft can correlate the attempts with service-side telemetry.

    AI-assisted drafting: AI was used to help structure and phrase this response. I reviewed and validated the technical content before posting.