Search code examples
azureazure-functionsazure-vpn

How do you connect an Azure Function (not an App Service) to an on-premise SQL server via a VPN?


I have a large SQL server hosted in our infrastructure, and an Azure resource set up with VPN access to our servers.

I want to create an Azure Function that connects to this SQL server. It's going to be a webhook endpoint to save to that DB. I don't need the overhead of an App Service Plan, I want the lightweight Function and the cheaper consumption pricing model.

All the tutorials online refer to App Services and Hybrid Connections that don't appear to be available in to Azure Functions on Consumption Plans.

I also want to keep the connection string configuration in Azure, and not hard-coded in the source or publish (which will ultimately be via CI).

The Azure Function is currently coded in C# in VS2019, but I can change that if it helps.

How do I set this up?


Solution

  • This option is not available on consumption plan. There is a already user voice open for this.

    https://feedback.azure.com/forums/355860-azure-functions/suggestions/33398398-add-support-for-hybrid-connections-to-consumption

    enter image description here