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 :
- 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.
- 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.
- Azure functions can be debugged locally in Visual Studio and can deployed right from visual studio into Azure by publishing the project.
- 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.
- 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.
- 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 .