How the connection works
PlanetScale operates an Azure Private Link Service in your Managed subscription. You create a Private Endpoint in an application VNet and manage the endpoint’s private IP address and DNS. PlanetScale provides:- The Private Link Service alias
- Confirmation that each application subscription is allowed to discover and connect to the service
- The Private Endpoint in the application subscription
- Network access from your applications to the endpoint
- Optional private DNS zones and DNS records
Prerequisites
Before you begin, you need:- A provisioned PlanetScale Managed deployment on Azure
- The Azure subscription and VNet where the applications that will connect to PlanetScale run
- A subnet in that VNet where Azure can create the Private Endpoint
- Permission to create Private Endpoints and network interfaces
- The
Microsoft.Networkresource provider registered in the application subscription - Network access from your applications to the database ports supplied by PlanetScale
- If you plan to use private DNS, permission to create Private DNS zones, VNet links, and DNS records
Step 1: Ask PlanetScale to enable the application subscription
Give your PlanetScale Solutions Engineer the subscription ID for each Azure subscription where you will create a Private Endpoint. PlanetScale configures the Private Link Service and gives you:- A Private Link Service alias, such as
SERVICE.GUID.REGION.azure.privatelinkservice - Confirmation that your application subscription is configured for automatic approval
Step 2: Create a Private Endpoint
You can create the endpoint in the Azure portal or with the Azure CLI.Azure portal
1
In the Azure portal, open Private Link Center, select Private endpoints, and then select Create.
2
Select the application subscription and resource group where you want to create the endpoint. Enter an endpoint name and select its region.
3
On the resource page, select the option to connect by resource ID or alias. Enter the Private Link Service alias supplied by PlanetScale.
4
Select the VNet and subnet used by your applications. Complete the endpoint creation without configuring automatic DNS integration.
5
Open the new endpoint and confirm that its connection status is Approved. Record the private IP address assigned to its network interface.
Azure CLI
Set values for your environment and retrieve the endpoint subnet ID:Approved.
Get the endpoint’s private IP address:
Step 3: Choose how applications address the endpoint
Applications can connect through the Private Endpoint IP directly or through a private DNS hostname.Use hostaddr for Postgres without private DNS
Private DNS is optional for Postgres. Start with the connection string provided by the PlanetScale dashboard and add hostaddr=<private-endpoint-ip>. Keep the existing host value so PostgreSQL can use it for TLS hostname verification while connecting to the Private Endpoint IP.
For example:
6432 instead when connecting through PgBouncer. PostgreSQL 17 or later is recommended when using sslnegotiation=direct.
Configure private DNS
The public PlanetScale hostname continues to resolve to the public endpoint. Private Link uses a separate private DNS name supplied by PlanetScale, such as<deployment>.private-pg.psdb.cloud; it does not override the public <deployment>.pg.psdb.cloud zone.
Public connectivity is not automatically disabled when Private Link is enabled. We recommend confirming private connectivity first. Contact your Solutions Engineer to disable public connectivity.
Choose a single DNS record label for the Private Endpoint. The resulting private hostname is:
Step 4: Verify connectivity
Run these checks from a host that uses the application VNet. Confirm that the Private Endpoint accepts connections on the required database port. For direct PostgreSQL and PgBouncer connections:hostaddr=$PRIVATE_ENDPOINT_IP or the private hostname in your connection string.
Public and private access
Troubleshooting
The endpoint creation fails with LinkedAuthorizationFailed
For a cross-tenant connection, use the Private Link Service alias rather than its Azure resource ID. Set --manual-request true when using the Azure CLI.
The endpoint remains pending
Confirm that PlanetScale configured the application subscription before you created the endpoint. If the subscription was added afterward, contact your Solutions Engineer. You may need to recreate the endpoint after PlanetScale confirms the configuration.The private hostname does not resolve to the Private Endpoint IP
The public<deployment>.pg.psdb.cloud hostname continues to resolve to the public endpoint while public ingress is enabled. If you ask PlanetScale to disable public ingress, PlanetScale removes the public DNS record. For private DNS, confirm that:
- You created the separate private DNS zone supplied by PlanetScale
- The A record points to the Private Endpoint’s network-interface IP
- The private DNS zone is linked to the VNet used by your application
- Custom DNS servers forward or resolve the private zone correctly
host value and hostaddr=<private-endpoint-ip>.
TLS hostname verification fails
When usinghostaddr, keep the host value from the PlanetScale dashboard in the connection string. When using private DNS, use a single record label directly under the private DNS zone supplied by PlanetScale. Do not use the Private Endpoint IP or Private Link Service alias as the host value.
Connections time out
Confirm that network security groups, user-defined routes, firewalls, and application egress policies allow the required database ports between the application and the Private Endpoint.Next steps
- Connect to PlanetScale Postgres
- Configure connection pooling with PgBouncer
- Learn about PlanetScale Managed on Azure

