<!-- WARNING: THIS IS A SHARED FILE AND THE SOURCE IS LOCATED IN DOCS-COMMON. DO NOT ADD TO ANY OTHER REPO. -->

<a id="cc-couchbase-source-eap-azure"></a>

# Egress Private Link Endpoint Setup: Couchbase on Azure for Confluent Cloud

The Couchbase Source connector for Confluent Cloud supports Azure Private Link
connectivity through Egress Private Link Endpoints. Use this guide to
configure the connector and set up the required endpoints.

## Prerequisites

The following is a list of prerequisites for configuring the Couchbase DB connector with an Egress Private Link Endpoint:

* In Confluent Cloud, one of the following cluster types was set up with the specified
  network resource:
  * A Dedicated cluster with a Confluent Cloud network

    For the steps to create a Confluent Cloud network, see [Create a Confluent Cloud network](/cloud/current/networking/ccloud-network/azure.html#ccn-config-azure).
    The Connection type of the network needs to be “Private Link Access”.
  * A Enterprise cluster with a network gateway

    For the steps to create a gateway, see
    [Create a gateway for outbound connectivity in Confluent Cloud](/cloud/current/networking/azure-egress-privatelink-esku.html#azure-privatelink-egress-create-gateway-esku).
* Couchbase Capella DB running in Azure cloud.
* Confluent Cloud network (Dedicated or Serverless Egress Gateway) setup within same region and cloud as Couchbase Capella DB.

<a id="cc-couchbase-source-eap-azure-create-endpoint"></a>

## Step 1. Create a Couchbase Capella private endpoint

In the Couchbase Capella console, create a private endpoint for your Dedicated or Enterprise
Couchbase database:

1. Select a cluster to add an Azure Private Link connection.
2. In the **Networking** section, go to **Settings** → **Private Endpoints**.
3. Click **+ Add Private Endpoint**. Note that if this is the first time setting up a private endpoint,
   you will first need to enable it by clicking **Enable Private Endpoint**.
   ![Add a Couchbase Capella Private Endpoint](connectors/cc-couchbase-db-source/images-azure/couchbase-endpoint-service.png)
4. Specify the **Resource Group Name** and **Virtual Network/Subnet** of your Couchbase database.
   Click **Next**.
   ![Couchbase Capella Private Endpoint Details](connectors/cc-couchbase-db-source/images-azure/couchbase-endpoint-create.png)
5. Make a note of the private connection **resource ID** which will be required for
   creating a Confluent Cloud Egress Private Link Endpoint.
   ![Couchbase Private Connection Resource ID](connectors/cc-couchbase-db-source/images-azure/couchbase-service-name.png)
6. You can close the workflow for now. You will complete the rest of the configuration after
   you create a VPC endpoint ID in Confluent Cloud.

<a id="cc-couchbase-source-eap-azure-access-point"></a>

## Step 2. Create a Confluent Cloud Egress Private Link Endpoint

### Dedicated cluster

1. In the **Network management** page or tab of the desired Confluent Cloud environment,
   click the Confluent Cloud network you want to add the Private Link Endpoint to.
   The **Connection Type** of the network needs to be “Private Link
   Access”.
2. Click **Create endpoint** in the **Egress connections**
   tab.
3. Click the service you want to connect to, specifically, **Couchbase**. Select **Other** if you do not see the specific service.
4. Follow the guided steps to specify the field values, including:
   * **Service**: Name of the service connecting to. For example, Couchbase.
   * **Endpoint Name**: Name of the Private Link Endpoint.
   * **Resource ID**: The name of the private connection resource ID you
     retrieved in [Step 1. Create a Couchbase Capella private endpoint](#cc-couchbase-source-eap-azure-create-endpoint).
   * **Create an endpoint with high availability**: Check the box if
     you wish to deploy an endpoint with High Availability.

     Endpoints deployed with high availability have network interfaces
     deployed in multiple availability zones.
5. Click **Create** to create the Private Link Endpoint.
6. If there are additional steps for the specific target service, follow
   the prompt to complete the tasks, and then click **Finish**.

### Enterprise cluster

1. In the **Network management** page or tab of the desired Confluent Cloud environment,
   click the **For serverless products** tab.
2. Click the gateway to which you want to add the Private Link Endpoint.
3. In the **Access points** tab, click **Add access point**.
4. Click the service you want to connect to. Select **Other** if you do
   not see the specific service.

   Specific services are listed based on the cloud provider for the
   gateway.
5. Follow the guided steps to specify the field values, including:
   * **Access point name**: Name of the Private Link Endpoint.
   * **Create an endpoint with high availability**: Check the box if
     you wish to deploy an endpoint with High Availability.

     Endpoints deployed with high availability have network interfaces
     deployed in multiple availability zones.
   * **Resource ID**: The name of the connection resource ID you
     retrieved in [Step 1. Create a Couchbase Capella private endpoint](#cc-couchbase-source-eap-azure-create-endpoint).
6. Click **Create access point** to create the Private Link Endpoint.
7. If there are additional steps for the specific target service, follow
   the prompt to complete the tasks, and click **Finish**.

<a id="cc-couchbase-source-eap-azure-configure-endpoint"></a>

## Step 3. Configure the Couchbase Capella private endpoint

1. In the Couchbase Capella console, go to previously created Couchbase private endpoint screen.
2. Click **Accept** to complete the Azure Private Link connection setup.
   ![Configure Couchbase Capella Private Endpoint](connectors/cc-couchbase-db-source/images-azure/couchbase-endpoint-accept.png)
3. Make a note of the Private Endpoint DNS which will be required for
   creating a DNS record in the next step.
   ![Copy Couchbase Capella Private Endpoint](connectors/cc-couchbase-db-source/images-azure/couchbase-endpoint-copy.png)

## Step 4. Create a DNS record

1. In the Couchbase Capella console, when the Private Link Endpoint status transitions to “Ready”,
   click **Create record** on the associated Private Link Endpoint.
   ![Create DNS record](connectors/cc-couchbase-db-source/images-azure/dns-record.png)
2. Specify the following, and click **Save**.
   * **Access point**: Select the Private Link Endpoint you created above in
     [Step 2. Create a Confluent Cloud Egress Private Link Endpoint](#cc-couchbase-source-eap-azure-access-point).
   * **Domain**: Enter the domain name you created above in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-source-eap-azure-configure-endpoint).

## Step 5. Create the Couchbase Source connector

1. Specify the authentication details for Couchbase.

   For the **Couchbase Seed Node**, specify the DNS name you created above
   in [Step 3. Configure the Couchbase Capella private endpoint](#cc-couchbase-source-eap-azure-configure-endpoint) and prepend it with the prefix `couchbases://`
   (for example, `couchbases://<private-endpoint-dns>`).
   ![Create Couchbase DB Source Connector](connectors/cc-couchbase-db-source/images-azure/add-couchbase-source-connector.png)
2. Follow the steps to create the [source connector](cc-couchbase-db-source.md#cc-couchbase-source-setup-connection) in Confluent Cloud.
