Deploying Rebase on Microsoft Azure
Microsoft Azure offers tight integrations and enterprise compliance. The optimal architecture for running Rebase on Azure involves using Azure Database for PostgreSQL - Flexible Server for the data layer and Azure Container Apps for hosting the backend container.
To adhere to European data compliance and fast local response times, provision your resources in regions like West Europe (Amsterdam), North Europe (Ireland), or France Central (Paris).
1. Provision PostgreSQL Flexible Server
Section titled “1. Provision PostgreSQL Flexible Server”- From the Azure Portal, search for and select Azure Database for PostgreSQL servers.
- Click Create and select Flexible Server.
- Choose your Resource Group and set your preferred EU Region.
- Select your Compute size (e.g., General Purpose or Burstable
B2sfor smaller deployments). - Setup the Authentication tab with an Admin username and a secure password.
- Under Networking, ensure “Allow public access from any Azure service within Azure to this server” is checked so your Container App can connect, or configure a secure VNet.
- Note down your server name and assemble the connection URI:
postgresql://your_admin:YOUR_PASSWORD@your-server-name.postgres.database.azure.com:5432/postgres
2. Build and Push to Azure Container Registry (ACR)
Section titled “2. Build and Push to Azure Container Registry (ACR)”Azure Container Apps will pull your Docker image from ACR.
- Create a new Container Registry in your chosen EU region.
- Login from your CLI:
az acr login --name YourRegistryName
- Build and push the Rebase image from your local repository:
docker build -t yourregistryname.azurecr.io/rebase-backend:latest ./backenddocker push yourregistryname.azurecr.io/rebase-backend:latest
3. Deploy Azure Container App
Section titled “3. Deploy Azure Container App”Azure Container Apps provides a serverless container environment with built-in HTTPS ingress.
- Search the portal for Container Apps and click Create.
- Create a new Container Apps Environment in your EU region.
- In the Container tab, point to your ACR registry and select the
rebase-backend:latestimage. - Set the Environment variables:
| Name | Value |
|---|---|
DATABASE_URL | Your Azure Postgres connection string |
JWT_SECRET | A Secure random 32+ character string |
NODE_ENV | production |
- Under the Ingress tab, explicitly Enable Ingress.
- Set the Target Port to 3001.
- Complete the creation. Azure will automatically provision the container and provide you an Application URL secured with TLS!