2

I'm new to CosmosDB and have used Data Factory to import some test data from a BLOB into a CosmoDB container. The Monitor screen tells me it was successful. I then went to the Azure portal, opened my container and clicked 'Documents' but this does not show me any data. I then clicked the refresh button in the sub-pane (the one on the 'load more' section) and it gave me the error: Error while fetching page of documents:

{"code":400,"body":"Command find failed: Unknown server error occurred when processing this request.."}

I also could not find any good tutorials online or on Youtube that shoes step by step how to import a CSV from BLOB storage into ComosDB Document store via DataFactory, so unable to tell if I am doing it correctly.

Reddspark
  • 6,934
  • 9
  • 47
  • 64

2 Answers2

1

I contacted Microsoft. Response was: "The Azure Data Factory loads data using the SQL API SDK, and does not support mMngo yet. The data loaded using the SQL API SDK would have to be in MongoDB BSON schema. Also, the Mongo DB Native driver expect the data in JSON schema and fails to deserialize triggerin the 400 error."

The MongoBulkExecutor API was recommended as an alternative but from what I can tell this really requires json too.

Reddspark
  • 6,934
  • 9
  • 47
  • 64
0

I also could not find any good tutorials online or on Youtube that shoes step by step how to import a CSV from BLOB storage into ComosDB Document store via DataFactory, so unable to tell if I am doing it correctly.

In fact, you should check the below components when you import csv from blob storage into cosmos db.

1.You already have created cosmos db Linked Service and DataSet.

2.You already have created cosmos db Linked Service and DataSet.

You could do the above steps on the portal.

3.Create copy activity and fill the blob storage input and cosmos db output into the activity.

enter image description here

enter image description here

4.In addition,you need to know cosmos db sql api and cosmos db mongo api are different api,though they call named cosmos db. 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. So,please don't confuse.

If you do want to use Mongo api, 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.

Jay Gong
  • 23,163
  • 2
  • 27
  • 32
  • Yeah I just used the Data factory data copy wizard which took care if a lit of this for me. What's the next step to doing a quick view of the mongo data in cosmos db? – Reddspark Nov 26 '18 at 04:31
  • @user1761806 So you mean you are using cosmos db mongo api ,not sql api actually,right? – Jay Gong Nov 26 '18 at 05:14
  • @user1761806 If you are using cosmos db mongo api and used mongo connector in azure data factory,then it should be fine. Next step just to view the imported data in the cosmos db data explorer. – Jay Gong Nov 26 '18 at 05:22
  • Hmm ok that's where I get the error described above. Will have to continue searching till I figure it out. My reach out to MS. – Reddspark Nov 26 '18 at 12:45