Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Azure Functions 2.0 - serverless architecture with real world example

Azure Functions 2.0 - serverless architecture with real world example

1. What is serverless?
2. Why it matters?
3. What is Azure Functions?
4. Features
5. Triggers & Bindings
6. Development
7. Business case
8. CI Setup
9. Monitoring
10. Costs

Robert Witkowski

November 30, 2018
Tweet

More Decks by Robert Witkowski

Other Decks in Programming

Transcript

  1. Serverless architecture with real world example Wojciech Suwała, Head Architect,

    ASC LAB Robert Witkowski, Senior Software Engineer, ASC LAB Azure Functions 2.0
  2. 3 Some definitions The most common definition is that it

    allows you to set up a piece of code to be executed as a reaction to an event. Gojko Adzic There are ideas to stop talking about serverless and start talking about servicefull, then there’s also a half-serious proposal to rename the whole thing to Jeff. Paul Johnston https://serverless.zone/serverless-is-just-a-name-we-could-have-called-it-jeff-1958dd4c63d7
  3. 4 Why it matters? • Financial incentives – You get

    financial benefits for good design and you get financial penalty for bad design • Promotes better engineering practices • You can focus on writing modular apps, made of really small autonomous components without worrying about: deployment, scaling, monitoring etc.
  4. 1) Trigger 7) Develop locally 3) Develop 4) Execute 6)

    Monitor and improve 2) Input binding 5) Output binding Azure Services Consumption Plan Azure Services Web Hooks Azure Services
  5. Features • Choice of language - Write functions using C#,

    F#, JavaScript (Node 8 & 10), Java 8 • Pay-per-use pricing model - Pay only for the time spent running your code. See the Consumption hosting plan option in the pricing section. • Bring your own dependencies - Functions supports NuGet and NPM, so you can use your favorite libraries. • Integrated security - Protect HTTP-triggered functions with OAuth providers such as Azure Active Directory, Facebook, Google, Twitter, and Microsoft Account. • Simplified integration - Easily leverage Azure services and software-as-a- service (SaaS) offerings: SendGrid, Twilio • Flexible development - Code your functions right in the portal or set up continuous integration and deploy your code through GitHub, local Git and other supported development tools. • Open-source - The Functions runtime is open-source and available on GitHub. https://docs.microsoft.com/en-gb/azure/azure-functions/functions-overview
  6. 9 Cost • Consumption plan - When your function runs,

    Azure provides all of the necessary computational resources. You don't have to worry about resource management, and you only pay for the time that your code runs. • App Service plan - Run your functions just like your web, mobile, and API apps. When you are already using App Service for your other applications, you can run your functions on the same plan at no additional cost.
  7. 10 Cost – Consumption plan • In consumption plan we

    pay for gigabyte seconds (GB-s) resources that are actually used • Functions pricing includes a monthly free grant of 400,000 GB-s • Time limit max. 10 minutes (default set to 5 minutes) • Max 1,5GB RAM is allocated per function instance • Autoscaling provided out of the box by Azure Runtime: different heuristics for different triggers (for example Queue trigger heuristic is based on queue length and oldest message date). Scales up and down automatically.
  8. Future • Python private preview • Premium Functions private preview

    – VNet connectivity – Always on cores (so you don’t hit cold start) – Unlimited execution duration – Same rapid scale out and scale in of consumption – REQUIREMENT: Pay for 1 core 24/7
  9. 26 Deployment • Manual from Visual Studio • Or using

    Azure CLI https://docs.microsoft.com/en-us/azure/azure-functions/functions-create- first-azure-function-azure-cli
  10. 27 Security • Function Keys (API-Keys) • Azure Active Directory

    support with support for integration with various OAuth providers • In HTTP triggered functions we have access to HTTP request so all kinds of HTTP Auth can be implemented – for example JWT token validation
  11. 37 What’s not covered • Durable functions • CD config

    • Function proxies • Azure Functions vs AWS Lambdas vs Google Cloud Functions