Forum Discussion
Azure PostgreSQL Connection using On-Premise Data Gateway Cross Tenant
I need help setting up a connection between a Power BI report published in Power BI Service under Tenant A and an Azure Database for PostgreSQL under Tenant B.
I have an On-premises Data Gateway installed on a virtual machine (VM), and the VM has already been whitelisted to connect to the Azure Database for PostgreSQL instance. I can see the data gateway in Power BI Service; however, I’m unable to successfully configure the connection using either the Azure Database for PostgreSQL connector or the PostgreSQL connector.
What is the proper way to set up this connection?
Hi power_fabric,
Thanks for the additional details. and thanks to PauReis for sharing valuable insights.Since you’ve confirmed that the certificates are already installed in Trusted Root Certification Authorities under the Local Machine store, the next step would be to verify the TLS connection and certificate chain from the gateway machine.
Microsoft’s PostgreSQL troubleshooting guidance recommends using OpenSSL to inspect the TLS connection and certificates presented by the server. From the gateway machine, you can run:
openssl s_client -starttls postgres -showcerts -connect <your-postgresql-server-name>:5432
This can help verify the TLS version, cipher, and certificate chain presented by the PostgreSQL server.
Since the required root certificates are already present, I would focus on the certificate chain presented by the PostgreSQL server and the TLS connection from the gateway machine rather than reinstalling the certificates.
For more details, please refer to the below official Microsoft documentation:
Set up your PostgreSQL database connection - Microsoft Fabric | Microsoft LearnI hope this helps. Please feel free to reach out if you have any further questions.
Thank you.
19 Replies
- GeraldGEmerick
Memorable Member
power_fabric For authentication, the straightforward option is Database/Basic authentication using a PostgreSQL username/password. Microsoft's current Azure PostgreSQL/Power BI guidance uses database authentication and specifically notes that Windows authentication isn't supported for Azure Database for PostgreSQL Flexible Server.
- power_fabricRegular Visitor
Thank you for your response, but I am setting up the connection in the PowerBi Service so I can enable the refresh schedule. I tried the basic authentication but it's not working.
- PauReis
Resolver III
Hi power_fabric,
I'd park the cross-tenant part for a second, because I don't think it's what's blocking you. The gateway sits on your VM and reaches the database over the network using database credentials, so Tenant B doesn't really come into it. Where cross-tenant does bite is if you pick Microsoft account (Entra ID) as the auth type, so Basic with a PostgreSQL username and password is the right call.
Two things on the gateway machine catch this exact setup, and neither gives a useful error.
First, the Npgsql provider. The gateway only started shipping it recently: "Since the June 2025 release, the on-premises data gateway includes the Npgsql provider, so no extra installation is needed." If that VM's gateway predates it, you install Npgsql 4.0.17 yourself, and you have to tick Npgsql GAC Installation or it won't register. 4.1 and above isn't supported. Check the gateway build first, it takes seconds and it's the usual reason the connector just won't configure.
Second, SSL. Azure Database for PostgreSQL wants an encrypted connection, and the dialog has a Use Encrypted Connection checkbox. If that's on and the gateway VM doesn't trust the server's certificate, it fails there. The machine may need the server's SSL certificate in its Trusted Root Certification Authorities, and for scheduled refresh that machine is the gateway VM, not your laptop.
Last one to rule out: the server name on the gateway data source has to match the published file exactly. Short name one side and FQDN the other, and the gateway never gets offered at all.
What build is the gateway on, and what does it say when you hit Create?
- v-abhinavmu
Community Support
Hi power_fabric,
May I check if this issue has been resolved? If not, Please feel free to contact us if you have any further questions.
Thank you
- power_fabricRegular Visitor
Hi v-abhinavmu,
Apologies for late revert, I haven't resolved this issue.
I'll step back a little. In terms of my ODBC DSN set-up, when I select the SSLmode "verify-ca" the connection works both in the PowerBI Desktop and Data gateway. I combined the 2 required root CAs and save it AppData\Roaming\postgresql\root.crt. But when I change the SSLmode to "verify-full" then I encountered error:
connection to server at "10.XX.XXX.XXX", port 5432 failed: server certificate for "server-name.postgres.database.azure.com" (and 4 other names" does not match host name "10.XX.XXX.XXX"
Then I tries to used the FQDN instead of the IP adress, but the error sows: "No such host is known".
Also in the PowerBI Desktop installed in the same machine server I tried connecting to the PostgeSQL database/Azure Database for PostgreSQL. I tried using the IP address and the error shows "The remote certificate is invalid according to the validation procedure". I also tries the FQDN but the error shows "No such host is known".- v-abhinavmu
Community Support
Hi power_fabric,
Thank you for the additional details.The verify-full result provides an important clue. Microsoft documentation states that sslmode=verify-full verifies the server certificate and validates that the server certificate uses the same host name as the connection.
Microsoft also recommends using the fully qualified domain name (FQDN) as the host name when connecting to Azure Database for PostgreSQL, rather than using an IP address.
In your case, the certificate is for "server-name.postgres.database.azure.com", while the connection using the IP address reports that the certificate name does not match the host name. Since using the FQDN currently returns "No such host is known", I would recommend first verifying that the PostgreSQL FQDN resolves correctly from the gateway VM.
Once the FQDN is resolving correctly, please retry the connection using the FQDN rather than the IP address.
For more details, please refer to the below Official Microsoft Documentation:
Configure TLS Connection in Azure Database for PostgreSQL Flexible Server - Azure Database for PostgreSQL | Microsoft Learn
Troubleshoot TLS Connection Failures in Azure Database for PostgreSQL Flexible Server - Azure Database for PostgreSQL | Microsoft Learn
Networking with Public Access (Allowed IP Addresses) in Azure Database for PostgreSQL Flexible Server - Azure Database for PostgreSQL | Microsoft Learn
Add or remove a gateway data source - Power BI | Microsoft LearnI hope this helps narrow down the issue.
Thank you.