Over the years we have seen an accelerated shift to adopting serverless and cloud-native application architectures. Benefits to these architectures include decreased infrastructure costs and improved time to market, however, it's still important to consider high availability and resiliency in your application design. In this session, Callon will talk about developing scalable enterprise serverless applications on Azure with .NET and use a real-world example of a solution he developed and running in production.
Elevate Developer Efficiency & build GenAI Application with Amazon Q
Developing scalable enterprise serverless applications on azure with .net
1. Callon Campbell
Solutions Architect | Developer | Microsoft MVP
Cloud Mavericks Inc.
Developing scalable enterprise
serverless applications with
.NET
2. Microsoft Azure
Callon Campbell
Solution Architect | Developer
Microsoft MVP in Azure
He/him/his
Speaker introduction
• 20 years enterprise development with Microsoft technologies – .NET, Azure,
Web, Desktop, SQL, and Mobile
• Blogging at https://theflyingmaverick.com
• Speaker at community events and meetups
• Co-creator of ReflectInsight, a live .NET log viewer
3. Microsoft Azure
Agenda
•Goals of serverless
•Adopting serverless and cloud native for your
application architecture
•Building for scale, high availability and resiliency
•Real world example – code and demos
•Q&A
3
7. Microsoft Azure
Leader in Functions-as-a-Service
platform
Forrester has named Microsoft as a leader in the inaugural
report, The Forrester New Wave™: Function-As-A-Service
Platforms, Q1 2020 based on their evaluation of Azure Functions
and integrated development tooling.
“robust programming model and integration capabilities”
"engineering and support teams as key to their success”
Report:
https://reprints.forrester.com/#/assets/2/108/RES155938/reports
8. Microsoft Azure
Full abstraction of
servers
Instant scale
Pay-per-use
Serverless for the enterprise
Development process flexibility
Secure and compliant
Enterprise-level scale with control
Advanced observability
Hybrid and multi-cloud
15. Microsoft Azure
Cold-starts
• When choosing the ‘Consumption’ plan, you will have elastic
scale but at the cost of cold starts.
• A cold-start is a small amount of time needed to warm up the
resources and execute your functions. Consumption plan runs
on a shared environment and resources need to be allocated.
• Cold-start could take 1-3 seconds.
15
16. Microsoft Azure
Premium Functions
• Avoid cold-start with perpetually warm instances
• Dynamically scale as needed
• Consistent performance
• Network isolation, VNet connectivity
• Long running execution (60min guaranteed)
• Better predictable pricing
16
19. Microsoft Azure
Use multiple instances & deploy to
multiple regions
19
Multiple instances:
• Azure Functions provides the means to automatically scale when needed
• Allocate minimum instances in the Scale out (App Service Plan) blade
• Set number of pre-warmed instances
Deploy to multiple regions:
• Leverage Azure Front Door or Traffic Manager to intercept traffic before it hits your site
• Helps with routing and distribution between your instances and regions
• Route incoming requests based on the customer’s geography
20. Microsoft Azure
Leverage deployment slots
20
Why use slots?
• Different environments for different
purposes – test your changes
• Prewarming
• Easy fallbacks
How are functions affected by swapping slots?
• Traffic redirection is seamless; no requests
are dropped because of a swap.
• If a function is running during a swap,
execution continues, and the next triggers
are routed to the swapped app instance.
https://docs.microsoft.com/en-us/azure/azure-functions/functions-deployment-slots
21. Microsoft Azure
Cosmos DB
21
SQL-API
• Write scalability around the
world
• Low latency (<10ms P99 for 1kb
document) writes around the
world
• 99.999% High Availability around
the world
• Well-defined consistency models
• Automatic conflict management
22. Microsoft Azure
Storage (RS-GRS)
22
READ-ACCESS GEO-REDUNDANT STORAGE
Redundancy in the primary region
• Locally redundant storage (LRS) copies your data synchronously three times within a single
physical location in the primary region.
• Zone-redundant storage (ZRS) copies your data synchronously across three Azure availability
zones in the primary region.
Redundancy in a secondary region
• Geo-redundant storage (with GRS or GZRS) replicates your data to another physical location
in the secondary region to protect against regional outages.
• Design your applications for read access to the secondary region.
23. Microsoft Azure
Enable Application Insights
23
Application map
Live metrics stream
Search
Failures
Performance profiling
Track dependencies
24. Microsoft Azure
On-prem
Real world
sample
Azure Function app to integrate
into Twilio calls and messaging
platform.
Global scale, availability, resiliency.
Secure access to on-prem
resources.
24
AzureTwilio
Calls
Messages
Caller
Recipient
26. Microsoft Azure
Azure Traffic Manager
Azure - West US 2
Azure - Global
Managed Service
Azure - East US 2
http://tm-enterpriseserverless-01.trafficmanager.net/api/startcall
27
DNS-BASED LOAD BALANCING
• Flexible routing options
• Priority, performance, geographic,
weighted round-robin, subnet, and
multi-value
• Reduce application downtime
• Improve app performance and
content delivery
• Distribute user traffic over multiple
locations
• Use with your on-premises
datacenter
• Geographic fencing of your
application users
30. Microsoft Azure
Tooling
Develop and test locally and disconnected from Azure
using:
• Visual Studio and/or Visual Studio Code
• Cosmos DB Emulator
• Microsoft Azure Storage Emulator
• Microsoft Azure Storage Explorer
• .NET Core 3.1, Function runtime v3, Cosmos DB SQL API
31
31. Microsoft Azure
Inner and outer loop development
Inner Loop
Source
Control
Build and
Test (CI)
Deploy
(CD)
Run
(Prod)
Monitoring
&
Diagnostics
Code,
Run,
Debug
Outer Loop
32. Microsoft Azure
Getting code to the cloud
Direct publish App Service SCM (Kudu) CI/CD tools
“right click publish”
CD CD
CI
Check-in Check-in
33. Microsoft Azure
Operations
Using a combination of Event Grid and Logic Apps
•Event Grid listing to changes to storage account
and triggers a Logic App to synchronize media files
across regions.
•Logic App monitors Poison queue in storage and
reprocesses.
34
39. Microsoft Azure
Wrap-up
Serverless is the next big thing for enterprise. Pick what
works for you
Serverless is more than just compute, functions, and app
development
Productivity does not preclude enterprise capability
40. Microsoft Azure
Resources
Session Materials on GitHub
Session Resources
https://github.com/calloncampbell/Enterprise-Serverless-Demo/
All in one resource:
https://github.com/calloncampbell/Enterprise-Serverless-Demo/blob/master/RESOURCES.md
Get Certified