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 .
- Install a on-premises data gateway on a local machine. (Please go through the limits on payload size)
- Create a Logic App and use the reoccurrence trigger and use the SQL connector
- Connect a function app to your Logic App.
Please let me know if there are any concerns, Thank you!