Closed iotblackbelt closed 5 years ago
changes the env-vars file to represent: export PCS_TELEMETRY_STORAGE_TYPE="cosmosdb" and restarted Now telemetry is reading from cosmosdb, but no messages end up in cosmosdb. All messages are still send to TSI. What do I need to change to ensure the telemetry is also send to cosmosdb?
Found it. Adjust the ASA query by adding: -- Output origin telemetry messages SELECT CONCAT(T.IoTHub.ConnectionDeviceId, ';', CAST(DATEDIFF(millisecond, '1970-01-01T00:00:00Z', T.EventEnqueuedUtcTime) AS nvarchar(max))) as id, 1 as [doc.schemaVersion], 'd2cmessage' as [doc.schema], T.IoTHub.ConnectionDeviceId as [device.id], 'device-sensors;v1' as [device.msg.schema], 'StreamingJobs' as [data.schema], DATEDIFF(millisecond, '1970-01-01T00:00:00Z', System.Timestamp) as [device.msg.created], DATEDIFF(millisecond, '1970-01-01T00:00:00Z', T.EventEnqueuedUtcTime) as [device.msg.received], udf.removeUnusedProperties(T) as Data INTO Messages FROM DeviceTelemetry T PARTITION BY PartitionId TIMESTAMP BY T.EventEnqueuedUtcTime
and adjust the ASA Messages output to send messages to the right CosmosDB database (messages instead of alerts).
Found it. Adjust the ASA query by adding: -- Output origin telemetry messages SELECT CONCAT(T.IoTHub.ConnectionDeviceId, ';', CAST(DATEDIFF(millisecond, '1970-01-01T00:00:00Z', T.EventEnqueuedUtcTime) AS nvarchar(max))) as id, 1 as [doc.schemaVersion], 'd2cmessage' as [doc.schema], T.IoTHub.ConnectionDeviceId as [device.id], 'device-sensors;v1' as [device.msg.schema], 'StreamingJobs' as [data.schema], DATEDIFF(millisecond, '1970-01-01T00:00:00Z', System.Timestamp) as [device.msg.created], DATEDIFF(millisecond, '1970-01-01T00:00:00Z', T.EventEnqueuedUtcTime) as [device.msg.received], udf.removeUnusedProperties(T) as Data INTO Messages FROM DeviceTelemetry T PARTITION BY PartitionId TIMESTAMP BY T.EventEnqueuedUtcTime
and adjust the ASA Messages output to send messages to the right CosmosDB database (messages instead of alerts).
Where did you find this information?
How can I deploy Remote Monitoring without using Times Series Insight, in other regions then China? My goal is to deploy RM without the use of TSI, as the customer doesn't want to use TSI. Is that possible?