Build Micro Service landscape with Azure Functions Mattias Lögdberg
Mattias Lögdberg Solution Architect Azure Specialist Microsoft MVP http://mlogdberg.com MLogdberg https://se.linkedin.com/in/logdberg
Building a micro service landscape Small components Scaling Throttling (even out workloads) Events Create a facade
Mono-lithic application Inside client app Complex framework Outside client app Micro- functionality Loosely coupled components
Learn the icons
Scenario based, requirements Recieve data via HTTPS Store data Provide API for external consumers Detect updates and provide change feed to other systems (pub/sub) Keep track of what is happening
Scenario Drawing time
Some context
Bindings Standard functionality Smaller and more focused Functions Less code https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2
Scaling On instance level (server) On thread level (threads per instance) https://docs.microsoft.com/en-us/azure/azure-functions/functions-host-json https://docs.microsoft.com/en-us/azure/azure-functions/functions-app-settings https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-service-bus#host-json https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-cosmosdb-v2#host-json
Lets start! put /product/{id}
Monitoring Scaling Errors Performance Live Stream https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitoring Lets’ watch how this goes (runner) https://docs.microsoft.com/en-us/azure/azure-monitor/app/correlation
All good? Load test
Monitoring End to End https://docs.microsoft.com/en-us/azure/azure-functions/functions-monitoring Lets’ watch how this goes (runner) https://docs.microsoft.com/en-us/azure/azure-monitor/app/correlation
Lets add an API get /product/{productnumber} put/product/{id}
Update Events in Cosmos https://docs.microsoft.com/en-us/azure/cosmos-db/change-feed
Custom Bindings / Extensions Event Grid https://github.com/fbeltrao/AzureFunctionExtensions https://github.com/fbeltrao/AzureFunctionExtensions
Lets add Update Event’s get /product/{productnumber} put /product/{id}
Reflection get /product/{productnumber} put/product/{id}
Mono-lithic application Inside client app Complex framework Outside client app Micro- functionality Loosely coupled components
Lessons learned Design is important Security on end user is often important when used with mobile apps Facade’s help remodel, handle change is key to success Micro Service landscape boost innovation Good CI/CD story helps for change and rapid development For End To End tracking use same Application Insights Problem deploying? Due to locked files MSDEPLOY_RENAME_LOCKED_FILES=1
Questions?
Thanks! Mattias Lögdberg, Solution Architect Email: mattias.logdberg@ibiz-solutions.se