Chandra
Chandra

Reputation: 565

Azure Stream Analytics output to Azure Cosmos DB

Stream Analytics job ( iot hub to CosmosDB output) "Start" command is failing with the following error.

[12:49:30 PM] Source 'cosmosiot' had 1 occurrences of kind 'OutputDataConversionError.RequiredColumnMissing' between processing times '2019-04-17T02:49:30.2736530Z' and '2019-04-17T02:49:30.2736530Z'.

I followed the instructions and not sure what is causing this error. Any suggestions please? Here is the CosmosDB Query:

SELECT
[bearings temperature],
[windings temperature],
[tower sway],
[position sensor],
[blade strain gauge],
[main shaft strain gauge],
[shroud accelerometer],
[gearbox fluid levels],
[power generation],
[EventProcessedUtcTime],
[EventEnqueuedUtcTime],
[IoTHub].[CorrelationId],
[IoTHub].[ConnectionDeviceId]
INTO
cosmosiot
FROM
TurbineData 

Upvotes: 2

Views: 2165

Answers (1)

Ruth Vanderhooft
Ruth Vanderhooft

Reputation: 41

If you're specifying fields in your query (ie Select Name, ModelNumber ...) rather than just using Select * ... the field names are converted to lowercase by default when using Compatibility Level 1.0, which throws off Cosmos DB. In the portal if you open your Stream Analytics job and go to 'Compatibility level' under the 'Configure' section and select v1.1 or higher that should fix the issue. You can read more about the compatibility levels in the Stream Analytics documentation here: https://learn.microsoft.com/en-us/azure/stream-analytics/stream-analytics-compatibility-level

Upvotes: 4

Related Questions