PUTTING THE ‘CTIONS’
IN AZURE FUNCTIONS
DEVELOP, BUILD, TEST, DEPLOY, REPEAT.
‘SERVERLESS’
• Event driven
• Pay-per-use/per-trigger
• Scalable
• Not a golden hammer
AZURE FUNCTIONS
• C#, F#, Node.js, Python, PHP, Batch, Bash, PowerShell
• Trigger based
• Consumption plan
• $0.20 per million executions
• $0.000016 per GB of memory per second of execution
• App Service Plan
EXAMPLE SERVICE
EXAMPLE SERVICE
EXAMPLE SERVICE
EXAMPLE SERVICE
EXAMPLE SERVICE
EXAMPLE SERVICE
EXAMPLE SERVICE
EXAMPLE SERVICE
PORTAL EXPERIENCE – DEMO
PORTAL LIMITATIONS
• C# Scripting - .CSX
• Compile time issues
• Syntax errors
• Dependency issues
• Nuget restore issues
• Intellisense
• Testing
• Environment Promotion – Development/Staging/Production
WEBJOB SDK
• Azure Functions are built on of WebJobs
• Open source:
• https://github.com/Azure/azure-webjobs-sdk
• https://github.com/Azure/azure-webjobs-sdk-script
• Bindings & Triggers
VISUAL STUDIO 2017 - DEMO
Binding Attribute NuGet package
Blob storage trigger, input, output BlobAttribute, StorageAccountAttribute Microsoft.Azure.WebJobs
Cosmos DB input and output
binding DocumentDBAttribute Microsoft.Azure.WebJobs.Extensions.DocumentDB
Event Hubs trigger and output EventHubTriggerAttribute, EventHubAttribute Microsoft.Azure.WebJobs.ServiceBus
External file input and output ApiHubFileAttribute Microsoft.Azure.WebJobs.Extensions.ApiHub
HTTP and webhook trigger HttpTriggerAttribute Microsoft.Azure.WebJobs.Extensions.Http
Mobile Apps input and output MobileTableAttribute Microsoft.Azure.WebJobs.Extensions.MobileApps
Notification Hubs output NotificationHubAttribute Microsoft.Azure.WebJobs.Extensions.NotificationHubs
Queue storage trigger and output QueueAttribute, StorageAccountAttribute Microsoft.Azure.WebJobs
SendGrid output SendGridAttribute Microsoft.Azure.WebJobs.Extensions.SendGrid
Service Bus trigger and output ServiceBusAttribute, ServiceBusAccountAttribute Microsoft.Azure.WebJobs.ServiceBus
Table storage input and output TableAttribute, StorageAccountAttribute Microsoft.Azure.WebJobs
Timer trigger TimerTriggerAttribute Microsoft.Azure.WebJobs.Extensions
Twilio output TwilioSmsAttribute Microsoft.Azure.WebJobs.Extensions.Twilio
TRIGGERS/BINDINGS
https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library
SERVICE DESIGN*
• Functions class library as ‘glue’
• Standard service design
• Service ideally shouldn’t know about functions
• Functions shouldn’t know about your service’s requirement
*Purely things that have worked for me
TESTING
• Test your services as services
• Functions CLI – Test locally
• Consumption plan is cheap/free!
BUILDING
• Just like a normal build pipeline
• Bamboo/Jenkins/VSTS
• Use build output
• Known bug when using local file system publish
DEPLOYING - DEMO
WHAT’S NEW
• Function Slots
• Only allowed 1
• Function Proxies
• Event Grid – “Serverless” EventHub
WHAT’S COMING
• BYOB – Bring you own bindings
• Method Dependency Injection
• Custom bindings
• Durable Functions
• Durable Task Framework on Functions
• Easy orchestration of persistent workflows using async/await
• .NET Core Support
WHAT TO LOOK OUT FOR
• Emulating locally?
• Start the Azure storage emulator
• “UseDevelopmentStorage=true”
• [Singleton] attribute isn’t available in Functions
• Does you function have a [FunctionName]?
• Big functions!
• Keep them tiny 
QUESTIONS?

