Search code examples
azureazure-functionsazure-database-postgresql

Connecting to an Azure Database for PostgreSQL flexible server from an Azure Function serverless


I have an Azure Function that connects to an Azure Database for PostgreSQL flexible server, but I am getting a timeout (while from my local I can do it without any problem). After some research, I found out that the pricing tier of the Function App's plan is set to Consumption, and I cannot modify outbound traffic without upgrading it. Is there any way to be able to connect without upgrading? I think it is too expensive just for a single function that is triggered once a day on average... Also important: the network connectivity for the database is set to Private access (VNet Integration).

Thanks in advance!


Solution

  • No, if you do need VNET integration for azure functions you cannot use the consumption plan. It is an annoying downside. Requests for support of VNET is open since 2018, see this issue.

    The alternatives are upgrading to a premium plan or host the function on an Azure App Service plan that supports VNET integration.