Dipping Your Toe into
Cloud Development with
Azure Functions
Brian T. Jackett
Sr. Premier Field Engineer
Microsoft
Sr. Premier Field Engineer at Microsoft
Office 365 Dev / Admin, Azure Dev
Stir Trek Conference Organizer
Blog: www.BrianTJackett.com
Twitter: @BrianTJackett
Email: Brian.Jackett@Microsoft.com
Azure Functions v1
• .Net Framework 4.7
• Windows-only
Azure Functions v2
• .Net Core 2.x
• Cross-platform
• GA at Ignite
Azure
Functions
Design
Considerations
Authentication
Security
Concerns
Durable
Functions
Tips and
Tricks
What are Azure Functions?
Code that runs in response to a triggered event
Components
• Trigger – condition to initiate function
• Input binding – (optional) additional input at start
• Output binding – (optional) where to send output
Trigger Input Output
Blob Storage   
Cosmos DB   
Event Grid 
Event Hubs  
HTTP / Webhook  
Mobile Apps  
Notification Hubs 
Queue Storage  
SendGrid 
Service Bus  
Table Storage  
Timer 
Twilio 
Two styles of functions
• Pre-compiled (ex. Visual Studio)
• Uncompiled (ex. VS Code or Azure Portal)
Supported languages Experimental languages
SharePoint Online
Storage queue
1) Scheduled Azure
Function
2) Read data
from SPO
3) Place records on queue
to be processed
4) Queue triggered
Azure Function
5) Perform designated
actions on targets
Azure Log Analytics
(operational run data)
Azure
Azure Portal
Local development (same runtime)
Visual Studio 2017 version 15.5+
-or-
Visual Studio Code + Azure Functions Core Tools
Optional but highly recommended
Azure Storage Explorer
• https://aka.ms/azurestorageexplorer
Azure Service Bus Explorer
• https://aka.ms/servicebusexplorer
HTTP API testing tool (Postman or similar)
Portal Visual Studio
Authentication +
Security
Super Special
Demo
https://aka.ms/BTJAFDemo
Portal Visual Studio
Authentication +
Security
Super Special
Demo
Azure
Functions
Design
Considerations
Authentication
Security
Concerns
Durable
Functions
Tips and
Tricks
Don’t re-invent the wheel
https://docs.microsoft.com/en-us/azure/architecture/patterns/
Event driven programming
A different style of thinking
Design code to run as fast as possible with smallest footprint
Consumption
• Pay per use
• Auto resource allocation
• Max timeout 10 minutes (default 5)
Dedicated
• Pay monthly = App Service Plan
• No “warm up” (Always On setting)
• Flexible resource allocation
• Run > 10 minutes
Sample costs: www.HaveIBeenPwned.com
• Uses: 4MM hits / week
• Cost: $7.40 / week
Efficiency
Azure
Functions
Design
Considerations
Authentication
Security
Concerns
Durable
Functions
Tips and
Tricks
What are you
connecting to?
• SharePoint Online
• MS Graph
• Azure Storage
• …
How are you
storing credentials?
• App Settings
• Azure Key Vault
Connect to data source (ex. SharePoint Online)
https://aka.ms/BTJAFCertAuth
Authentication libraries
App Service “Managed Service Identity”
App Service App Settings
Azure Key Vault
Azure
Functions
Design
Considerations
Authentication
Security
Concerns
Durable
Functions
Tips and
Tricks
Azure Services with Public Endpoints
• App service (function)
• Storage
Secure these properly!
App Service (function)
• Configure authentication
• Disable anonymous access
App Service (function)
• Disable the default homepage
• App Setting
• AzureWebJobsDisableHomepage = True
Access keys = keys to the kingdom
• Read / write to entire storage account
• Rotate regularly
• Store securely
• Caution with who has access to keys
Shared Access Signature (SAS) token
• Use SAS tokens when possible
• Scoped to Account or Container
• Time bound
• Allowed Permissions
• Allowed IPs
Portal Visual Studio
Authentication +
Security
Super Special
Demo
Azure
Functions
Design
Considerations
Authentication
Security
Concerns
Durable
Functions
Tips and
Tricks
Announcements
Stateful functions
How to
handle
errors?
Function Chaining
Fan-out / fan-in Human interaction
Portal Visual Studio
Authentication +
Security
Super Special
Demo
Automatically apply retention labels in SharePoint Online
SharePoint Online
Storage queue
1) Scheduled Azure
Function
2) Read data
from SPO
3) Place records on queue
to be processed
4) Queue triggered
Azure Function
5) Perform designated
actions on targets
Azure
Functions
Design
Considerations
Authentication
Security
Concerns
Durable
Functions
Tips and
Tricks
• Azure Storage Explorer to see data in storage
• If using app service plan, enable “Always On” setting
• Run Functions locally = no money spent
• Freebies per month…
Date / Time Session
Thurs 3:20pm From Zero to Serverless – Chad Green
Fri 2:10pm Building an Ultra-Scalable API Using Azure Functions…
- Chad Green
Brian.Jackett@microsoft.com
http://aka.ms/azureicons

Cloud Dev with Azure Functions - DogFoodCon 2018 - Brian T Jackett

Editor's Notes

  • #5 All slides and demo code will be on blog
  • #12 https://github.com/cncf/wg-serverless/blob/master/whitepaper/cncf_serverless_whitepaper_v1.0.pdf
  • #14 * = All bindings must be registered except for HTTP and Timer ** = MS Graph supports multiple endpoints that vary in allowing triggers, inputs, and outputs
  • #15 V1 language support
  • #25 GB-s is the key measurement to be aware of, as well as executions per month
  • #26 If using App Service Plan, be sure to enable the “Always On” setting so that apps run properly. Otherwise function runtime may go idle and can’t be brought back online except using an HTTP trigger.
  • #27 Credit to Troy Hunt for publishing
  • #32 Anyone with Client ID and password can log in to that Azure AD app
  • #35 Anyone with Client ID and password can log in to that Azure AD app
  • #44 https://buildazure.com/2017/08/15/scaling-azure-functions-with-durable-functions/ https://azure.microsoft.com/en-in/blog/break-through-the-serverless-barriers-with-azure-functions/ https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-overview
  • #47 https://docs.microsoft.com/en-us/azure/azure-functions/durable-functions-overview
  • #48 http://www.markheath.net/post/10-reasons-durable-functions
  • #52 https://azure.microsoft.com/en-us/pricing/details/functions/