Migration Guide — Overview
Application: MOC & PCR Management System
Infrastructure: Microsoft Azure
Audience: IT Administrator / System Owner / DevOps Engineer
What This Guide Covers
This section walks through the complete process of setting up all external services and deploying the MOC-PCR system from scratch. Each guide is self-contained but must be completed in the order shown below, because later steps depend on values produced by earlier ones.
Setup Order
| Step | Guide | What It Sets Up |
|---|---|---|
| 1 | MongoDB Atlas Setup | Cloud database with private network access |
| 2 | Azure SSO Setup | Microsoft single sign-on authentication |
| 3 | Azure Blob Storage Setup | File upload and storage |
| 4 | Azure Email Setup | Transactional email via Microsoft Graph |
| 5 | Docker Deployment | Container build and hosting on Azure |
Do not skip steps. The Docker deployment guide consolidates all environment variables produced by steps 1–4. Skipping any step will result in an incomplete or broken deployment.
Infrastructure Overview
┌─────────────────────────────────────────────────────────────┐
│ MOC-PCR System Stack │
│ │
│ ┌──────────────────────────────────────────────────────┐ │
│ │ Azure Container Apps (Docker — Node.js 20) │ │
│ └────────┬──────────┬──────────┬──────────┬────────────┘ │
│ │ │ │ │ │
│ ┌─────▼──┐ ┌────▼───┐ ┌──▼─────┐ ┌──▼──────────┐ │
│ │MongoDB │ │ Azure │ │ Azure │ │ Microsoft │ │
│ │ Atlas │ │ SSO │ │ Blob │ │ Graph Email │ │
│ │ M10 │ │(Entra) │ │Storage │ │ API │ │
│ └────────┘ └────────┘ └────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────┘
Environment Variables Produced
Each guide produces one or more environment variables. Here is the complete list for reference:
| Variable | Produced by |
|---|---|
REMOTE_URL | MongoDB Atlas Setup |
AZURE_TENANT_ID | Azure SSO Setup |
AZURE_CLIENT_ID | Azure SSO Setup |
AZURE_CLIENT_SECRET | Azure SSO Setup |
APP_URL | Azure SSO Setup |
JWT_SECRET | Azure SSO Setup |
AZURE_STORAGE_ACCOUNT_NAME | Azure Blob Storage Setup |
AZURE_STORAGE_ACCOUNT_KEY | Azure Blob Storage Setup |
AZURE_STORAGE_CONTAINER | Azure Blob Storage Setup |
EMAIL_PROVIDER | Azure Email Setup |
GRAPH_MAIL_SENDER | Azure Email Setup |
HSEQ_EMAIL | Application configuration |
The SSO and email guides share the same Azure app registration.
AZURE_TENANT_ID,AZURE_CLIENT_ID, andAZURE_CLIENT_SECRETare set up once in the SSO guide and reused by the email guide.
Prerequisites
Before starting, ensure you have:
- An active Microsoft Azure subscription with admin access
- A MongoDB Atlas account (or permission to create one)
- Access to your organization's DNS records (for the custom domain)
- The application source code repository
- Docker installed on the build machine
Estimated Setup Time
| Step | Estimated Time |
|---|---|
| MongoDB Atlas + private endpoint | 30–45 minutes |
| Azure SSO | 15–20 minutes |
| Azure Blob Storage | 10–15 minutes |
| Azure Email | 10–15 minutes |
| Docker build and deployment | 20–30 minutes |
| Total | ~90 minutes |
Last updated: March 2026