2
votes

With Azure Data Factory I have a CosmosDb Dataset and picked a Collection from the dropdown list.

My Pipeline contains an Activity Copy Data and picked the Source Dataset mentioned above. Option 'Use Query' is set to Query so I have a textbox available.

When I enter a simple query like select c.Name from c I don't get any data and I don't understand why. How can I get the Name property from the dataset so it can be mapped?

This is the dataset: available data

2

2 Answers

0
votes

Based on Supported capabilities in document: Copy data to or from Azure Cosmos DB by using Azure Data Factory, Azure Cosmos DB connector only supports Copying data from and to the Azure Cosmos DB SQL API. That's the reason that you saw the strange results.

So, you could choose mongo connector to do your jobs which is mentioned in this case:https://social.msdn.microsoft.com/Forums/security/en-US/52cddbf7-c132-490c-9088-65a38f9b7200/copy-activity-to-cosmosdb-with-mongo-api?forum=AzureDataFactory.

-1
votes

What is your precise requirement ?

  1. Table and Query is single selection, if you select Query, the table(collection) you defined in dataset will not work.

  2. if you select a collection in dataset, and imported schema, you can switch to mapping in the copy activity, if you can't see any mapping, you should make sure you have selected a sink dataset and the sink has schema.

  3. The preview window you opened in dataset will not work for the query in activity source. it's different scenario. so no matter what you input in the query, it will not update