Azure Function on Premium tier, pay only for time consumed, possible?

Guillermo Elía 1 Reputation point
2020-12-09T18:27:49.413+00:00

I have the following situation, I need to run ETL scripts at a given time, so I packaged the scripts inside a function and set it to be timer triggered for now. The thing is, they must reach my databases which are on an internal network, for this to be available, I have to use Premium tier since vnet integration is only available. From all the information regarding billing and the state of the function after beeing deployed, even while not doing anything. I gather this is because there is an always-on instance to avoid cold start, but in my case, I have no need for pre-warmed instances.

Is there any way to have a Premium tier Azure Function that will only be billed when executed and for the time it actually ran? Sure, I can destroy it and reprovision it at will with arm/terraform, but I feel this is overkill for what I want to achieve, Hopefully there's a simple way to achieve this.

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,605 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. ChaitanyaNaykodi-MSFT 24,391 Reputation points Microsoft Employee
    2020-12-11T21:51:22.753+00:00

    Hello @Guillermo Elía , apologies for the delay. According to the documentation every premium plan will have at least one active (billed) instance at all times, so there is no way to turn-off the pre-warmed instance. Apart from the solution you suggested the other solution we could think of is by accessing the database using the On-premises Data gateway integrated with a Logic App and which in turn is integrated with a consumption plan based Function App as they all run on pay-as-you-use model .

    1. Install a on-premises data gateway on a local machine. (Please go through the limits on payload size)
    2. Create a Logic App and use the reoccurrence trigger and use the SQL connector
    3. Connect a function app to your Logic App.

    Please let me know if there are any concerns, Thank you!

    0 comments No comments