Teja Surendar Reddy
DevOps Engineer | Cloud Enthusiast
📧 Email: ktsreddy007@gmail.com
SimpleTimeService is a lightweight microservice built in C# (.NET 8) that returns the current timestamp (India Standard Time) and the visitor's IP address in JSON format.
- Containerized using Docker with a non-root user
- Image hosted on DockerHub:
ktsreddy/teja_particle41_devops-challenge:v1.0 - Deployed to Azure Container Apps via modular Terraform
- Integrated with a private subnet inside a custom VNet
https://teja-aca--z3o5mig.purplemoss-d4634061.southindia.azurecontainerapps.io/
Note: The domain may vary depending on your Azure configuration.
{
"timestamp": "<User current date & Time>",
"ip": "<visitor's IP address>"
}| Layer | Technology |
|---|---|
| Language | C# (.NET 8) |
| Architecture Pattern | Microservice |
| Containerization | Docker (multi-stage, non-root) |
| Cloud Provider | Microsoft Azure |
| Deployment | Azure Container Apps (Serverless) |
| Infra-as-Code | Terraform (modular architecture) |
| Container Registry | Docker Hub |
PARTICLE41_DEVOPS_CHALLENGE/
├── SimpleTimeService_app/ # C# Source Code
│ ├── bin/
│ ├── obj/
│ ├── Controllers/
│ │ └── TimeController.cs
│ ├── Properties/
│ ├── .dockerignore
│ ├── appsettings.Development.json
│ ├── appsettings.json
│ ├── Dockerfile
│ ├── Program.cs
│ ├── SimpleTimeService.csproj
│ ├── SimpleTimeService.http
│ └── SimpleTimeService.sln
├── terraform/ # Terraform IaC setup
│ ├── env/ # Environment-specific configs & root module
│ │ └── dev/ # Execute your terraform commands from here
│ │ ├── .terraform/
│ │ ├── .env
│ │ ├── .env.template
│ │ ├── main.tf
│ │ ├── outputs.tf
│ │ ├── terraform.tfstate
│ │ ├── terraform.tfvars
│ │ ├── terraform.tfvars.example
│ │ └── variables.tf
│ ├── modules/ # Reusable modules
│ │ ├── container_app/
│ │ ├── network/
│ │ └── resource_group/
│ └── .gitignore
├── Particle41_DevOps_Challenge.sln
├── images # Architecture & output screenshots
└── README.md
| Tool | Purpose | Install Link |
|---|---|---|
| Azure CLI | Login, create service principal | Install Azure CLI |
| Terraform | Provision cloud infrastructure | Install Terraform |
| Docker | Build container image | Install Docker |
| DockerHub | Push cotainer image | Login into DockerHub |
| Azure Account | Required to provision resources | Azure Free Tier |
- Login to Azure CLI:
az login- Create Service Principal for Terraform:
az ad sp create-for-rbac --name "Your_sp_name" --role="Contributor" --scopes="/subscriptions/<your-subscription-id>" --sdk-auth- Get below details and save in .env file :
ARM_CLIENT_ID=<appId>
ARM_CLIENT_SECRET=<password>
ARM_SUBSCRIPTION_ID=<subscriptionId>
ARM_TENANT_ID=<tenant>- Register core resource providers at susbscription level in azure for Az Container apps
az provider register --namespace Microsoft.App
az provider register --namespace Microsoft.OperationalInsights
az provider register --namespace Microsoft.Insights
az provider register --namespace Microsoft.Network
az provider register --namespace Microsoft.ContainerRegistry
az provider register --namespace Microsoft.Logz
az provider register --namespace Microsoft.ManagedIdentity
az provider register --namespace Microsoft.Monitor
az provider register --namespace Microsoft.Web- Check the status of registered resource provider
az provider show --namespace Microsoft.App --query "registrationState"- 🔧 Build & Push Image to Docker Hub
cd SimpleTimeService_app
docker build -t simpletimeservice . # Building 1st locally with no custom tag
docker tag simpletimeservice ktsreddy/teja_particle41_devops-challenge:v1.0 #tag the localdocker image with dockerhubrepo:v1.0
docker push ktsreddy/teja_particle41_devops-challenge:v1.0 # Pushing the tagged image to the remote dockerhub repo docker pull ktsreddy/teja_particle41_devops-challenge:v1.0- 📂Navigate to Terraform Environment Folder
cd terraform/env/dev- 🔄Configure Variables by editing terraform.tfvars or create a new file using:
cp terraform.tfvars.example terraform.tfvarsNote: Update the values as per your Azure setup(resource group, image name, subnet names, etc.).
- ⚙️Run Terraform Commands
terraform init
terraform validate
terraform plan -out=tfplan or terraform plan
terraform apply tfplan or terraform apply✅ This will provision:
- Resource Group: Tejarg
- VNet with 2 public & 2 private subnets
- Azure Container App Environment: teja-aca-env
- Container App: teja-aca (with public ingress)
- VNet integration (private subnet)
Provisioned Azure Resources:
Tejarg(Resource Group)tejavnet(Virtual Network with 4 subnets(2 Private,2 Public))teja-aca-env(Container App Environment)teja-aca(Container App)kubernetesload balancer (default from AKS infra via Az Container App)aks-agentpool-*NSG (auto-generated)
Note : You may see AKS-related resources like load balancers, NSGs automatically generated. This is normal when using Azure Container Apps with VNet integration.

Azure_Resources: These are provisioned resources we will see once terraform has deployed

Azure_Resources: This is the interal network arcitecture how the ACA works with default K8 loadbalancer and NSG's

ACA Log: It shows that our container is pulled and runnng successfully in ACA Log on Azure.
curl https://teja-aca--z3o5mig.purplemoss-d4634061.southindia.azurecontainerapps.io/Expected output:
- The Container App uses built-in ingress to expose the service publicly.So we didnt setup additional API Gateway.
- The infrastructure adheres to best practices including use of:
- Implemented
conditional startup with manual logging logicat application code level - Private subnet integration
- Its completely
serverless Modular,reusableTerraform code- Secure
non-root Docker container
- Implemented
- ✅ Docker image runs as non-root user (
USER myuser) - ✅ Ingress HTTPS automatically enabled (Azure-managed) via Azure
- ✅ IP address masking if needed can be applied using Application Gateway or header filtering (didn't implemented)
Feel free to reach out:
📧 ktsreddy007@gmail.com
