Chapter 4
Convert Your App to Serverless and Container Architecture
Section 2
Deploy Microservices and Jobs to Azure Functions
We will adapt a part of MVC Music Store application’s services to the Serverless model with Azure Functions, deploy the microservice(s) to Azure Functions, and use this service within the application. - Create a new Azure Functions project for the Order Service: update Nuget package after creation, configure a first Function, and test locally. Create the Function classes (in a dedicated folder). 1 function = 1 action method of the controller. Copy existing artefacts from the old ASPNET Core Order Service project - Activate and adapt original code for Functions: include Nuget packages; create helper code (replacing the injection and configuration); configure locally. Test Locally. Create an Azure Function App. Configure database connection string - Deploy the new project to the Azure Function App. Change the code and configuration of the Front web to point to the new service: include the function app key in the calls’header. Redeploy the Front Web and test the application