Hi @Suraj Shashidhar
Thank you for posting your query!
The login timeout error usually indicates that your Kubernetes pod cannot establish a connection to the Synapse Serverless SQL pool. Since your local machine works but Kubernetes fails, the issue is likely related to network configuration or authentication.
Network Configuration - Ensure that your Synapse serverless SQL pool's firewall settings allow connections from the IP addresses of your Kubernetes nodes. Double-check that these IPs are added correctly. Ensure your Kubernetes cluster can initiate outbound connections to the internet, as Azure Synapse is a cloud service.
DNS Resolution - Although you've mentioned that nslookup
resolves correctly, ensure that there are no intermittent DNS issues.
Authentication Issues - Ensure that the authentication method (ActiveDirectoryPassword
) is correctly configured and supported. Double-check the username and password. If you're using Azure Active Directory (AAD) for authentication, make sure that the Kubernetes environment has access to the necessary AAD endpoints and that the credentials have the correct permissions.
ODBC Driver and TLS - Ensure that you're using the correct version of the ODBC driver that supports Azure Synapse. Although you have TrustServerCertificate=yes
, ensure there are no SSL/TLS handshake issues. You might need to configure the certificate settings more explicitly.
Kubernetes Environment - Network Policies: If you're using network policies within your Kubernetes cluster, ensure that the pods running your application have the necessary permissions to initiate outbound connections. Ensure there are no security policies that might block the connection.
Similar issues: https://techcommunity.microsoft.com/blog/azuredbsupport/lesson-learned-258-python-vs-connection-refused-with-login-timeout-expired/3703542
Reference: https://learn.microsoft.com/en-us/azure/azure-sql/database/connectivity-architecture?view=azuresql
I hope this information helps.
Kindly consider upvoting the comment if the information provided is helpful. This can assist other community members in resolving similar issues.