you can connect Power BI Service to an Azure PostgreSQL for Flexible Server via a VNet Data Gateway.
You can review the following links
Summary as follows
Set up a VNet and VNet Data Gateway:
- Create a virtual network (VNet) in Azure that will be used to host your Azure PostgreSQL for Flexible Server and the VNet Data Gateway.
- Set up a VNet Data Gateway in the virtual network. This will act as a bridge between your Azure PostgreSQL server and the Power BI Service.
Configure the VNet integration for Azure PostgreSQL for Flexible Server:
- In the Azure portal, navigate to your Azure PostgreSQL for Flexible Server.
- Under the "Settings" section, click on "Networking".
- Enable the "VNet service endpoint" option and select your virtual network and subnet.
- Save the changes.
Install and configure the VNet Data Gateway:
- Install the VNet Data Gateway on a machine within your virtual network. Follow the official documentation for detailed installation steps.
- Configure the gateway with the appropriate settings, including the virtual network information.
Connect Power BI Service to Azure PostgreSQL:
- In Power BI Service, go to the workspace or report where you want to connect to Azure PostgreSQL.
- Click on "Get Data" and search for "Azure Database for PostgreSQL".
- Select the "Azure Database for PostgreSQL" connector and click on "Connect".
- Enter the server name and database credentials for your Azure PostgreSQL for Flexible Server.
- Choose the "Connect via On-premises Gateway" option and select the VNet Data Gateway you configured.
- Click on "Connect" to establish the connection.