Serverless Made Simple: My First Azure Function
If you don’t want to manage servers but still want to run code, Azure Functions is the way to go. It allows you to run code only when needed. Here’s how I did it:
Zero-to-Function:
Create Function App: In Portal: "Create resource" > "Function App" Name it (e.g., "myfirstfunction") Select runtime (Node.js is easiest) Choose region
Add Your First Function: After creation, click "Functions" > "Create" Select "HTTP trigger" Name it "HiWorld"
Write Simple Code: Replace the default code with:
module.exports = async function (context, req) {
context.res = {
body: "Hello from Nigeria!"
};
}
Click "Save"
Test It: Click "Get function URL" Paste in browser - you'll see your message!
Now you have a scalable API endpoint!