Search code examples
azure-cosmosdbazure-stream-analytics

Stream Analytics cannot output to DocumentDb's Partitioned Collection


I am trying to send a message to IoT Hub and save it to DocumentDB using Stream Analytics, though I'm having a trouble outputting it to the DocumentDB's "Partitioned" collection.

I was able to output the message to "Single Partition" collection, but no documents are outputted to "Partitioned" collection.

The details are as below:

[Stream Analytics output for the DocDB "Partitioned" collection]

  • Output Alias : outdocdbpart
  • PartitionKey : DeviceId
  • Document Id : id

[Stream Analytics query]

/*Partitioned:no document inserted*/
SELECT * INTO [outdocdbpart] FROM [inputiothub]

[Format of JSON content to insert is something like this]

{
   "DeviceId": "device001",
   "id": "{Guid}",
   ...
}

(*) I've added "id" for "Partitioned" collection only. For "Single Partitioned", I didn't place "id" property.

[Settings for DocDB's "Partitioned" collection]

  • PartitionMode: Partitioned
  • PartitionKey : /DeviceId

Above resources are all in the same group and same region. What could be the cause of the problem? Am I missing something?


Solution

  • Azure Stream Analytics currently can not output to Azure DocumentDB partitioned collections. Our teams are currently working on implementing this, but we do not have an ETA yet.

    In the meantime, can you vote for this item on the Azure Stream Analytics feedback forum?

    https://feedback.azure.com/forums/270577-stream-analytics/suggestions/13431888-output-new-documentdb-single-partition-partition