Azure Functions
Introduction
- Azure Functions is a serverless compute service that allows you to run event-driven code without provisioning or managing infrastructure.
- It supports multiple programming languages and integrates seamlessly with other Azure services.
Triggers and Bindings
Triggers:
- Triggers cause a function to run.
- A trigger defines how a function is invoked and a function must have exactly one trigger.
- Triggers have associated data, which is often provided as the payload of the function.
- Common Types:
- HTTP Trigger
- Time Trigger
- Blob Storage Trigger
- Queue Trigger
Bindings:
- Binding to a function is a way of declaratively connecting another resource to the function; bindings may be connected as input bindings, output bindings, or both.
- Data from bindings is provided to the function as parameters.
- Binding Types:
- Input Binding
- Output Binding
Pricing Plans
Consumption | Premium Plan | App Service |
---|---|---|
Billing: a. Number of Executions b. Executino Time c. Memory Used d. Free Quota per month | Billing: a. Number of Core Seconds b. Memory Used c. Pre-warmed instances | Billing: a. Pay for App Service resources |
Use Case: a. Apps requires scaling b. Intermittent traffic | Use Case: a. Apps that run continously b. Apps require more time | Use Case: a. Existing under-utilized VM’s b. Custom images to run functions |
Azure Function Benefits
Simplified Programming Model
- Easily run small pieces of code in cloud.
- Eliminate bolier plate code
Choice of Language
- Use it to run code in different programming languages
Pay-per-use Pricing Model
- Only pay for the time the code runs
Bring Your Own Dependencies
- NPM, NuGet and other package managers
Scales Automatically
- Parallel invocation to meet demand
Open Source Code
Docker Runtime
- Run function runtime in docker on premise or in other clouds
Serverless
Low Cost Prototyping
- Quickly creates prototypes at low cost
Programming Language Support
- Below are the supported lanaguages in Azure Functions:
- C#
- JavaScript
- F#
- Java
- Powershell
- Python
- TypeScript
Azure Function Authorization Levels
Anonymous
- No Key required.
- Function can be called by anyone on the internet.
Function
- Function or host key is required.
- Function is scoped to a specific function.
- Host key is scoped to all the functions within function app.
Admin
- Master Key required.
- Provides admin level privileges.
- Should not be shared or used in client applications.
Use Cases
API creation
- Quick secure API creation with HTTP triggers.
Serverless Mobile and Web Backend
- API, Databases, Queues, etc.
Real Time Stream Processing
- Analysis of telemetry data from cloud applications
IoT Data Processing
- Analysis of IOT stream data
ETL
This post is licensed under CC BY 4.0 by the author.