0

Am new to Azure and am reviewing the ton of different services to choose from for processing various files from blob storage folders. I have a .net core windows service that currently processes these files, running on-prem (files on prem also) but needs to be migrated to the cloud after some refactoring to work with a new Db schema. Getting the files into blob storage is the easy part.

This service would only run at scheduled times. I am thinking I could could invoke its methods via a scheduled azure function, if I expose those service methods as http endpoints. Am I on the right path?

Questions:

  • How can I host the service in a container that doesn't have to run continually, and have it wake up when there are files to process? Not sure If I am asking the right question
  • How can I ensure that if an Azure function calls one of these methods, it is fire-and-forget and doesnt have to wait for it to finish.
  • I see Webjobs have a runMode with options "continious" or "on demand", will this do what I think, in that it would reduce costs of running all the time even when not processing files?
bitshift
  • 6,026
  • 11
  • 44
  • 108

1 Answers1

1

You could use a blob storage trigger, which will run your Azure Function: https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-storage-blob

Be aware that if your Azure Function requires more than 10 minutes to complete, that you cannot run it in a consumption plan. https://learn.microsoft.com/en-us/azure/azure-functions/functions-scale#timeout

You could also setup the Azure Function to run on a timer trigger. https://learn.microsoft.com/en-us/azure/azure-functions/functions-bindings-timer?tabs=csharp

nullforce
  • 1,051
  • 1
  • 8
  • 13
  • If a function calls a webjob that is going to take longer than 10 min, how can I simply return without waiting on a response, or would it be better to schedule the webjob itself? – bitshift Mar 02 '21 at 02:26
  • If you're handing off the work to another process that runs outside the Azure Function, that should be okay. The 10 minute limit is for execution within the Azure Function itself. However, it'll be up to you to start and stop that process or container. Maybe you need to pair the Azure Function with Azure Container Instance (ACI): https://azure.microsoft.com/en-us/services/container-instances/ – nullforce Mar 02 '21 at 14:38