An Azure managed PostgreSQL database service for app development and deployment.
Npgsql VerifyFull authenticates the certificate chain and the hostname supplied in the connection string; it does not cryptographically bind the session to a particular Azure resource ID, subscription, tenant, private IP, or historical server instance.
What VerifyFull guarantees
For a connection such as:
var cs = new NpgsqlConnectionStringBuilder
{
Host = "myserver.postgres.database.azure.com",
Database = "appdb",
Username = "appuser",
Password = password,
SslMode = SslMode.VerifyFull
}.ConnectionString;
await using var connection = new NpgsqlConnection(cs);
await connection.OpenAsync();
VerifyFull requires TLS, validates the server certificate to a trusted CA, and verifies that the certificate matches myserver.postgres.database.azure.com.^1^
Consequently:
- Redirecting DNS to an endpoint that cannot present a trusted certificate valid for that hostname causes TLS validation to fail.
- Redirecting the IP while retaining the original hostname does not by itself defeat
VerifyFull; the endpoint must still satisfy certificate-chain and hostname validation. -
VerifyFulldoes not inspect the Azure Resource Manager resource ID. - TLS validates the service name represented by the certificate—not which private DNS record, VNet, subnet, subscription, or Flexible Server resource produced the address.
The available documentation does not state that every Flexible Server receives a certificate containing a unique, immutable resource identity, nor that a certificate matching its FQDN can only ever be presented by one backend. Therefore, an exclusive-resource guarantee cannot be inferred from VerifyFull alone, including when TLS terminates on shared service infrastructure.
Database authentication is an additional check, but it authenticates the supplied PostgreSQL or Microsoft Entra credentials under the server reached; it does not turn the TLS certificate into an Azure resource-ID assertion.
What prevents unintended redirection
The complete boundary is layered:
| Layer | What it establishes |
|---|---|
VerifyFull |
Trusted certificate chain and hostname match |
| Private DNS | Which private address the FQDN resolves to |
| VNet routing/peering | Which endpoint is reachable from the client |
| NSGs and route tables | Which network paths and port 5432 flows are allowed |
| PostgreSQL/Entra authentication | Whether the principal can sign in to the reached server |
| Azure control-plane governance | Who can change DNS, networking, delete, restore, or recreate resources |
With VNet integration, Azure Private DNS supplies resolution inside linked VNets. DNS-zone links and VNet peering are independent; clients in another VNet need access to the server’s Private DNS zone. Custom DNS must forward Flexible Server FQDN resolution to Azure DNS, and routing/NSGs remain separate from name resolution.^2^
For a stronger operational guarantee:
- Use the server’s official FQDN as
Host; do not connect by raw private IP. - Set
SslMode=VerifyFull. - Trust Azure’s supported root CAs, not an intermediate or individual server certificate.
- Restrict modification of the linked Private DNS zone, VNet links, route tables, NSGs, and server resource through Azure RBAC.
- Monitor those resources for control-plane changes.
- Use a resource lock to reduce accidental server deletion; Microsoft explicitly recommends one for that purpose.^3^
- If the application must detect that it reached a particular logical deployment, perform an application-level check after login—for example, query a deployment identifier stored in a protected table—and reject an unexpected value. That is an application control, not a TLS guarantee.
Rotation, restore, revival, and name reuse
Certificate rotation: The hostname-and-CA guarantee continues when configured as recommended. Maintain Azure’s complete supported root set and do not pin an intermediate or leaf/server certificate. Intermediate and server-certificate rotations are routine and may be unannounced; pinning them is unsupported and can cause connection failures.^4^
Point-in-time restore: A restore provisions a new server, and its chosen unique name forms its FQDN. VerifyFull authenticates that resulting hostname; it does not prove that the new resource is the same Azure resource or has the intended restored data.^5^
Deleted-server revival: Recovery is available only under documented conditions and is not guaranteed. A revived server may use a name different from the deleted server; VNet-enabled recovery must also specify the delegated subnet and private DNS zone. Microsoft recommends using a different name to avoid possible DNS errors during restoration.^6^
Server-name reuse: No documented TLS guarantee binds a reused FQDN permanently to the former resource or its data. If a name later resolves to a service presenting a trusted certificate valid for that name, hostname verification can succeed. Treat deletion/recreation and DNS reassignment as lifecycle events requiring control-plane governance and application-level identity validation where continuity matters.
References
- Configure TLS connection in Azure Database for PostgreSQL flexible server
- Network with private access (virtual network integration) in Azure Database for PostgreSQL flexible server
- Backup and restore in Azure Database for PostgreSQL flexible server
- Transport Layer Security (TLS) in Azure Database for PostgreSQL flexible server
- Restore to latest restore point
- Restore a deleted server in Azure Database for PostgreSQL flexible server