Azure Secure Web Application – Private PostgreSQL & Cloud Infrastructure
A modern web application on Azure combines a globally distributed frontend on Azure Static Web Apps, a backend API on Azure App Service, and a private Azure Database for PostgreSQL, all behind Azure Front Door. The database and API have no direct public exposure, secrets are held in Azure Key Vault and read through managed identities, users sign in with Microsoft Entra ID, and every code change is deployed automatically through GitHub Actions, giving teams a secure platform that is simple to operate and scale.

Benefits
uptime, backed by multi-AZ task placement and ECS automated recovery
faster deployment speed with automated blue/green pipelines
improvement in engineering team efficiency on AWS Fargate
PostgreSQL runs inside a virtual network with no public endpoint, reachable only from the API
The API reads every secret from Key Vault through a managed identity; nothing is stored in code or configuration files
Azure Front Door serves the frontend and API on one custom domain with managed TLS certificates
Users authenticate with their existing Microsoft work accounts through Microsoft Entra ID single sign-on
Frontend and backend deploy automatically from GitHub on every merge to the main branch
Scaling, restores, secret rotation, and log analysis are all done from the Azure portal without code changes
Overview
Many web applications start with the frontend, API, and database on publicly reachable endpoints, with connection strings and API keys kept in environment files or source code. The database accepts connections from the internet, protected only by a password, and each part of the application has its own domain and certificate. Deployments are manual, monitoring is limited to whatever the hosting platform shows by default, and users manage yet another set of credentials to sign in.
A layered Azure architecture addresses each of these problems. Azure Front Door becomes the single public entry point and routes requests to the frontend on Azure Static Web Apps and to the API on Azure App Service. The API connects to Azure Database for PostgreSQL over a private virtual network, network security groups restrict traffic between tiers, and Azure Key Vault supplies all secrets through a managed identity. Microsoft Entra ID handles user authentication, Application Insights and Log Analytics provide monitoring, and GitHub Actions deploys every change automatically.
About the Azure Platform Services
Azure Static Web Apps hosts modern JavaScript frontends, such as React, Angular, or Vue, from globally distributed content locations, with built-in TLS and GitHub integration. Azure App Service is a fully managed platform for running web APIs on Linux or Windows, with built-in scaling, deployment slots, virtual network integration, and managed identities. Azure Database for PostgreSQL Flexible Server is a fully managed PostgreSQL service with automated backups, point-in-time restore, and private networking. Azure Front Door provides a global edge entry point with TLS termination, routing, and caching. Azure Key Vault stores secrets, keys, and certificates, and Microsoft Entra ID provides identity and single sign-on. Application Insights and Log Analytics, part of Azure Monitor, collect telemetry and logs from every component.
Opportunity: Moving Beyond Publicly Exposed Applications
When every tier of an application is publicly reachable, a single leaked password or misconfiguration can expose the entire system. A database with a public endpoint is constantly probed by automated scanners, and an API that can be called directly bypasses any protection placed in front of it. Secrets copied into configuration files and deployment pipelines spread across laptops, servers, and repositories, and rotating them becomes a risky, manual task.
Operating the application is also harder than it should be. Deployments depend on individual engineers running manual steps, there is no single place to see errors and performance, and restoring data after a mistake requires specialist knowledge. For business users, a separate login for each application adds friction and creates another set of credentials to manage and secure.
Organizations in this position need an architecture where the database and API are private by default, secrets are managed centrally, users sign in with their existing corporate identity, and day-to-day operations can be carried out safely by the team that owns the application.
The Solution
Edge Layer with Azure Front Door
The custom domain points to Azure Front Door, which terminates HTTPS with an automatically issued and renewed managed certificate. Routes send API requests, such as those under /api, to the App Service origin and all other requests to the Static Web Apps origin, so the frontend and API share one domain and no cross-origin configuration is needed in the browser. A web application firewall policy can be attached to filter malicious traffic at the edge.
Frontend on Azure Static Web Apps
The single-page application is built and published to Azure Static Web Apps, which serves static assets from globally distributed locations. Each deployment replaces the site atomically, so users never see a partially updated version, and preview environments can be created for pull requests.
Backend API on Azure App Service
The API runs on Azure App Service on Linux in a managed App Service plan. It scales up to larger instances or out to multiple instances from the Azure portal, with scale-out requiring no downtime. Access restrictions on the App Service allow traffic only from the Azure Front Door service tag and verify the X-Azure-FDID header, so the API cannot be called directly on its platform hostname.
Private Networking
An Azure virtual network contains separate subnets for the application and the database. The App Service uses regional virtual network integration to send its outbound traffic into the application subnet, which allows it to reach the database privately. Network security groups on each subnet act as firewalls; the database subnet allows only the PostgreSQL port (5432) from the application subnet and blocks everything else.
Private Database on Azure Database for PostgreSQL
Azure Database for PostgreSQL Flexible Server is deployed with private access in a delegated subnet, with no public endpoint, and resolved through a private DNS zone. Data is encrypted at rest and TLS is enforced in transit. Automated backups with point-in-time restore protect against accidental changes, and a restore creates a new server so the existing one is never overwritten. Compute and storage can be scaled from the portal, with storage autogrow preventing the database from running out of space.
Secrets Management with Azure Key Vault
All sensitive configuration, including the database connection string, session and token signing keys, and identity provider credentials, is stored in Azure Key Vault. The App Service uses a system-assigned managed identity to read secrets through Key Vault references, so no passwords appear in code, configuration files, or the pipeline. Secrets are rotated by adding a new version in Key Vault and restarting the app.
Single Sign-On with Microsoft Entra ID
An Entra ID app registration enables users to sign in with their Microsoft work or school accounts using OpenID Connect. The app registration can accept users from a single organization or from multiple tenants, and its client secret is stored in Key Vault with a documented renewal process before it expires.
Monitoring with Application Insights and Log Analytics
Application Insights tracks request rates, response times, failures, and dependencies, with live metrics and full error details for troubleshooting. Application console and HTTP logs are sent to a Log Analytics workspace, where they are retained and queried with Kusto Query Language (KQL). Azure Monitor alert rules notify the team through action groups when failure rates or response times cross defined thresholds.
Automated Delivery with GitHub Actions
GitHub Actions workflows build and deploy the frontend and backend automatically whenever changes are merged to the main branch, and can also be run manually. Backend workflows run only when backend code changes, and database schema migrations run from inside the private network when the API starts, so the pipeline never needs direct database access. Workflows authenticate to Azure using OpenID Connect federated credentials, avoiding long-lived deployment secrets.
Operations Runbook
Common tasks, such as scaling the API or database, restoring data to a point in time, rotating secrets, renewing the SSO credential, changing the domain, and reviewing logs, are documented as step-by-step procedures in the Azure portal, so the owning team can operate the platform independently.
Results
No Public Path to the Data
The database has no public endpoint and accepts connections only from the application subnet, removing the most common route to a data breach.
API Protected Behind the Edge
All traffic reaches the API through Azure Front Door, and direct calls to the platform hostname are rejected.
Secrets Out of Code
Every credential lives in Key Vault and is read through a managed identity, so secrets can be rotated without code changes and never spread into repositories or pipelines.
Seamless Sign-In
Users access the application with their existing Microsoft accounts, and access is controlled through the organization’s identity platform rather than a separate password store.
Faster, Reliable Releases
Merging to the main branch deploys the frontend and backend automatically, removing manual deployment steps and keeping every release consistent.
Clear Visibility
Application Insights and Log Analytics show performance, errors, and logs in one place, with alerts when something goes wrong.
Easy to Operate and Scale
Scaling, restores, and secret rotation are handled from the Azure portal with documented steps, so the platform grows with demand without specialist intervention.
AWS Services Used
Core AWS building blocks powering high availability, elastic scaling, security, and automated deployments.
Azure Front Door
Global edge delivery and application routing terminating TLS and proxying requests to Static Web Apps and backend App Service origins.
Azure Static Web Apps
Managed frontend cloud hosting delivering client-side applications worldwide with automated GitHub Actions builds and edge caching.
Azure App Service
Enterprise-grade managed platform for running secure Linux backend web APIs with seamless regional VNet integration.
Azure Database for PostgreSQL Flexible Server
Fully managed PostgreSQL deployed inside a delegated private subnet with automated backups, encryption at rest, and zero public exposure.
Azure Virtual Network
Isolated virtual networking separating regional VNet integrated application subnets from private delegated database subnets.
Network Security Groups (NSGs)
Stateful network security firewalls enforcing strict traffic boundaries, allowing only PostgreSQL port 5432 from App Service subnets.
Azure Private DNS
Authoritative private DNS zone resolving internal database FQDNs exclusively inside the virtual network perimeter.
Azure Key Vault
Hardware-backed cloud security service managing database connection strings, JWT signing keys, and OIDC client secrets.
Managed Identities
System-assigned Microsoft Entra identities enabling seamless Key Vault reference injection without hardcoded credentials.
Microsoft Entra ID
Enterprise cloud identity and access management enabling secure corporate single sign-on via standard OIDC protocols.
Application Insights
Full-stack APM capturing live server metrics, request performance, dependency bottlenecks, and distributed exception logs.
Log Analytics + Azure Monitor Alerts
Centralized log aggregation workspace with proactive alert action groups notifying engineers when failure rates exceed thresholds.
GitHub Actions
CI/CD workflows deploying frontend and backend updates using OIDC federated credentials without storing long-lived keys.
Send Us a Message
Ready to bring your ideas to life? Tell us about your project and our team will get back to you within one business day.
Denver, CO 80231
