SlideShare una empresa de Scribd logo
1 de 23
Ask me how I
Why Functions?
Web Jobs
WebApps
WebJobs
Where Functions Live?
Functions
App Service Hosting Plan
Dedicated Hosting Plan Consumption Plan
• Basic, Standard, Premium
• Pay based on # of reserved VMs
• You’re responsible for scale
• Pay on number of executions
• Platform responsible for scale
• Max execution time is 5 mins
Azure Functions Architecture
Consumption Plan Pricing (Dynamic Tier)
Pay per execution, 2 meters, 3 units
- Number of executions
- Execution duration (sec) X reserved memory (GB)
- Monthly 1 Million executions + 400,000GB-sec FREE
- After that $0.000016 GB-sec & $0.20 per Million Executions
https://azure.microsoft.com/en-us/pricing/details/functions/
- OR use an existing App Plan ;)
- Functions should “do one thing”
- Functions should be idempotent
- Functions should finish as quickly as possible
1
What Functions Should Do
Functions Basics
- Input trigger(s)
- Body
- Optional return value(s)
Triggers
Type Service Trigger Input Output
Schedule Azure Functions ✔
HTTP (REST or webhook) Azure Functions ✔ ✔*
Blob Storage Azure Storage ✔ ✔ ✔
Events Azure Event Hubs ✔ ✔
Queues Azure Storage ✔ ✔
Tables Azure Storage ✔ ✔
Tables Azure Mobile Apps ✔ ✔
No-SQL DB Azure DocumentDB ✔ ✔
Push Notifications Azure Notification Hubs ✔
Twilio SMS Text Twilio ✔
* requires an HTTP trigger
SaaS File (OneDrive, Google Drive, DropBox, etc)
SaaS Table (SalesForce, Dynamics, Google Sheets, etc)
Bindings - Declarative
Using function.json
Bindings - Imperative
Using IBinder or Binder parameter
Show me the money code!
Prerequisites
- A browser
- Node.js (2nd part)
Demo 1: Exposing a function on the web
- HttpTrigger
- Authorization level
Demo 2: Azure Function Proxies
- Versioning our Function
- To proxy or not to proxy, that is the question
Demo 3: Debugging Functions - Azure Portal
- Using HTTP headers/query parameters
Demo 4: Debugging Functions - Visual Studio 2017
- Requires npm package: npm i -g azure-functions-cli
- A standard ASP.NET WebApp empty project
- Start action: external program
- Program: %appdata%npmnode_modulesazure-functions-clibinfunc.exe
- Arguments: host start
- Working directory: directory of the function app
- Initiate function app: func init
- Generate a function under fuction app: func new
- Include function under function app in VS solution: function <name> folder
- Include function app files in VS solution: appsettings.json & host.json
Demo 5: Function as a .NET class library
- Take an existing function app from portal or create a new
- Update function.json to point to an assembly:
- "scriptFile": "..binAssembly.dll",
- "entryPoint": "Namespace.ClassName.Run"
- Convert .csx into a class
- Add the required packages:
- Microsoft.Azure.WebJobs
- Microsoft.Azure.WebJobs.Extensions
- Microsoft.AspNet.WebApi.Client
- Microsoft.AspNet.WebApi.Core
- xcopy deployment
- host.json → sitewwwroot
- function.json → sitewwwroot<function app folder>
- Download publish settings
- Publish using the settings
OR
Best Practices
- Avoid large long running functions
- Cross function communication (ASQ/ASB)
- Take advantage of dead letter queues
- Write functions to be stateless
- Write defensive functions
- Use async code. Yes, with ConfigureAwait(false)
- Don’t use Task.Result
- Chaining functions can be a challenge – wait till Build2017…
Chaining Functions: Monitored Thumbnail Generator
Use case: ETL (Failure Auditing)
https://weblogs.asp.net/sfeldman/azure-functions-to-make-audit-queue-and-auditors-happy
Use case: Message Deduplication
http://microsoftintegration.guru/2016/09/20/use-azure-function-to-deduplicate-messages-on-azure-service-bus/
Use case: Updates Notifier
NuGet packages
Thank you!
Connect @sfeldman / feldman.sean@gmail.com
Blog https://weblogs.asp.net/sfeldman
Tools
• Azure Portal
• npm azure-functions-cli https://www.npmjs.com/package/azure-functions-cli

