Azure Digital Twin: event hub doesn't process relationship updates correctly?
I need to extrapolate data for a database and to do so I need information about which digital twin relationship was updated.
I set up the event route to trigger the event hub for these filters:
type = 'Microsoft.DigitalTwins.Relationship.Create' OR
type = 'Microsoft.DigitalTwins.Relationship.Update'
Then, whenever a new relationship is created I get this kind of message:
{
"$relationshipId": "poleesp1hassensoresp1",
"$etag": "W/\"7d16a3d4-a121-40ea-b9f6-5b79a88efd6c\"",
"$sourceId": "poleesp1",
"$relationshipName": "has",
"$targetId": "sensoresp1",
"EventProcessedUtcTime": "2023-06-28T14:10:28.8409644Z",
"PartitionId": 0,
"EventEnqueuedUtcTime": "2023-06-28T14:05:05.4490000Z"
},
Which is exactly what I want because I can work on the fields I need, especially $relationshipId.
However, whenever a relationship is updated (not created), the message the event hub forwards is this one:
{
"modelId": "dtmi:digitaltwins:city:Pole;1",
"patch": [
{
"value": {},
"path": "",
"op": "replace"
}
],
"EventProcessedUtcTime": "2023-06-28T14:10:28.8409644Z",
"PartitionId": 0,
"EventEnqueuedUtcTime": "2023-06-28T14:10:15.4000000Z"
}
Which doesn't have pretty much any information related to the relationship itself, is this normal? Is there a workaround for this?