Putting the 'ctions' in Azure Fun-ctions

  • 1.
    PUTTING THE ‘CTIONS’ INAZURE FUNCTIONS DEVELOP, BUILD, TEST, DEPLOY, REPEAT.
  • 2.
    ‘SERVERLESS’ • Event driven •Pay-per-use/per-trigger • Scalable • Not a golden hammer
  • 3.
    AZURE FUNCTIONS • C#,F#, Node.js, Python, PHP, Batch, Bash, PowerShell • Trigger based • Consumption plan • $0.20 per million executions • $0.000016 per GB of memory per second of execution • App Service Plan
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
    PORTAL LIMITATIONS • C#Scripting - .CSX • Compile time issues • Syntax errors • Dependency issues • Nuget restore issues • Intellisense • Testing • Environment Promotion – Development/Staging/Production
  • 14.
    WEBJOB SDK • AzureFunctions are built on of WebJobs • Open source: • https://github.com/Azure/azure-webjobs-sdk • https://github.com/Azure/azure-webjobs-sdk-script • Bindings & Triggers
  • 15.
  • 16.
    Binding Attribute NuGetpackage Blob storage trigger, input, output BlobAttribute, StorageAccountAttribute Microsoft.Azure.WebJobs Cosmos DB input and output binding DocumentDBAttribute Microsoft.Azure.WebJobs.Extensions.DocumentDB Event Hubs trigger and output EventHubTriggerAttribute, EventHubAttribute Microsoft.Azure.WebJobs.ServiceBus External file input and output ApiHubFileAttribute Microsoft.Azure.WebJobs.Extensions.ApiHub HTTP and webhook trigger HttpTriggerAttribute Microsoft.Azure.WebJobs.Extensions.Http Mobile Apps input and output MobileTableAttribute Microsoft.Azure.WebJobs.Extensions.MobileApps Notification Hubs output NotificationHubAttribute Microsoft.Azure.WebJobs.Extensions.NotificationHubs Queue storage trigger and output QueueAttribute, StorageAccountAttribute Microsoft.Azure.WebJobs SendGrid output SendGridAttribute Microsoft.Azure.WebJobs.Extensions.SendGrid Service Bus trigger and output ServiceBusAttribute, ServiceBusAccountAttribute Microsoft.Azure.WebJobs.ServiceBus Table storage input and output TableAttribute, StorageAccountAttribute Microsoft.Azure.WebJobs Timer trigger TimerTriggerAttribute Microsoft.Azure.WebJobs.Extensions Twilio output TwilioSmsAttribute Microsoft.Azure.WebJobs.Extensions.Twilio TRIGGERS/BINDINGS https://docs.microsoft.com/en-us/azure/azure-functions/functions-dotnet-class-library
  • 17.
    SERVICE DESIGN* • Functionsclass library as ‘glue’ • Standard service design • Service ideally shouldn’t know about functions • Functions shouldn’t know about your service’s requirement *Purely things that have worked for me
  • 18.
    TESTING • Test yourservices as services • Functions CLI – Test locally • Consumption plan is cheap/free!
  • 19.
    BUILDING • Just likea normal build pipeline • Bamboo/Jenkins/VSTS • Use build output • Known bug when using local file system publish
  • 20.
  • 21.
    WHAT’S NEW • FunctionSlots • Only allowed 1 • Function Proxies • Event Grid – “Serverless” EventHub
  • 22.
    WHAT’S COMING • BYOB– Bring you own bindings • Method Dependency Injection • Custom bindings • Durable Functions • Durable Task Framework on Functions • Easy orchestration of persistent workflows using async/await • .NET Core Support
  • 23.
    WHAT TO LOOKOUT FOR • Emulating locally? • Start the Azure storage emulator • “UseDevelopmentStorage=true” • [Singleton] attribute isn’t available in Functions • Does you function have a [FunctionName]? • Big functions! • Keep them tiny 
  • 24.