Thursday, 3 June 2021

How to deploy and schedule a .NET console application to Azure portal

 How to deploy and schedule a console application to Azure portal

Sometimes we need to develop console application in .net and need to schedule it in Azure portal. In my example I am going to develop a simple Hellow World console app.

Open the Microsoft Visual Studio and create a new project of type “Console App (.NET Framework).”

Microsoft Dynamcis NAV

Develop your hellow world console application.

Microsoft Dynamcis NAV

Add a new file called ‘settings.job’ and enter the following cron expression. The settings will be used for scheduling the job in Azure portal. “0 */15 * * * * “ means execute the job in every 15 minutes.

Microsoft Dynamcis NAV

Build the application.

Microsoft Dynamcis NAV

Now I want to deploy the .NET console application to an Azure App Service as a WebJob. A WebJob looks for specific file type, for example (.exe,.bat,.cmd, etc..). You need to create a file with an extension a WebJob is looking for that executes. Navigates to the folder where the executable is created and create the zip file. The zip file should contain all the dll files, exe file, settings file, job file.

Microsoft Dynamcis NAV

Logon to Azure portal and search for the App Service.

Microsoft Dynamcis NAV

Add new App Service

Microsoft Dynamcis NAV

Select Web App


Open the new app services, select WebJobs and add a new WebJobs.

The webjobs will run every 15 minutes and you can see the logs.



  •  

  •  

  •  

No comments:

Post a Comment

Power Apps Drag & Drop Kanban code sample

  Introduction: The Kanban Board App Developers at a software company use the Kanban board to show their progress on development tasks and b...