|
| 1 | +--- |
| 2 | +title: Connect apps to Neon Serverless Postgres (Preview) |
| 3 | +description: Learn how to connect apps to your Neon Serverless Postgres (Preview) service using Service Connector in Azure. |
| 4 | +# customerIntent: As a developer I want connect apps deployed to Azure services, to a Neon Serverless Postgres (Preview) resource. |
| 5 | +ms.topic: how-to |
| 6 | +ms.date: 03/28/2025 |
| 7 | +ms.custom: service-connector |
| 8 | +--- |
| 9 | + |
| 10 | +# Connect apps to Neon Serverless Postgres (Preview) |
| 11 | + |
| 12 | +In this guide, learn how to connect your app to a database within a Neon Serverless Postgres (Preview) resource using Service Connector. |
| 13 | + |
| 14 | +Service Connector is an Azure service designed to simplify the process of connecting Azure resources together. Service Connector manages your connection's network and authentication settings to simplify the operation. |
| 15 | + |
| 16 | +This guide shows step by step instructions to connect an app deployed to Azure App Service to a Neon Serverless Postgres resource. You can apply a similar method to create a connection from apps deployed to [Azure Container Apps](/azure/container-apps/quickstart-portal), [Azure Kubernetes Services (AKS)](/azure/aks/learn/quick-kubernetes-deploy-portal), or [Azure Spring Apps](/azure/spring-apps/enterprise/quickstart). |
| 17 | + |
| 18 | +## Prerequisites |
| 19 | + |
| 20 | +* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free) |
| 21 | +* An existing Neon Serverless Postgres resource. If you don't have one yet, refer to [create a Neon Serverless Postgres resource](./create.md) |
| 22 | +* An app deployed to an [Azure compute service supported by Service Connector](../../service-connector/overview.md#what-services-are-supported-by-service-connector). |
| 23 | + |
| 24 | +## Create a new connection |
| 25 | + |
| 26 | +Follow these steps to connect an app to Neon Serverless Postgres (Preview): |
| 27 | + |
| 28 | +1. Open the App Service, Container Apps, AKS, or Azure Spring Apps resource where your app is deployed. If using Azure Spring Apps, once you've opened your resource, navigate to the **Apps** menu, and select your app. |
| 29 | + |
| 30 | +1. Open **Service Connector** from the left menu and select **Create**. |
| 31 | + |
| 32 | + :::image type="content" source="./media/service-connection/create-connection.png" alt-text="Screenshot from the Azure portal showing the Create option."::: |
| 33 | + |
| 34 | +1. Enter or select the following information. |
| 35 | + |
| 36 | + | Setting | Example | Description | |
| 37 | + |----------------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 38 | + | **Service type** | *Neon Serverless Postgres* | The name of the target service: **Neon Serverless Postgres**. | |
| 39 | + | **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 provided by Service Connector or enter your own connection name. Connection names can only contain letters, numbers (0-9), periods ("."), and underscores ("_"). | |
| 40 | + | **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, in the **Connect** menu, under **Connection string**. | |
| 41 | + | **Neon Postgres database** | *database* | The name of the database within the Neon Serverless Postgres resource. The database name is displayed in the Neon portal, in the **Connect** menu, under **Database**. | |
| 42 | + | **Client type** | *Python* | The database client type. | |
| 43 | + |
| 44 | + :::image type="content" source="./media/service-connection/create-basics-tab.png" alt-text="Screenshot from the Azure portal showing the Create connection - Basics tab."::: |
| 45 | + |
| 46 | +1. Select **Next: Authentication** and select or enter the following information: |
| 47 | + 1. Select **Database credentials** and enter your database username and password. |
| 48 | + 1. Select **Store Secret in Key Vault** and select a Key Vault connection if you already have one, or select **Create new** to create a Key Vault connection. For step-by-step instructions to create a new connection to Key Vault, refer to [Connect Azure services and store secrets in Azure Key Vault](../../service-connector/tutorial-portal-key-vault.md#create-a-key-vault-connection-in-app-service). |
| 49 | + 1. Optionally also select **Advanced** and edit the provided environment variables. |
| 50 | + |
| 51 | + :::image type="content" source="./media/service-connection/create-authentication-tab.png" alt-text="Screenshot from the Azure portal showing the Create connection - Authentication tab."::: |
| 52 | + |
| 53 | + > [!NOTE] |
| 54 | + > We recommend you leverage Azure Key Vault to securely store and manage your credentials, reduce the risk of exposure and simplify secret management. |
| 55 | + |
| 56 | +1. Select **Next: Networking** > **Next: Review + Create** and review the provided information. |
| 57 | + |
| 58 | +1. Select **Create**. |
| 59 | + |
| 60 | +## View and edit connections |
| 61 | + |
| 62 | +[!INCLUDE [view-edit-connection](../includes/view-edit-connection.md)] |
| 63 | + |
| 64 | +## Related content |
| 65 | + |
| 66 | +- [Troubleshoot Neon Serverless Postgres (Preview)](troubleshoot.md) |
| 67 | +- [Manage the New Relic resource in the Azure portal](manage.md) |
0 commit comments