Skip to main content

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

StepGuideWhat It Sets Up
1MongoDB Atlas SetupCloud database with private network access
2Azure SSO SetupMicrosoft single sign-on authentication
3Azure Blob Storage SetupFile upload and storage
4Azure Email SetupTransactional email via Microsoft Graph
5Docker DeploymentContainer 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:

VariableProduced by
REMOTE_URLMongoDB Atlas Setup
AZURE_TENANT_IDAzure SSO Setup
AZURE_CLIENT_IDAzure SSO Setup
AZURE_CLIENT_SECRETAzure SSO Setup
APP_URLAzure SSO Setup
JWT_SECRETAzure SSO Setup
AZURE_STORAGE_ACCOUNT_NAMEAzure Blob Storage Setup
AZURE_STORAGE_ACCOUNT_KEYAzure Blob Storage Setup
AZURE_STORAGE_CONTAINERAzure Blob Storage Setup
EMAIL_PROVIDERAzure Email Setup
GRAPH_MAIL_SENDERAzure Email Setup
HSEQ_EMAILApplication configuration

The SSO and email guides share the same Azure app registration. AZURE_TENANT_ID, AZURE_CLIENT_ID, and AZURE_CLIENT_SECRET are 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

StepEstimated Time
MongoDB Atlas + private endpoint30–45 minutes
Azure SSO15–20 minutes
Azure Blob Storage10–15 minutes
Azure Email10–15 minutes
Docker build and deployment20–30 minutes
Total~90 minutes

Last updated: March 2026