Forum Discussion
Unable to connect MS Fabric and Azure database for Postgres using copy activity
- 9 months ago
Hi All,
Thanks for your support , the issue has now been resolved. With the same tech stack, the on-premises data gateway works as expected.
Below is the additional action required:
Microsoft Fabric currently does not support mutual TLS (mTLS) when connecting to PostgreSQL. It only supports standard TLS with username/password authentication and cannot present the client certificate and key required by our mTLS-enabled PgBouncer endpoint. Due to this limitation, Fabric fails during the handshake phase, resulting in the error observed.
To enable Fabric connectivity while preserving our existing security posture, we will proceed with Alternative 1 from our internal analysis:
✅Planned Approach
We will relax mTLS enforcement only for Fabric by setting up a dedicated PgBouncer listener/pool that:does not require client certificates,
is accessible from Fabric’s data gateway public IP range, and IP address of on prem data gateway.
retains full mTLS enforcement for all other traffic.This approach allows us to maintain strong security controls while ensuring Fabric can connect successfully.
hi Kash10,
Possible Solutions / Workarounds
- In Fabric, create a Managed Private Endpoint to your Azure PostgreSQL instance.
- This requires:
- Your PostgreSQL server to be in a VNet (via Private Link).
- Fabric workspace to have Managed VNet enabled.
- This way, traffic flows through the private network, avoiding firewall IP whitelisting issues.
- https://learn.microsoft.com/fabric/data-factory/managed-private-endpoints
Option 2: Use On-Premises Data Gateway (Correct Configuration)
Ensure the gateway is installed on a machine that can reach Azure PostgreSQL.
- In the Copy Activity:
- Select Gateway connection explicitly.
- Verify that the gateway is online and mapped to the PostgreSQL connector.
- Whitelist the public IP of the gateway machine in the PostgreSQL firewall.
- Check that SSL is enabled in the connection string (PostgreSQL requires SSL by default).
Hi Zanqueta,
Regarding option 2, I have already covered all the steps listed, however as soon as I select the on prem data gateway from the drop down list, I get the error "3 arguments were passed to a function that expects 2"
- Zanqueta10 months ago
Super User
Thanks for you feedback Kash10,
In your Power BI Desktop it was working? Are you using parameters or get the string directly?This typically occurs due to the way parameters are passed when selecting the gateway.Please, look at this when creating the connection in Fabric:- Only specify:
- Server: servername.postgres.database.azure.com
- Database
- Authentication: username@servername and password
- Enable SSL, as this is mandatory for Azure PostgreSQL.
If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.
Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.
- Kash1010 months agoRegular Visitor
Hi Zanqueta,
I am trying to connect through data factory, haven't tried through Power BI Desktop as my requirement is more from a data engineering perspective. I have used the connection strings directly as you have mentioned, still it's not connecting.
- v-sgandrathi10 months ago
Community Support
Hi Kash10,
It appears that the main issue is Fabric Data Factory’s inability to connect to Azure PostgreSQL because the connection is routed through the public network, and Fabric doesn’t provide fixed outbound IPs. As a result, whitelisting the gateway machine’s IP isn’t a reliable solution. The recommended approach is to enable Managed VNet in your Fabric workspace and set up a Managed Private Endpoint to your Azure PostgreSQL instance (which should have Private Link enabled). This configuration allows for private network communication, avoiding IP-based firewall issues. If you choose to use the on-premises data gateway, make sure it’s updated, properly mapped to the PostgreSQL connector, and that SSL and the correct credentials (username@servername) are used.
Thank you.
- Only specify: