|
| 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 | +ms.author: malev |
| 9 | +author: maud-lv |
| 10 | + |
| 11 | +--- |
| 12 | + |
| 13 | +# Connect apps to MongoDB Atlas (Preview) |
| 14 | + |
| 15 | +In this guide, you learn how to connect your app to a database within a MongoDB Atlas Cluster (Preview) resource using Service Connector. |
| 16 | + |
| 17 | +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. |
| 18 | + |
| 19 | +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). |
| 20 | + |
| 21 | +## Prerequisites |
| 22 | + |
| 23 | +* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free). |
| 24 | +* An existing MongoDB Atlas resource. If you don't have one yet, go to [MongoDB Atlas](https://www.mongodb.com/atlas). |
| 25 | +* An app deployed to an [Azure compute service supported by Service Connector](./overview.md#what-services-are-supported-by-service-connector). |
| 26 | + |
| 27 | +## Create a new connection |
| 28 | + |
| 29 | +Follow these steps to connect an app to MongoDB Atlas: |
| 30 | + |
| 31 | +1. Open the App Service, Container Apps, or AKS resource where your app is deployed. |
| 32 | + |
| 33 | +1. Open **Settings** > **Service Connector** from the left menu and select **Create**. |
| 34 | + |
| 35 | + :::image type="content" source="./media/tutorial-mongodb-atlas/create-connection.png" alt-text="Screenshot from the Azure portal showing the Create option."::: |
| 36 | + |
| 37 | +1. Enter or select the following information. |
| 38 | + |
| 39 | + | Setting | Example | Description | |
| 40 | + |----------------------------|-------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| |
| 41 | + | **Service type** | *MongoDB Atlas Cluster (preview)* | The name of the target service: **MongoDB Atlas Cluster (Preview)**. | |
| 42 | + | **Connection name** | *mongodb_atlas_01* | The name of the connection between the Azure compute resource and the MongoDB Atlas Cluster 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 ("_"). | |
| 43 | + |
| 44 | + :::image type="content" source="./media/tutorial-mongodb-atlas/create-basics-tab.png" alt-text="Screenshot from the Azure portal showing the Create connection - Basics tab."::: |
| 45 | + |
| 46 | +1. Select **Next: Authentication** and enter your cluster connection string. Optionally also edit your cluster connection string variable name under **Advanced**. |
| 47 | + |
| 48 | + > [!TIP] |
| 49 | + > To find your cluster's connection string, in the MongoDB Atlas platform, navigate to **Clusters** > **Connection** > **Drivers**, and copy the connection string. |
| 50 | +
|
| 51 | + :::image type="content" source="./media/tutorial-mongodb-atlas/create-authentication-tab.png" alt-text="Screenshot from the Azure portal showing the Create connection - Authentication tab."::: |
| 52 | + |
| 53 | +1. Select **Next** until you reach **Review + Create**, and review the provided information. |
| 54 | +1. Select **Create**. |
| 55 | + |
| 56 | +## View and edit connections |
| 57 | + |
| 58 | +[!INCLUDE [view-edit-connection](../partner-solutions/includes/view-edit-connection.md)] |
| 59 | + |
| 60 | +## Related content |
| 61 | + |
| 62 | +- [What is Service Connector](overview.md) |
| 63 | +- [Learn about Service Connector concepts](concept-service-connector-internals.md) |
0 commit comments