Más contenido relacionado

La actualidad más candente

Serverless Computing in Azure
Serverless Computing in AzureServerless Computing in Azure
Serverless Computing in AzureDaniel Toomey
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfNCCOMMS
 
Azure functions
Azure functionsAzure functions
Azure functionsvivek p s
 
Serverless in Azure with Functions
Serverless in Azure with FunctionsServerless in Azure with Functions
Serverless in Azure with FunctionsChristos Matskas
 
Azure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solutionAzure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solutionGelis Wu
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup
 
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...CodeOps Technologies LLP
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamBrian Benz
 
Azure Automation and Update Management
Azure Automation and Update ManagementAzure Automation and Update Management
Azure Automation and Update ManagementUdaiappa Ramachandran
 
Four Scenarios for Using an Integration Service Environment (ISE)
Four Scenarios for Using an Integration Service Environment (ISE)Four Scenarios for Using an Integration Service Environment (ISE)
Four Scenarios for Using an Integration Service Environment (ISE)Daniel Toomey
 
Static web apps by GitHub action
Static web apps by GitHub actionStatic web apps by GitHub action
Static web apps by GitHub actionSeven Peaks Speaks
 
Moving Your Business to Azure
Moving Your Business to AzureMoving Your Business to Azure
Moving Your Business to AzureInCycleSoftware
 
Best Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft AzureBest Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft AzureBrian Benz
 
Azure functions - Build apps faster with serverless architecture
Azure functions - Build apps faster with serverless architectureAzure functions - Build apps faster with serverless architecture
Azure functions - Build apps faster with serverless architectureCallon Campbell
 
Getting Started with Serverless Architectures using Azure Functions
Getting Started with Serverless Architectures using Azure FunctionsGetting Started with Serverless Architectures using Azure Functions
Getting Started with Serverless Architectures using Azure FunctionsMarc Duiker
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Maarten Balliauw
 

La actualidad más candente (20)

Serverless Computing in Azure
Serverless Computing in AzureServerless Computing in Azure
Serverless Computing in Azure
 
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio StruyfO365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
O365Con18 - Automate your Tasks through Azure Functions - Elio Struyf
 
Azure functions
Azure functionsAzure functions
Azure functions
 
Azure Update, July 2016
Azure Update, July 2016Azure Update, July 2016
Azure Update, July 2016
 
Serverless in Azure with Functions
Serverless in Azure with FunctionsServerless in Azure with Functions
Serverless in Azure with Functions
 
Azure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solutionAzure PaaS (WebApp & SQL Database) workshop solution
Azure PaaS (WebApp & SQL Database) workshop solution
 
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
Tokyo Azure Meetup #7 - Introduction to Serverless Architectures with Azure F...
 
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
CREATING REAL TIME DASHBOARD WITH BLAZOR, AZURE FUNCTION COSMOS DB AN AZURE S...
 
Azure functions serverless
Azure functions serverlessAzure functions serverless
Azure functions serverless
 
Experiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure teamExperiences using CouchDB inside Microsoft's Azure team
Experiences using CouchDB inside Microsoft's Azure team
 
Azure Automation and Update Management
Azure Automation and Update ManagementAzure Automation and Update Management
Azure Automation and Update Management
 
Four Scenarios for Using an Integration Service Environment (ISE)
Four Scenarios for Using an Integration Service Environment (ISE)Four Scenarios for Using an Integration Service Environment (ISE)
Four Scenarios for Using an Integration Service Environment (ISE)
 
