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

Serverless and Azure Functions Introduction

Daron Yondem
December 19, 2017

Serverless and Azure Functions Introduction

This is part of a full day Serverless training I hosted for Microsoft Turkey in Istanbul introducing Azure Functions as a Serverless Platform.

Daron Yondem

December 19, 2017
Tweet

More Decks by Daron Yondem

Other Decks in Technology

Transcript

  1. Serverless and Azure
    Functions Introduction
    Daron Yöndem
    http://daron.me
    @daronyondem

    View Slide

  2. Serverless architectures refer to applications that
    significantly depend on third-party services (knows as
    Backend as a Service or "BaaS") or on custom code
    that's run in ephemeral containers (Function as a
    Service or "FaaS")

    View Slide

  3. What is Serverless?
    • The real dream of PAAS
    • No Infrastructure, No Containers
    • Scalable as hell!
    • Granular Billing (GB/s)
    • No commitment, no hardware provisioning (really?)

    View Slide

  4. What’s wrong with containers?
    • Containers are the new VMs!
    • Server Patching > Container Image Batching
    • Container Orchestration is hard.

    View Slide

  5. Serverless != Microservices
    • You can have a fleet of EC2 instances, running containers,
    orchestrating and still worry about infrastructure.
    • You can have dozens of functions tightly coupled and
    delivered as a behemoth.

    View Slide

  6. Azure Functions 101
    • Javascript, C#, C# Script, Python, PHP, Batch, Powershell
    • Timer-based processing
    • SaaS Event Processing
    • Full Serverless Architecture
    • Real-Time Stream Processing
    • Real-Time Bot Messaging
    • Serverless mobile back-ends

    View Slide

  7. Creating our first “Hello World” function!
    DEMO

    View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. Out of the Box Authentication of
    HTTP Endpoints
    • Anonymous
    • Function Key
    • Host Key

    View Slide

  13. View Slide

  14. View Slide

  15. View Slide

  16. View Slide

  17. View Slide

  18. Anatomy of a Function
    • A “Run” file that containing the function code
    • A “Function” file containing all service and trigger bindings and
    parameters
    • A “Project” file containing project assembly and NuGet
    package references
    • App Service settings, such as connection strings and API keys

    View Slide

  19. Running Functions Locally
    V1 Only on Windows
    npm install -g azure-functions-core-tools
    V2 with .NET Core on all platforms
    npm install -g azure-functions-core-tools@core
    Initialize your first function
    func init MyFunctionProj

    View Slide

  20. Precompiled functions with C# and Visual Studio
    DEMO

    View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. Application Settings
    • local.settings.json will have all your local settings on
    the dev machine.
    • C# can also be read in your code as environment variables.
    Use System.Environment.GetEnvironmentVariable
    or ConfigurationManager.AppSettings.
    • In JavaScript, use process.env

    View Slide

  26. Where can I deploy my Functions?
    • Extend the existing Azure App Service platform
    • Go with “Consumption Plan” and be pure Serverless
    • Deploy Functions Runtime on an on-prem location in your
    Private Cloud.

    View Slide

  27. Links worth sharing
    Documentation
    • https://goo.gl/TqGtMr
    Azure Functions Runtime (Run on-prem)
    • https://goo.gl/hV7KgJ
    Documentation for the host.json file
    • https://goo.gl/W6kcV7
    More CLI commands to run functions locally
    • https://goo.gl/PSkqet

    View Slide

  28. Thanks
    http://daron.me | @daronyondem
    Download slides here;
    http://daron.me/decks

    View Slide