Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this guide, learn how to connect your app to a database within a Neon Serverless Postgres resource by using Service Connector.
Service Connector is an Azure feature that simplifies the process of connecting Azure resources together. Service Connector manages your connection's network and authentication settings to simplify the operation.
This guide shows step-by-step instructions for connecting an app deployed in Azure App Service to a Neon Serverless Postgres resource. You can apply a similar method to create a connection from apps deployed in Azure Container Apps or Azure Kubernetes Service (AKS).
Prerequisites
- An Azure account with an active subscription. Create an account for free.
- An existing Neon Serverless Postgres resource. If you don't have one yet, refer to Create a Neon Serverless Postgres resource.
- An app deployed to an Azure compute service that Service Connector supports.
Create a connection
Follow these steps to connect an app to Neon Serverless Postgres:
Open the App Service, Container Apps, or AKS resource where your app is deployed.
On the left menu, open Service Connector, and then select Create.
Enter or select the following information:
Setting Example Description Service type Neon Serverless Postgres The name of the target service: Neon Serverless Postgres. Connection name neon_postgres_01 The name of the connection between the Azure compute resource and the Neon Serverless Postgres resource. Use the connection name that Service Connector provides, or enter your own connection name. Connection names can contain only letters, numbers (0-9), periods (.), and underscores (_). Neon Postgres hostname contoso-compute.gwc.azure.neon.tech The host name of the Neon Serverless Postgres resource. The host name is displayed in the Neon portal, on the Connect menu, under Connection string. Neon Postgres database name database The name of the database within the Neon Serverless Postgres resource. The database name is displayed in the Neon portal, on the Connect menu, under Database. Client type Python The database client type. Select Next: Authentication, and then select or enter the following information:
Select Database credentials, and then enter your database username and password.
Select Store Secret In Key Vault, and then select an Azure Key Vault connection if you already have one.
If you don't have a Key Vault connection, select Create new to create one. For step-by-step instructions on creating a new connection to Key Vault, refer to Connect Azure services and store secrets in Azure Key Vault.
Optionally, select Advanced and edit the provided environment variables.
Note
We recommend that you use Azure Key Vault to securely store and manage your credentials, reduce the risk of exposure, and simplify secret management.
Select Next: Networking > Next: Review + Create, and then review the provided information.
Select Create.
View and edit connections
To review, edit, or delete your existing connections:
Go to your application in the Azure portal. On the left menu, open Service Connector.
Select a connection's checkbox and explore the following options:
- Select > to access connection details.
- Select Validate to prompt Service Connector to check your connection.
- Select Edit to edit connection details.
- Select Delete to remove a connection.