This document details the infrastructure of the CulinaryPlatform on Azure, deployed using Terraform, and outlines the continuous integration and continuous deployment (CI/CD) strategy powered by GitHub Actions.
The infrastructure is deployed within a specified resource group (staging / production) in the northeurope region, focusing on private networking isolation for the database layer.
The networking topology is defined in the network.tf file:
- Virtual Network (VNet):
culinary-vnet (10.0.0.0/16). - Subnets:
app-subnet (10.0.1.0/24): Delegated for Azure Web Apps.postgresql-subnet (10.0.2.0/24): Delegated for PostgreSQL Flexible Server.
- Private DNS Zone:
privatelink.postgres.database.azure.com, linked to the VNet for secure access.
- Configuration is defined in the
main.tffile: - App Service Plan: A shared plan (B_Standard_B1ms SKU, Linux) is used for both applications. Note the SKU is BStandard
- App Service (Backend): Azure Linux Web App, integrated into the
app-subnet. - App Service (Frontend): Azure Linux Web App, integrated into the
app-subnet, withalways_on = trueenabled. - PostgreSQL Flexible Server:
- Version
14. - Private Access: Public network access is disabled
(public_network_access_enabled = false). Access is strictly limited to the VNet private network.
- Version
Application deployment and infrastructure management are fully automated using GitHub Actions.
The following secrets MUST be added to the GitHub repository settings for successful execution of all CI/CD pipelines.
| Secret Name | Purpose |
|---|---|
DBLOGIN |
PostgreSQL administrator login (used by applications). |
DBPASSWORD |
PostgreSQL administrator password (used by applications). |
AZURE_CLIENT_ID |
Client ID for the Azure Service Principal. |
AZURE_CLIENT_SECRET |
Client Secret for the Azure Service Principal. |
AZURE_SUBSCRIPTION_ID |
Azure Subscription ID. |
AZURE_TENANT_ID |
Azure Tenant ID. |
AZURE_PUBLISH_PROFILE_FRONTEND_STAGING |
Publish Profile for the Staging Frontend App Service. |
AZURE_PUBLISH_PROFILE_BACKEND_STAGING |
Publish Profile for the Staging Backend App Service. |
AZURE_PUBLISH_PROFILE_FRONTEND_PROD |
Publish Profile for the Production Frontend App Service. |
AZURE_PUBLISH_PROFILE_BACKEND_PROD |
Publish Profile for the Production Backend App Service. |
- Staging Environment
- Testing: Create a Pull Request (PR) targeting the
stagingbranch. - Deployment (CD): Merging into
stagingtriggers deployment to the Staging environment.
- Testing: Create a Pull Request (PR) targeting the
- Production Environment
- Promotion: Merge the
stagingbranch into themainbranch. - Deployment (CD): Changes in
mainare deployed to Production.
- Promotion: Merge the
Important
The main branch must only receive changes from the staging branch. This ensures a successful promotion flow.
Deployment (apply) and Destruction (destroy) of the Terraform infrastructure MUST be performed manually through the GitHub Actions interface using the workflow_dispatch trigger.
Variables added to facilitate the build process using Oryx:
ENABLE_ORYX_BUILD: trueSCM_DO_BUILD_DURING_DEPLOYMENT: true
A CORS (Cross-Origin Resource Sharing) policy has been added to the Backend Web App to allow secure communication with the Frontend.

