Forum Discussion

power_fabric's avatar
power_fabric
Regular Visitor
2 months ago
Solved

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?

19 Replies

  • 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.

    Import data from Azure Database for PostgreSQL flexible server in Power BI - Azure Database for PostgreSQL | Microsoft Learn

    • power_fabric's avatar
      power_fabric
      Regular 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's avatar
        PauReis
        Icon for Resolver III rankResolver 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's avatar
    v-abhinavmu
    Icon for Community Support rankCommunity 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