SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
Presentation on deep dive into developing serverless REST API on Azure functions with a real-time example, explore tooling options, testing and deploying alongside a discussion on different ways of securing the APIs.
Presentation on deep dive into developing serverless REST API on Azure functions with a real-time example, explore tooling options, testing and deploying alongside a discussion on different ways of securing the APIs.
1.
Serverless API with
Azure Functions
Analben Mehta
14+ years of experience in designing and developing enterprise applications
https://aanuwizard.com
@aanuwizard
2.
Agenda
1. What is Serverless?
2. Azure Functions – Intro
3. Demo – Hello World
4. Tooling options, test and deploy
5. Demo – Real-time app
6. Azure functions Proxies
7. Demo -Proxies
8. Securing azure functions
9. Serverless Mindset
10.
Supported Bindings
Type Service Trigger Input Output
Timer/Schedule Azure Functions ✔
HTTP (REST or WebHook) Azure Functions ✔ ✔
Blob Storage Azure Storage ✔ ✔ ✔
Queues Azure Storage ✔ ✔
Tables Azure Storage ✔ ✔
NoSQL DB Azure CosmosDB ✔ ✔ ✔
Streams Azure Event Hubs ✔ ✔
Push Notifications Azure Notification Hubs ✔
Bot Framework(Preview) Azure Bot Service ✔
Twilio SMS Text Twilio ✔
SendGrid E-Mail SendGrid ✔
Excel Tables Microsoft Graph ✔ ✔
OneDrive Files Microsoft Graph ✔ ✔
Outlook E-Mail Microsoft Graph ✔
Microsoft Graph Events Microsoft Graph ✔ ✔ ✔
Auth Tokens Microsoft Graph ✔
(* The HTTP output binding requires an HTTP trigger.)
11.
Supported Languages
Languages:
JavaScript, C#, F#
scripting options such as Python, PHP, Bash, Batch,
and PowerShell
Experimental support
.NET Core
Linux Containers
Java
13.
Functions pricing
Regular App Service plan
Consumption Plan
Meter Price Free Grant (Per Month)
Execution time* £0.000012/GB-s 400,000 GB-s
Total executions*
£0.15 per million
executions
1 million executions
14.
Azure Functions – Develop your way
Code directly in Azure portal
Code in Visual Studio 2017 15.5 or later
Install “Azure Development” workload
Includes tooling to create Azure Function projects and
classes locally and publish
Includes Azure CLI (Command Line Interface) which
allow you to run and debug your functional locally.
Azure Functions extension for Visual Studio Code
16.
Demo: Booking application – unit
test, pre-compile and deploy
17.
Why choose pre-compiled functions?
Develop, debug and test locally
Better performance when starting cold.
18.
Azure Functions Proxy
Light weight API management
Have multiple function apps under a single API
surface.
Mock APIs for developers!
Request/Response override
Cheaper (pay per use)
21.
Demo: Azure Function Proxy –
Override Response
22.
Demo: Azure Function Proxy
Serving static content
23.
Securing Azure Functions
Use functions key
Use in-built authentication with Azure active
directory and other identity service provider
like Microsoft login, Gmail login etc.
Use custom identity provider
Create IP based rules in API gateway
Use function proxy to override request
24.
Serverless Mindset
Don’t overdo it
It may not be the right choice for all
applications
Find the piece of functionality that you can
isolate, reuse which need high scalability, fast
development
mock api to support frontend development
Make your function simple, stateless and
focus on 1 thing per function.