Migrating windows service to azure function

As part of making a software scalable and support multi-tenancy, one of the steps that I am undertaking is to migrate existing windows service components of the software into azure functions. These are my personal notes on the things that I learn while doing the migration  :

  1. Azure function is a serverless platform offering of Microsoft. What it means is we are charged only for the time and resources that we use, when we call the function.  
  2. Like a windows service which performs a background job usually scheduled on a certain time, an Azure function can also be used to perform a background job and can be timer triggered.
  3. Azure functions can be debugged locally in Visual Studio and can deployed right from visual studio into Azure by publishing the project.
  4. local.settings.json is a file where all the app settings can be stored as <string, string> pairs, but this file does not get published to Azure. After publishing the function on Azure, the application settings needs to be manually added on Azure.
  5. local.settings.json can contain local connection strings and other sensitive data, and so it is recommended that it should not be added to code repository.     
  6. Setting up of EF migration in Azure Function was bit of a challenge, but I found a very useful post which helped me set up my first EF migration: https://dev.to/azure/using-entity-framework-with-azure-functions-50aa  . 

Leave a Comment

Your email address will not be published. Required fields are marked *