Why Serverless?
Not every workload needs a full VM or even a dedicated App Service. Many modern applications are event-driven, running only when triggered. Serverless compute allows you to build solutions that are:
-
Cost-efficient (pay-per-use).
-
Scalable (auto-scales with events).
-
Simpler to manage (no servers to patch or scale manually).
Azure provides three key serverless services: Functions, Logic Apps, and Event Grid.
1. Azure Functions
Definition:
-
A serverless compute service for running small pieces of code (“functions”) in response to events.
Key Features:
-
Triggers: HTTP requests, timers, queues, Event Grid events, Service Bus messages, etc.
-
Languages: C#, Python, JavaScript, Java, PowerShell.
-
Consumption Plan: scales automatically, pay only when code runs.
-
Premium/Dedicated Plan: for enterprise workloads with VNET integration.
Best Use Cases:
-
API endpoints or microservices.
-
File processing (e.g., image resizing, document parsing).
-
Real-time event handling (e.g., IoT messages).
2. Logic Apps
Definition:
-
A workflow automation service that integrates apps, data, and services using connectors.
Key Features:
-
Visual designer (low-code/no-code).
-
400+ connectors (Office 365, SAP, Salesforce, ServiceNow).
-
Supports complex workflows with conditions, loops, approvals.
-
Can integrate with Azure Functions for custom code.
Best Use Cases:
-
Business process automation (approvals, notifications).
-
System integrations (CRM ↔ ERP, HR apps ↔ payroll).
-
Event-driven workflows without coding.
3. Event Grid
Definition:
-
A fully managed event routing service.
Key Features:
-
Supports pub-sub pattern (publish/subscribe).
-
Event sources: Blob Storage, Resource Groups, IoT Hub, custom apps.
-
Event handlers: Functions, Logic Apps, Webhooks, Event Hubs.
-
Millions of events per second with low latency.
Best Use Cases:
-
Real-time alerts (e.g., blob upload triggers a Function).
-
Serverless integration of multiple services.
-
Event-driven architectures.
Design Considerations
-
Functions → Best for custom code execution triggered by events.
-
Logic Apps → Best for orchestrating workflows and integrating multiple systems.
-
Event Grid → Best for event routing and pub-sub architectures.
Best Practice: Combine them:
-
Event Grid raises events → Functions process them → Logic Apps orchestrate workflows.
Example Enterprise Scenario
A retail company wants to:
-
Trigger order processing when a new order is placed.
-
Send confirmation emails and update CRM.
-
Resize product images when uploaded to storage.
Correct design:
-
Use Event Grid to capture events (new order, image upload).
-
Trigger Azure Functions for processing (resize images, update inventory).
-
Use Logic Apps to orchestrate workflows (send email, update CRM).
Confusion Buster
-
Functions vs Logic Apps
-
Functions = code-based, dev-friendly.
-
Logic Apps = workflow-based, low-code.
-
-
Event Grid vs Event Hub
-
Event Grid = event routing, pub-sub (lightweight).
-
Event Hub = telemetry ingestion at massive scale (IoT, streaming).
-
-
Consumption vs Premium Function Plan
-
Consumption = cheap, scales automatically.
-
Premium = enterprise workloads, VNET integration.
-
Exam Tips
-
“Which service runs code only when triggered by events?” → Azure Functions.
-
“Which service automates workflows with 400+ connectors?” → Logic Apps.
-
“Which service delivers millions of events per second in pub-sub model?” → Event Grid.
-
“Company wants to process IoT telemetry in real-time at scale.” → Event Hub, not Event Grid.
What to Expect in the Exam
-
Direct Q: “Which Azure service is a workflow automation tool with built-in connectors?” → Logic Apps.
-
Scenario Q: “Company wants event-driven image processing when files are uploaded.” → Event Grid + Azure Functions.
-
Scenario Q: “Business process automation between SAP and Salesforce.” → Logic Apps.
-
Trick Q: “Azure Functions and Logic Apps are identical.” → False.