|
| 1 | +--- |
| 2 | +title: Connect apps to MongoDB Atlas (Preview) |
| 3 | +description: Learn how to connect apps to your MongoDB Atlas (Preview) service using Service Connector in Azure. |
| 4 | +# customerIntent: As a developer I want connect apps deployed to Azure services, to a MongoDB Atlas (Preview) resource. |
| 5 | +ms.topic: how-to |
| 6 | +ms.date: 04/22/2025 |
| 7 | +ms.custom: service-connector |
| 8 | +--- |
| 9 | + |
| 10 | +# Connect apps to MongoDB Atlas (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 MongoDB Atlas resource. You can apply a similar method to create a connection from apps deployed to [Azure Container Apps](/azure/container-apps/quickstart-portal) or [Azure Kubernetes Services (AKS)](/azure/aks/learn/quick-kubernetes-deploy-portal). |
| 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 MongoDB Atlas resource. If you don't have one yet, refer to [Quickstart: Get started with MongoDB Atlas (preview)](./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 MongoDB Atlas: |
| 27 | + |
| 28 | +1. Open the App Service, Container Apps, or AKS resource where your app is deployed. |
| 29 | + |
| 30 | +1. Open **Settings** > **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** | *MongoDB Atlas Cluster (Preview)* | The name of the target service: **MongoDB Atlas Cluster (Preview)**. | |
| 39 | + | **Connection name** | *mongodb_atlas_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 | + |
| 41 | + :::image type="content" source="./media/service-connection/create-basics-tab.png" alt-text="Screenshot from the Azure portal showing the Create connection - Basics tab."::: |
| 42 | + |
| 43 | +1. Select **Next: Authentication** and enter your cluster connection string. Optionally also edit your cluster connection string variable name under **Advanced**. |
| 44 | + |
| 45 | +> [!TIP] |
| 46 | +> To find your cluster's connection string, in the MongoDB Astra platform, go to **Clusters** > **Connection**, then select a connection method and copy the connection string. |
| 47 | +
|
| 48 | +1. Select **Next** until you reach **Review + Create**, and review the provided information. |
| 49 | +1. Select **Create**. |
| 50 | + |
| 51 | +## View and edit connections |
| 52 | + |
| 53 | +[!INCLUDE [view-edit-connection](../includes/view-edit-connection.md)] |
| 54 | + |
| 55 | +## Related content |
| 56 | + |
| 57 | +- [MongoDB Atlas developer resources and tools](tools.md) |
| 58 | +- [Manage a MongoDB Atlas resource](manage.md) |
0 commit comments