Azure Functions lets you run event-driven code without managing servers. You pay only for what you use and Azure handles scaling automatically. This guide walks you from zero to a deployed, monitored function.
Prerequisites
| Requirement | Details |
|---|---|
| Azure subscription | Free trial includes $200 credit |
| Azure CLI | Install guide |
| VS Code | With Azure Functions extension |
| Node.js | 18 LTS or later |
How Azure Functions Works
Hosting Plan Comparison
Getting Started in 5 Steps
Step 1 — Install Azure Functions Core Tools:
# Windows (winget)
winget install Microsoft.Azure.FunctionsCoreTools
# macOS (Homebrew)
brew tap azure/functions
brew install azure-functions-core-tools@4
# Verify
func --version
Step 2 — Create your first function:
func init MyFunctionApp --worker-runtime dotnet-isolated
cd MyFunctionApp
func new --name HelloWorld --template "HTTP trigger" --authlevel anonymous
Step 3 — Run locally:
func start
# Listening on: http://localhost:7071
# Test: curl http://localhost:7071/api/HelloWorld?name=Azure
Step 4 — Deploy to Azure:
az login
az group create --name rg-functions-demo --location eastus
az storage account create --name safunctionsdemo --resource-group rg-functions-demo --sku Standard_LRS
az functionapp create \
--resource-group rg-functions-demo \
--consumption-plan-location eastus \
--runtime dotnet-isolated \
--runtime-version 8 \
--functions-version 4 \
--name fn-hello-world-demo \
--storage-account safunctionsdemo
func azure functionapp publish fn-hello-world-demo
Discussion