This guide covers deploying Azure IPAM using Docker containers.
- Docker Engine 20.10+
- Docker Compose v2.0+
- Azure Service Principal with Reader access
- Azure AD App Registration for frontend authentication
cd deploy/docker
cp .env.example .envEdit .env with your Azure credentials:
# Service Principal for API
AZURE_TENANT_ID=your-tenant-id
AZURE_CLIENT_ID=your-sp-client-id
AZURE_CLIENT_SECRET=your-sp-secret
# App Registration for Frontend
VITE_AZURE_TENANT_ID=your-tenant-id
VITE_AZURE_CLIENT_ID=your-app-registration-client-id# Build images
docker-compose build
# Start services
docker-compose up -d
# View logs
docker-compose logs -f- Frontend: http://localhost:8080
- API: http://localhost:7071/api
┌─────────────────────────────────────────────────────────────┐
│ Docker Network │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Frontend │───▶│ API │───▶│ Azure │ │
│ │ (Nginx) │ │ (Functions) │ │ Resources │ │
│ │ :8080 │ │ :7071 │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ │
│ │
└─────────────────────────────────────────────────────────────┘
| Variable | Description | Required |
|---|---|---|
AZURE_TENANT_ID |
Azure AD tenant ID | Yes |
AZURE_CLIENT_ID |
Service Principal client ID | Yes |
AZURE_CLIENT_SECRET |
Service Principal secret | Yes |
AZURE_SUBSCRIPTION_IDS |
Comma-separated subscription IDs (optional) | No |
VITE_AZURE_TENANT_ID |
Tenant ID for frontend auth | Yes |
VITE_AZURE_CLIENT_ID |
App Registration client ID | Yes |
To include the Azure Storage emulator (Azurite):
docker-compose --profile local up -d# Build images
docker-compose build
# Start in background
docker-compose up -d
# View logs
docker-compose logs -f
# Stop services
docker-compose down
# Remove volumes (reset data)
docker-compose down -v
# Rebuild specific service
docker-compose build api
docker-compose up -d api- Use Docker secrets instead of environment variables for sensitive data
- Enable HTTPS with a reverse proxy (Traefik, nginx-proxy, etc.)
- Restrict network access using Docker network policies
For high availability, consider:
# Scale API instances (behind load balancer)
docker-compose up -d --scale api=3Add monitoring with:
services:
prometheus:
image: prom/prometheus
# ... configuration
grafana:
image: grafana/grafana
# ... configuration# Check logs
docker-compose logs api
# Verify Azure credentials
docker-compose exec api env | grep AZURE# Check network connectivity
docker-compose exec frontend wget -O- http://api:7071/api/health
# Verify nginx config
docker-compose exec frontend cat /etc/nginx/nginx.conf- Verify App Registration redirect URIs include
http://localhost:8080 - Check browser console for MSAL errors
- Ensure tenant ID matches in both API and frontend configs
To push to a container registry:
# Tag images
docker tag azure-ipam-api:latest myregistry.azurecr.io/azure-ipam-api:v1.0.0
docker tag azure-ipam-frontend:latest myregistry.azurecr.io/azure-ipam-frontend:v1.0.0
# Push to registry
docker push myregistry.azurecr.io/azure-ipam-api:v1.0.0
docker push myregistry.azurecr.io/azure-ipam-frontend:v1.0.0