Static web apps by GitHub action
Static web apps by GitHub actionStatic web apps by GitHub action
Static web apps by GitHub action
 
Moving Your Business to Azure
Moving Your Business to AzureMoving Your Business to Azure
Moving Your Business to Azure
 
Best Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft AzureBest Practices for couchDB developers on Microsoft Azure
Best Practices for couchDB developers on Microsoft Azure
 
Azure functions - Build apps faster with serverless architecture
Azure functions - Build apps faster with serverless architectureAzure functions - Build apps faster with serverless architecture
Azure functions - Build apps faster with serverless architecture
 
Getting Started with Serverless Architectures using Azure Functions
Getting Started with Serverless Architectures using Azure FunctionsGetting Started with Serverless Architectures using Azure Functions
Getting Started with Serverless Architectures using Azure Functions
 
Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...Sherlock Homepage - A detective story about running large web services (VISUG...
Sherlock Homepage - A detective story about running large web services (VISUG...
 
Azure App Service Deep Dive
Azure App Service Deep DiveAzure App Service Deep Dive
Azure App Service Deep Dive
 
Azure Web Apps Advanced Security
Azure Web Apps Advanced SecurityAzure Web Apps Advanced Security
Azure Web Apps Advanced Security
 

Similar a Functions Basics and Best Practices

Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopVivek Krishnakumar
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersChris O'Brien
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for JavaLars Vogel
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Pavel Chunyayev
 
Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019Eliran Eliassy
 
Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Opevel
 
Getting Started with Heroku
Getting Started with HerokuGetting Started with Heroku
Getting Started with HerokuLaunchAny
 
Azure Functions.pptx
Azure Functions.pptxAzure Functions.pptx
Azure Functions.pptxYachikaKamra
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework BasicMario Romano
 
Useful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmUseful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmAnton Shapin
 
Priming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the CloudPriming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the CloudMatt Callanan
 
Play with azure functions
Play with azure functionsPlay with azure functions
Play with azure functionsBaskar rao Dsn
 
Modern Automated Site Provisioning for SharePoint Online
Modern Automated Site Provisioning for SharePoint OnlineModern Automated Site Provisioning for SharePoint Online
Modern Automated Site Provisioning for SharePoint OnlineDocFluix, LLC
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure FunctionsPushkar Saraf
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleRoman Rodomansky
 

Similar a Functions Basics and Best Practices (20)

Tutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer WorkshopTutorial 1: Your First Science App - Araport Developer Workshop
Tutorial 1: Your First Science App - Araport Developer Workshop
 
COB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developersCOB - Azure Functions for Office 365 developers
COB - Azure Functions for Office 365 developers
 
[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions[Struyf] Automate Your Tasks With Azure Functions
[Struyf] Automate Your Tasks With Azure Functions
 
Google App Engine for Java
Google App Engine for JavaGoogle App Engine for Java
Google App Engine for Java
 
Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015Ansible benelux meetup - Amsterdam 27-5-2015
Ansible benelux meetup - Amsterdam 27-5-2015
 
Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019Angular - Improve Runtime performance 2019
Angular - Improve Runtime performance 2019
 
Building JavaScript
Building JavaScriptBuilding JavaScript
Building JavaScript
 
Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011Google app-engine-cloudcamplagos2011
Google app-engine-cloudcamplagos2011
 
Getting Started with Heroku
Getting Started with HerokuGetting Started with Heroku
Getting Started with Heroku
 
Azure Functions.pptx
Azure Functions.pptxAzure Functions.pptx
Azure Functions.pptx
 
Alfresco Development Framework Basic
Alfresco Development Framework BasicAlfresco Development Framework Basic
Alfresco Development Framework Basic
 
Useful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvmUseful practices of creation automatic tests by using cucumber jvm
Useful practices of creation automatic tests by using cucumber jvm
 
Priming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the CloudPriming Your Teams For Microservice Deployment to the Cloud
Priming Your Teams For Microservice Deployment to the Cloud
 
Iac d.damyanov 4.pptx
Iac d.damyanov 4.pptxIac d.damyanov 4.pptx
Iac d.damyanov 4.pptx
 
Play with azure functions
Play with azure functionsPlay with azure functions
Play with azure functions
 
Modern Automated Site Provisioning for SharePoint Online
Modern Automated Site Provisioning for SharePoint OnlineModern Automated Site Provisioning for SharePoint Online
Modern Automated Site Provisioning for SharePoint Online
 
Durable Azure Functions
Durable Azure FunctionsDurable Azure Functions
Durable Azure Functions
 
Google App Engine
Google App EngineGoogle App Engine
Google App Engine
 
Runtime performance
Runtime performanceRuntime performance
Runtime performance
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 

Más de Sean Feldman

Azure Service Bus: The Messaging Backbone for Cloud Applications
Azure Service Bus: The Messaging Backbone for Cloud ApplicationsAzure Service Bus: The Messaging Backbone for Cloud Applications
Azure Service Bus: The Messaging Backbone for Cloud ApplicationsSean Feldman
 
Azure Messaging Crossroads
Azure Messaging CrossroadsAzure Messaging Crossroads
Azure Messaging CrossroadsSean Feldman
 
Event Grid - quiet event to revolutionize Azure and more
Event Grid - quiet event to revolutionize Azure and moreEvent Grid - quiet event to revolutionize Azure and more
Event Grid - quiet event to revolutionize Azure and moreSean Feldman
 
Azure Service Bus - Taming the Beast
Azure Service Bus - Taming the BeastAzure Service Bus - Taming the Beast
Azure Service Bus - Taming the BeastSean Feldman
 
NServiceBus in Azure - A Right Tool for the Web(Job)?
NServiceBus in Azure - A Right Tool for the Web(Job)?NServiceBus in Azure - A Right Tool for the Web(Job)?
NServiceBus in Azure - A Right Tool for the Web(Job)?Sean Feldman
 
Messaging in the cloud - Azure Service Bus
Messaging in the cloud - Azure Service BusMessaging in the cloud - Azure Service Bus
Messaging in the cloud - Azure Service BusSean Feldman
 

Más de Sean Feldman (6)

Azure Service Bus: The Messaging Backbone for Cloud Applications
Azure Service Bus: The Messaging Backbone for Cloud ApplicationsAzure Service Bus: The Messaging Backbone for Cloud Applications
Azure Service Bus: The Messaging Backbone for Cloud Applications
 
Azure Messaging Crossroads
Azure Messaging CrossroadsAzure Messaging Crossroads
Azure Messaging Crossroads
 
Event Grid - quiet event to revolutionize Azure and more
Event Grid - quiet event to revolutionize Azure and moreEvent Grid - quiet event to revolutionize Azure and more
Event Grid - quiet event to revolutionize Azure and more
 
Azure Service Bus - Taming the Beast
Azure Service Bus - Taming the BeastAzure Service Bus - Taming the Beast
Azure Service Bus - Taming the Beast
 
NServiceBus in Azure - A Right Tool for the Web(Job)?
NServiceBus in Azure - A Right Tool for the Web(Job)?NServiceBus in Azure - A Right Tool for the Web(Job)?
NServiceBus in Azure - A Right Tool for the Web(Job)?
 
Messaging in the cloud - Azure Service Bus
Messaging in the cloud - Azure Service BusMessaging in the cloud - Azure Service Bus
Messaging in the cloud - Azure Service Bus
 

Último

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 

Functions Basics and Best Practices

  • 1.
  • 4. WebApps WebJobs Where Functions Live? Functions App Service Hosting Plan Dedicated Hosting Plan Consumption Plan • Basic, Standard, Premium • Pay based on # of reserved VMs • You’re responsible for scale • Pay on number of executions • Platform responsible for scale • Max execution time is 5 mins
  • 6. Consumption Plan Pricing (Dynamic Tier) Pay per execution, 2 meters, 3 units - Number of executions - Execution duration (sec) X reserved memory (GB) - Monthly 1 Million executions + 400,000GB-sec FREE - After that $0.000016 GB-sec & $0.20 per Million Executions https://azure.microsoft.com/en-us/pricing/details/functions/ - OR use an existing App Plan ;)
  • 7. - Functions should “do one thing” - Functions should be idempotent - Functions should finish as quickly as possible 1 What Functions Should Do
  • 8. Functions Basics - Input trigger(s) - Body - Optional return value(s)
  • 9. Triggers Type Service Trigger Input Output Schedule Azure Functions ✔ HTTP (REST or webhook) Azure Functions ✔ ✔* Blob Storage Azure Storage ✔ ✔ ✔ Events Azure Event Hubs ✔ ✔ Queues Azure Storage ✔ ✔ Tables Azure Storage ✔ ✔ Tables Azure Mobile Apps ✔ ✔ No-SQL DB Azure DocumentDB ✔ ✔ Push Notifications Azure Notification Hubs ✔ Twilio SMS Text Twilio ✔ * requires an HTTP trigger SaaS File (OneDrive, Google Drive, DropBox, etc) SaaS Table (SalesForce, Dynamics, Google Sheets, etc)
  • 11. Bindings - Imperative Using IBinder or Binder parameter
  • 12. Show me the money code! Prerequisites - A browser - Node.js (2nd part)
  • 13. Demo 1: Exposing a function on the web - HttpTrigger - Authorization level
  • 14. Demo 2: Azure Function Proxies - Versioning our Function - To proxy or not to proxy, that is the question
  • 15. Demo 3: Debugging Functions - Azure Portal - Using HTTP headers/query parameters
  • 16. Demo 4: Debugging Functions - Visual Studio 2017 - Requires npm package: npm i -g azure-functions-cli - A standard ASP.NET WebApp empty project - Start action: external program - Program: %appdata%npmnode_modulesazure-functions-clibinfunc.exe - Arguments: host start - Working directory: directory of the function app - Initiate function app: func init - Generate a function under fuction app: func new - Include function under function app in VS solution: function <name> folder - Include function app files in VS solution: appsettings.json & host.json
  • 17. Demo 5: Function as a .NET class library - Take an existing function app from portal or create a new - Update function.json to point to an assembly: - "scriptFile": "..binAssembly.dll", - "entryPoint": "Namespace.ClassName.Run" - Convert .csx into a class - Add the required packages: - Microsoft.Azure.WebJobs - Microsoft.Azure.WebJobs.Extensions - Microsoft.AspNet.WebApi.Client - Microsoft.AspNet.WebApi.Core - xcopy deployment - host.json → sitewwwroot - function.json → sitewwwroot<function app folder> - Download publish settings - Publish using the settings OR
  • 18. Best Practices - Avoid large long running functions - Cross function communication (ASQ/ASB) - Take advantage of dead letter queues - Write functions to be stateless - Write defensive functions - Use async code. Yes, with ConfigureAwait(false) - Don’t use Task.Result - Chaining functions can be a challenge – wait till Build2017…
  • 19. Chaining Functions: Monitored Thumbnail Generator
  • 20. Use case: ETL (Failure Auditing) https://weblogs.asp.net/sfeldman/azure-functions-to-make-audit-queue-and-auditors-happy
  • 21. Use case: Message Deduplication http://microsoftintegration.guru/2016/09/20/use-azure-function-to-deduplicate-messages-on-azure-service-bus/
  • 22. Use case: Updates Notifier NuGet packages
  • 23. Thank you! Connect @sfeldman / feldman.sean@gmail.com Blog https://weblogs.asp.net/sfeldman Tools • Azure Portal • npm azure-functions-cli https://www.npmjs.com/package/azure-functions-cli

Notas del editor

  1. Run VS as admin or functions CLI won’t be executed properly