Not able to connect to Snowflake hosted on AWS from my Azure Spring Apps application

118 Views Asked by At

I am encountering a connectivity issue while attempting to connect to Snowflake from my Azure Spring Apps application. The application fails to establish a connection, and the logs show the following exception stack trace:

java.sql.SQLException: Network error IOException: Connection refused: no further information HTTPSConnectionPool(host='balxxxx.xxxxxxx.snowflakecomputing.com', port=443): Max retries exceeded with url: /session/v1/login-request?request_id=s31d5e5a-62c8-4cfa-b97c-f78e6160f907&request_guid=1b427ccf-ed08-4184-ad2d-01c09d3ac441 (Caused by NewConnectionError('<snowflake.connector.vendored.urllib3.connection.HTTPSConnection object at 0x135b87910>: Failed to establish a new connection: [Errno 61] Connection refused'))
...
Caused by: java.net.ConnectException: Connection refused: no further information

I am using snowflake-jdbc version 3.14.4

I am stuck and not sure what exactly needs to be done in order to resolve this issue. is it because I am trying to connect across cloud providers from Azure to AWS?

I tried connecting it from my local but still getting the above error. I verified the public private keys, but it didn't help at all

1

There are 1 best solutions below

3
Ish Mahajan On

The error seems to be quite clear. your app probably does not have connectivity to Snowflake db (assuming public/private key pair configuration is done correctly). I would suggest to review Network Configuration as following:

  1. IP Allowlisting: Ensure the IP address of your Azure Spring Apps instance is allowed in Snowflake's network settings. This post and this post might be helpful
  2. Firewall Rules: Verify that firewall rules between Azure and Snowflake are configured correctly to allow inbound and outbound traffic on the necessary ports.
  3. Outbound Connectivity: Check for any restrictions on outbound connectivity from your Azure Spring Apps instance.

Also, your error seems very similar to one posted here : https://community.snowflake.com/s/article/Examples-of-Connectivity-Troubleshooting .try to follow the suggested steps and see if it helps.