By Abhishek Kumar — Azure Expert | Technical Architect

🚀 Build → Containerize → Deploy → Scale
This is the journey we’re taking today with Azure Functions, Azure Kubernetes Service, and Azure DevOps—all working in harmony to turn your code into a production-ready microservice.

Whether you’re starting with serverless or transitioning to microservices, this guide helps you bridge both worlds.

✅ Prerequisites

Before diving in, ensure you have:

  • An Azure account
  • An Azure DevOps project
  • VS Code or any IDE
  • Docker installed locally
  • Azure CLI and AKS CLI tools
  • kubectl installed

📁 Step 1: Project Folder Structure

Let’s define a clean structure:

⚙️ Step 2: Create Your Azure Function

Use the Azure Functions Core Tools:

This will generate a simple HTTP-triggered function.

Example __init__.py:

📦 Step 3: Add Requirements and Host File

requirements.txt:

host.json:

🐳 Step 4: Add Docker Support

Dockerfile (at root level):

FROM mcr.microsoft.com/azure-functions/python:4-python3.9

ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=true

COPY . /home/site/wwwroot
RUN pip install -r /home/site/wwwroot/requirements.txt

This tells Docker how to build your function app inside a container.

☸️ Step 5: Create Kubernetes Deployment Files

kubernetes/deployment.yaml:

kubernetes/service.yaml:

🏗️ Step 6: Azure DevOps CI/CD Pipeline Setup

Create a new pipeline:

Inside .azure-pipelines/azure-pipelines.yml

🔐 Don’t forget to create a service connection in Azure DevOps for both ACR and AKS.

🧪 Step 7: Run and Validate

Once you commit your changes:

  • The pipeline will:
    • Build the Docker image
    • Push it to ACR
    • Deploy it to AKS

You can check your deployment using:

You’ll receive an external IP from the LoadBalancer service. Hit the URL:

You’ll see: Hello Abhishek! 🎉

🔁 Optional Enhancements

  • Enable horizontal pod autoscaler.
  • Add monitoring using Azure Monitor or Prometheus.
  • Add secrets via Azure Key Vault.
  • Use Helm instead of raw YAML.
  • Split dev/stage/prod using environments or namespaces.

📌 Summary

StepWhat You Did
✅ 1Created Azure Function
✅ 2Containerized it using Docker
✅ 3Wrote Kubernetes YAMLs
✅ 4Set up Azure DevOps pipeline
✅ 5Pushed and deployed to AKS

🎙️ Abhishek’s Take

As developers, we often get caught between writing clean code and wrestling with infrastructure. What I love about this approach—using Azure Functions with Docker, AKS, and Azure DevOps—is how seamlessly it bridges serverless innovation with Kubernetes power.

You’re not forced to choose between rapid development and production-grade scalability. You get both.

💡 Build once. Containerize fast. Deploy anywhere. That’s the future—and AKS makes it real, even for solo developers or small teams.

This setup empowers new developers to think in microservices, CI/CD, and automation from day one—skills that scale with your career. Start simple, and let Azure scale the rest.

Let’s build smart. Let’s deploy smarter.
🚀 See you on the cloud-native path!

Abhishek Kumar

Posted in , , ,

Leave a comment