I have a source SQL Server database installed in the Azure VM instance, and I wanted to sync the data to the Bigquery. I have chosen Apache Airflow to create a DAG to do this job. The source system can only be connected via the VPN network.
I connected my local system to the network and used Python Package pymssql to query the database. I was able to connect to it and execute queries. I have developed a DAG pipeline and tested it in my local environment. Now I wanted to deploy that DAG pipeline in the GCP composer environment.
Before creating a composer environment, I have successfully created a VPC network between GCP to Azure. And to confirm the connection is successful I created a VM instance and did telnet to the database IP to make sure we're able to ping the database server. From the VM instance, we were able to ping the database server. But when creating a composer environment in the same network and deploy the DAG code, it throws the below error
Traceback (most recent call last):
File "/home/airflow/gcs/dags/source.py", line 201, in <module>
conn = pymssql.connect(server='x.x.x.x', user=<username>, password=<password>, database=<dbname>)
File "src/pymssql/_pymssql.pyx", line 652, in pymssql._pymssql.connect
pymssql._pymssql.OperationalError: (20009, b'DB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (x.x.x.x)\nNet-Lib error during Connection timed out (110)\nDB-Lib error message 20009, severity 9:\nUnable to connect: Adaptive Server is unavailable or does not exist (x.x.x.x)\nNet-Lib error during Connection timed out (110)\n')
The following is the libraries that is used
- pymssql == 2.2.2
Facing this error for the last couple of days. I know there should be an issue in network configuration but couldn't able to find out that error. Any help is appreciated. Thanks!