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

Serverless Single Page Apps on Azure

Daron Yondem
February 19, 2019

Serverless Single Page Apps on Azure

This is a presentation introducing Azure Storage and Azure Functions as a SPA hosting environment. When you add some CDN and API Management onto the stack it is just beautiful and still all serverless and on the consumption plan (no pay for no use).

Daron Yondem

February 19, 2019
Tweet

More Decks by Daron Yondem

Other Decks in Technology

Transcript

  1. Serverless
    Single Page Apps
    on Azure
    Daron Yöndem
    http://daron.me
    @daronyondem

    View Slide

  2. Hosting something in Azure?
    • Virtual Machine
    • Kubernetes (AKS)
    • Docker / Containers (ACI)
    • App Service Plans
    • Cloud Services
    • Anything else left out there?

    View Slide

  3. What you really need for a SPA?
    • Static file hosting
    • Maybe some APIs?

    View Slide

  4. What you really need for a SPA?
    • Static file hosting > Azure Storage
    • Maybe some APIs? > Serverless Sauce (Azure Functions)

    View Slide

  5. Let’s get some storage!
    DEMO

    View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. Storage Account Limits

    View Slide

  11. What about getting some CDN Magic?
    DEMO

    View Slide

  12. What
    about
    adding
    a CDN?

    View Slide

  13. Don’t forget to change to origin!

    View Slide

  14. View Slide

  15. Getting a custom domain

    View Slide

  16. View Slide

  17. After the domain name is validated,
    it can take up to 6-8 hours for the custom
    domain HTTPS feature to be activated.

    View Slide

  18. Premium for more!
    • HTTP to HTTPS redirection
    • Analytics
    • URL Rewrite
    • And some more goodies

    View Slide

  19. So far….
    • Hosting for our static files
    • CDN in front of it
    • HTTPS Enabled

    View Slide

  20. API for the Contact Form
    • Will use SendGrid to send e-mail.
    • Need an endpoint to pass contact form content.
    • Need it to be protected against abuse.

    View Slide

  21. Setting up the Contact Form
    DEMO

    View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. View Slide

  27. View Slide

  28. View Slide

  29. View Slide

  30. Homework for you!
    • What if someone abused our mailing endpoint?
    • Use Azure API Management Consumption Plan for Request
    Throttling!

    View Slide

  31. Resources
    • Storage Account Limits: https://drn.fyi/2NbC7Um
    • Increasing Storage Account Limits: https://drn.fyi/2NdO8Zp
    • Custom Domain Mapping for CDN: https://drn.fyi/2GQ1D0c
    Advanced request throttling with Azure API Management:
    https://drn.fyi/2Xbphdr

    View Slide

  32. Thanks
    http://daron.me | @daronyondem
    Download slides here;
    http://daron.me/decks
    Sample code here;
    https://drn.fyi/2XbzK8D

    View Slide