Home > database >  How to benefit from Azure Function to run my console application in Visual Studio?
How to benefit from Azure Function to run my console application in Visual Studio?

Time:11-30

I am a beginner to Azure Functions, never used it before and I would really appreciate it if someone can provide me with constructive answer for the following. I have a .Net console application which is responsible to query some data being collected from a database and then uploading them to a container in Azure. This console application waits for 1hour to retrieve new data and query it. The console application also contains several classes. Each class is responsible to do a specific task (for example a class to retrieve data from the database , another class to upload the data in csv format to a container in azure). What I want to do is to use azure function to handle those tasks and be able to deploy this project on Azure for production. For example, I can use timer trigger to wait 1 hour to retrieve new data and another trigger to upload data to azure. I honestly don't understand how to do it. I created an azure function app project in the same project that I already had. My question here, in order to use azure function, should I create a trigger for every class that are in the main project (for example timer trigger and blob trigger. Is there a way to link both Azure function and the console app project together. Can someone please explain how it works ? Should I redo everything in the azure function project as if the console application does not exist ?

CodePudding user response:

First of all build some understanding toward functions, you can re-use the console code, may require some refactoring looks for durable function which would help you to orchestrate your work.

https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp

  • Related