Create and manage virtual networks (VNET Integration) for Azure Database for PostgreSQL - Flexible Server using the Azure portal
APPLIES TO: Azure Database for PostgreSQL - Flexible Server
Azure Database for PostgreSQL flexible server supports two types of mutually exclusive network connectivity methods to connect to your Azure Database for PostgreSQL flexible server instance. The two options are:
- Public access (allowed IP addresses). That method can be further secured by using Private Link based networking with Azure Database for PostgreSQL flexible server in Preview.
- Private access (VNet Integration)
In this article, we focus on creation of an Azure Database for PostgreSQL flexible server instance with Private access (VNet integration) using Azure portal. With Private access (VNet Integration), you can deploy your Azure Database for PostgreSQL flexible server instance integrated into your own Azure Virtual Network. Azure Virtual Networks provide private and secure network communication. With private access, connections to the Azure Database for PostgreSQL flexible server instance are restricted to your virtual network. To learn more about it, refer to Private access (VNet Integration).
You can deploy your Azure Database for PostgreSQL flexible server instance into a virtual network and subnet during server creation. After the Azure Database for PostgreSQL flexible server instance is deployed, you can't move it into another virtual network, subnet or to Public access (allowed IP addresses).
Prerequisites
To create an Azure Database for PostgreSQL flexible server instance in a virtual network, you need:
-
Note
- The virtual network and subnet should be in the same region and subscription as your Azure Database for PostgreSQL flexible server instance.
- The virtual network shouldn't have any resource lock set at the VNET or subnet level, as locks may interfere with operations on the network and DNS. Make sure to remove any lock (Delete or Read only) from your VNET and all subnets before creating the server in a virtual network, and you can set it back after server creation.
To delegate a subnet to Microsoft.DBforPostgreSQL/flexibleServers. This delegation means that only Azure Database for PostgreSQL flexible server instances can use that subnet. No other Azure resource types can be in the delegated subnet.
Add
Microsoft.Storage
to the service endpoint for the subnet delegated to Azure Database for PostgreSQL flexible server. This is done by performing following steps:- Go to your virtual network page.
- Select the VNET in which you're planning to deploy your Azure Database for PostgreSQL flexible server instance.
- Choose the subnet that's delegated for Azure Database for PostgreSQL flexible server.
- On the pull-out screen, under Service endpoint, choose
Microsoft.storage
from the drop-down. - Save the changes.
If you want to set up your own private DNS zone to use with the Azure Database for PostgreSQL flexible server instance, see private DNS overview documentation for more details.
Create an Azure Database for PostgreSQL flexible server instance in an already existing virtual network
- Select Create a resource (+) in the upper-left corner of the portal.
- Select Databases > Azure Database for PostgreSQL. You can also enter PostgreSQL in the search box to find the service.
- Fill out the Basics form.
- Go to the Networking tab to configure how you want to connect to your server.
- In the Connectivity method, select Private access (VNet Integration). Go to Virtual Network and select the already existing virtual network and Subnet created as part of prerequisites.
- Under Private DNS Integration, by default, a new private DNS zone will be created using the server name. Optionally, you can choose the subscription and the Private DNS zone from the drop-down list.
- Select Review + create to review your Azure Database for PostgreSQL flexible server configuration.
- Select Create to provision the server. Provisioning can take a few minutes.
Note
After the Azure Database for PostgreSQL flexible server instance is deployed to a virtual network and subnet, you can't move it to Public access (allowed IP addresses).
Note
If you want to connect to the Azure Database for PostgreSQL flexible server instance from a client that's provisioned in another VNET, you have to link the private DNS zone with the VNET. See this linking the virtual network documentation on how to do it.
Next steps
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for