This project demonstrates how to deploy a Next.js application to Azure Container Apps using Infrastructure as Code (IaC) with Bicep templates. The sample showcases best practices for deploying containerized applications on Azure with proper security, monitoring, and scalability considerations.
The demo includes:
- Application: A simple Next.js calculator app containerized with Docker
- Infrastructure: Complete Azure infrastructure defined using Bicep templates
- Security: Managed Identity for secure access to Azure Container Registry
- Monitoring: Log Analytics workspace for application and infrastructure monitoring
- CI/CD Ready: Structure suitable for automated deployment pipelines
- Azure Container Registry (ACR): Stores container images
- Log Analytics Workspace: Centralized logging and monitoring
- Container Apps Environment: Hosting environment for container apps
- User-Assigned Managed Identity: Provides secure access to ACR without storing credentials
- Container App: Hosts the Next.js application with auto-scaling capabilities
Before deploying this sample, ensure you have:
- Azure CLI installed and configured
- Azure Resource Group created
- Required permissions
git clone <repository-url>
cd AzureContainerAppsEdit the variables in deploy.azcli:
RG=container-apps-demo # Your resource group name
LOCATION=westeurope # Your preferred Azure region
PROJECT_NAME=container-apps-demo # Project identifier
STAGE=dev # Environment stageOr execute step by step (see deploy.azcli):
- Deploy Managed Identity
- Deploy Central Infrastructure
- Build and Push Container Image
- Deploy Application
After deployment, find your application URL (e.g. using portal) and access it.