# Azure Deployment

## Summary of Steps <a href="#summary-of-steps" id="summary-of-steps"></a>

### Prerequisites <a href="#prerequisites" id="prerequisites"></a>

1. Set up an SMTP server. When a Gov is deploying care, the Gov should provide email gateway credentials along with domains.
2. Set up a Sentry project for error management.

### CARE Infrastructure Deployment <a href="#care-infrastructure-deployment" id="care-infrastructure-deployment"></a>

1. Create a Virtual Network.
2. Create a PostgreSQL Server. Create database and add PostGIS extension.
3. Create a S3 compatable storage (Since Azure Storage account does not support S3 API) and get credentials for the storage.
4. Create a private AKS cluster.
5. Create a VM instance as a jump server.
6. Create a VM instance as a bastion host, install VPN, and whitelist its IP in the jumpservers network security group.
7. Configure a self-hosted agent (linux) in the jumpserver for CI/CD pipelines.
8. Update configurations for each deployment in their corresponding YAML files.
9. Create the deployments using the CI/CD pipelines from Github.

### Metabase Deployment <a href="#metabase-deployment" id="metabase-deployment"></a>

1. Create a VM instance in the same VNET as CARE.
2. Create a PostgreSQL Server. Create a database for Metabase in it.
3. Create a read-replica of CARE Database for Metabase to read data from.
4. Follow the installation steps from the official documentation.
5. Create a load balancer and expose the service.
