Azure Functions
What is Azure Functions?
Azure Functions is a serverless compute service that lets you run event‑driven code without having to explicitly provision or manage infrastructure. Write a function in the language of your choice, configure triggers and bindings, and let Azure handle scaling, patching, and availability.
Key Benefits
- Pay‑only‑for‑what‑you‑use pricing model.
- Automatic scaling based on workload demand.
- Built‑in integrations with over 200 Azure services.
- Supports multiple languages: C#, JavaScript, Python, PowerShell, Java, and more.
- Rapid development with local debugging and CI/CD pipelines.
Quickstart: Create a Function in the Portal
- Sign in to the Azure portal.
- Select Create a resource → Compute → Function App.
- Configure the basic settings (subscription, resource group, name, runtime stack).
- Click Review + create and then Create.
- Once deployed, open the Function App and click + Add → HTTP trigger.
- Give the function a name, leave the default Authorization level, and click Create.
Test the function:
curl https://<your-function-app>.azurewebsites.net/api/<function-name>
Sample Function (JavaScript)
module.exports = async function (context, req) {
const name = (req.query.name || (req.body && req.body.name)) || "world";
context.res = {
status: 200,
body: `Hello, ${name}!`
};
};
This HTTP‑triggered function returns a personalized greeting. Deploy it via Visual Studio Code or Azure CLI.