หมายเหตุ
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลอง ลงชื่อเข้าใช้หรือเปลี่ยนไดเรกทอรีได้
การเข้าถึงหน้านี้ต้องได้รับการอนุญาต คุณสามารถลองเปลี่ยนไดเรกทอรีได้
Azure Database for PostgreSQL deployed with private access uses virtual network integration to place the server in a delegated subnet within your virtual network. You can change these servers to a network configuration that supports private endpoints. Private endpoints provide secure connectivity through Azure Private Link, so you can access your server over a private IP address within your virtual network. This change replaces virtual network integration with private endpoint support, giving you more flexibility in network design while maintaining private connectivity.
This article walks you through how to change your network configuration, what to expect during the process, and how to restore connectivity after the change.
Details to know in advance
Before you change your network configuration, review how the change affects public access, connectivity, backups, and logical replication.
Public access settings:
- After the change, public access is disabled by default. To allow public access, enable public access and then add firewall rules to permit inbound traffic.
If you use Terraform to manage the server, update your configuration after the change. For more information, see Update Terraform scripts.
The change typically takes up to 20 minutes. During this time, the server is in the Updating state.
Connectivity impact:
- The server is typically inaccessible for up to 10 minutes. During that time, the operation closes existing database connections and rejects new connection attempts.
Backup and restore:
- All backups captured before the change, including geo-redundant backups, remain available after the change.
Logical replication:
- If the server is a logical replication publisher, the change might break its subscribers' connections, depending on your setup. Subscribers always initiate the connection to the publisher, and the private network path that virtual network integration gave them ends when the server leaves its delegated subnet.
- After the change, make sure each subscriber can reach the server's private endpoint, for example from the same virtual network, through virtual network peering, or over a VPN or Azure ExpressRoute connection.
Steps to change your network configuration
Important
This operation is irreversible. You can't move the server back into a virtual network after the change.
Use the Azure portal:
Select your Azure Database for PostgreSQL flexible server.
In the resource menu, under the Settings section, select Networking.
Under Network connectivity, for Connectivity method, select Public access (allowed IP addresses) and private endpoints.
Select Save.
In the Migrate to Public access (allowed IP addresses) confirmation dialog, review the effects of the change:
- The change is irreversible. You can't move the server back into a virtual network.
- The server is inaccessible while the change is in progress. Existing database connections are closed, and new connection attempts are rejected.
- After the change, the server remains inaccessible until you add a private endpoint or configure public access with firewall rules.
Select Save to confirm the effects and start the change.
Monitor the server status in the Azure portal. Refresh the page periodically until the status changes from Updating to Ready.
Configure the server after the change
After the change finishes, restore connectivity to the server and update any infrastructure-as-code templates to match the new network configuration.
Restore connectivity
After the change, the server is inaccessible until you set up at least one of these connectivity options:
- Add a private endpoint connection.
- Enable public access if it's disabled, and then add firewall rules for the clients that need to connect.
Update Terraform scripts
After the change, the server no longer uses virtual network integration. If you manage the server with Terraform, update your configuration:
- Remove
delegated_subnet_idfrom theazurerm_postgresql_flexible_serverresource. If the configuration still sets it, Terraform plans to replace the server, because changes to this argument force a new server. - Set
public_network_access_enabledto match the server's public access setting after the change. The provider defaults this argument totrue, so if you omit it, Terraform tries to enable public access. - Run
terraform planand confirm that the plan doesn't replace the server before you apply it.