Azure Data Factory - copy data from PostgreSQL on VM - postgresql

I am trying to pull data from Postgresql on Azure using Azure Data Factory but have no luck. Both ADF and VM are in the same Azure Vnet.
In my VM networking settings I allowed port 5432 inbound access from ADF to VirtualNetwork. Similar outbound vnet to vnet.
I also installed ODBC driver on VM and added it to firewall.
I installed also the selfhosted integration runtime on VM which connects to ADF.
When creating a new Linked Service on ADF I chose PostgreSQL as source.
Not able to establish connection though.
Tried different settings:
-IP and DNS as servername
-self hosted and auto resolve integration runtime
-public and private IP
-no encryption and encryption
-temporarily turned off firewall on vm to test
still no success.
What am I missing?
password and database names are correct.
The error message I am getting when testing connection:
Error code
9603
Details
ERROR [08001] [Microsoft][ODBC PostgreSQL Wire Protocol driver]Connection refused. Verify Host Name and Port Number.
ERROR [HY000] [Microsoft][ODBC PostgreSQL Wire Protocol driver]Can't connect to server on 'xx.xxx.xxx.xx'
I would appreciate it if anyone could help.
Thank you

I found the solution. I need to use the ODBC connector as a linked service on ADF, not the PostgreSQL connector. Bingo!

Related

Has someone connected a PostgreSQL DB hosted in GCloud with Microsoft SSMS?

I have a question, I do not know how to solve it yet. Perhaps someone here has faced a similar issue.
We have a PostgreSQL DB hosted on Gcloud. We usually use a cloud proxy to connect with the database. It usually works very well!! In a nutshell the proxy connect a port from local host, to the actual DB host.
However this time, we want to connect it with Microsoft SSMS. We have not find an option where we can connect Microsoft SSMS with a DB running locally (this means connecting to a database on a port in local host).
The ultimate goal is to connect the database with Power BI. So if someone know how to connect a PostgreSQL DB hosted in GCloud to power BI that would also be very helpful!!
We have followed this tutorial:
https://www.anibalum.com.ar/2020/06/creating-linked-server-with-postgres.html
However we get the following error:
The linked server has been created but failed a connection test. Do you want to keep the linked server?
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
Cannot initialize the data source object of OLE DB provider "MSDASQL" for linked server "PAPERFLOWDB".
OLE DB provider "MSDASQL" for linked server "PAPERFLOWDB" returned message "[Microsoft][ODBC Driver Manager] Invalid connection string attribute".
OLE DB provider "MSDASQL" for linked server "PAPERFLOWDB" returned message "[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified". (Microsoft SQL Server, Error: 7303)
We are using Microsoft SSMS v18.9.1

What could cause a connection to a Google Cloud SQL instance to fail even with the ip registered in the list of allowed addresses?

I am unable to connect to a Google Cloud SQL instance. I get the error: [MySQL] [ODBC 5.1 Driver] Can't connect to MySQL server on 'XX.XXX.XX.XXX' (10060)
The IP from which I try to connect is a fixed ip and is registered in the list of allowed IPs in the Cloud SQL instance.
The machine that needs to connect is a Windows server with Windows Server 2016 operating system and can connect to other instances of Google Cloud SQL. We only have problems connecting to this instance. Another detail of the error is that the ping performed on my Windows instance returns total loss in relation to the Cloud SQL instance IP. Finally, I can access the databases using my local internet or another server.
I will be very grateful if someone can give me a tip to identify the problem

Not able to connect to azure postgres db from azure data factory when SSL is enabled

I'm new to Azure Data factory and i'm trying to create data set that connects to azure postgres db where SSL is enabled, but i get the below error, any idea how to solve this error without disabling SSL on postgres.
when i try to add sslmode=Allow to connection parameters, i get this error
You need to select EncryptionMethod option in link service. As MSDN shows,
Update:
I haven't met your error. I can connect successfully via integration run time.
The following is my setting, you can have a try.
In Azure Database for PostgreSQL:
Link service:

Azure Data Factory Connect to AWS RDS PostgresSQL Via SSH

In the past I could successfully connect to an AWS RDS PostgresSQL database from Azure Data Factory that has been enabled with a public endpoint.
Recently we have a scenario where an SSH client is created on an bastion host on AWS EC2 Instance which then connects the PostgresSQL database.
So now we need to connect to this PostgresSQL instance from Azure Data Factory via SSH. It seems that the current driver (ODBC PostgreSQL Wire Protocol driver) in ADF only supports SSL, so is there another way to set up an SSH tunnel in Azure and connect via the tunnel to the SSH client in AWS.
So in short :
AZURE ADF ----> PostgresSQL Linked Service ---> SSH Tunnel ---> AWS EC2 SSH --> AWS RDS PostresSQL
Thanks in Advance ....
I dont think you can achieve this at this as it is not supported . I request you to go here and log this ask , so that the ask reaches to the right team .

Connection to postgres server on Azure fails when I use "sslmode=verify-full"

When I select "sslmode=verify-full" when connecting to my postgres server in Azure, the connection fails with the following error:
server certificate for "<region>.control.database.windows.net" (and 7 other names) does not match host name "<servername>.postgres.database.azure.com".
Is "sslmode=verify-full" not allowed for Azure Database for PostgreSQL service? How do I connect to my postgres server in Azure if I have a requirement to use "sslmode=verify-full"?
"sslmode=verify-full" is supported in Azure Database for PostgreSQL service, however there is a limitation in the current implementation of the service.
If you require using "sslmode=verify-full", please use the server naming convention <servername>.database.windows.net as your connection string host name instead of the preferred host naming convention <servername>.postgres.database.azure.com.
This limitation is expected to be removed in the future. Connections using other SSL modes should continue to use the preferred host naming convention <servername>.postgres.database.azure.com.
Please refer to How to Configure SSL for Postgres in Azure for more details.