Cosmos db in synapse

Vineet S 910 Reputation points
2024-09-18T16:00:18.14+00:00

Hi, How to get cosmos db data load in azure synapse using container or table levels.. Pls share screenshot

Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,677 questions
0 comments No comments
{count} votes

Accepted answer
  1. Amira Bedhiafi 24,531 Reputation points
    2024-09-18T21:27:33.92+00:00

    To load data from Cosmos DB into Azure Synapse Analytics using Azure Data Factory (ADF), follow these steps:

    Step 1: Set Up Azure Synapse Workspace

    1. Go to your Azure Synapse Analytics workspace.
    2. Ensure you have set up your dedicated SQL pool or serverless SQL pool.

    Step 2: Create a Linked Service to Cosmos DB in Azure Data Factory

    1. Navigate to Azure Data Factory and create or open your pipeline.
    2. Under Manage on the left pane, select Linked Services.
    3. Click New and search for Cosmos DB.
    4. Select Azure Cosmos DB (SQL API) and configure the connection:
      • Set the Account Endpoint and Account Key.
      • Test the connection and click Create.

    Step 3: Create a Linked Service to Synapse Analytics in Azure Data Factory

    1. In the same Linked Services section, click New and search for Azure Synapse Analytics.
    2. Choose the appropriate connection (dedicated SQL pool or serverless SQL pool).
    3. Enter the connection details:
      • SQL pool name, server, and database.
      • Provide username and password.
      • Test the connection and click Create.

    Step 4: Set Up a Data Flow or Copy Activity in the Pipeline

    1. Go to the Author tab and create a new Pipeline.
    2. Add a Copy Data Activity (or a Data Flow if transformation is needed).
    3. Configure the Source:
      • Select Azure Cosmos DB as the source dataset.
      • Choose the container or table you want to load from Cosmos DB.
    4. Configure the Sink:
      • Select Azure Synapse Analytics as the sink dataset.
      • Map the fields from Cosmos DB to the corresponding columns in Synapse Analytics.

    Step 5: Monitor and Execute the Pipeline

    1. Once the pipeline is configured, click Debug to test or Trigger Now to run the pipeline.
    2. Monitor the progress under the Monitor tab in Azure Data Factory.

    Let me know if you'd like any specific part of the process elaborated on.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Smaran Thoomu 15,765 Reputation points Microsoft Vendor
    2024-09-18T21:17:06.93+00:00

    Hi @Vineet S

    Thank you for using Microsoft Q&A platform and thanks for posting your question here.

    As I understand you're looking to load Cosmos DB data into Azure Synapse using container or table levels. To achieve this, you can leverage Azure Synapse Link for Azure Cosmos DB, which enables seamless data integration between the two services.

    To load data from Azure Cosmos DB into Azure Synapse Analytics at the container or table level, you can use Azure Synapse Link. Follow these steps:

    • When creating containers, make sure to toggle the 'On' button to enable Azure Synapse Link. Refer to the screenshot below for detailed instructions.
      User's image
    • Next, go to the integrations section, where you can add Azure Synapse Link to load the tables by selecting the container to enable it. This will allow you to load Cosmos DB data into Azure Synapse.
      User's image

    For more information, please refer this: https://learn.microsoft.com/en-us/azure/cosmos-db/configure-synapse-link

    Hope this helps. Do let us know if you any further queries.


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.