Azure Digital Twin: event hub doesn't process relationship updates correctly?

Antonio Garofalo 0 Reputation points
2023-06-28T14:27:45.1733333+00:00

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?

Azure Digital Twins
Azure Digital Twins
An Azure platform that is used to create digital representations of real-world things, places, business processes, and people.
219 questions
Azure Event Hubs
Azure Event Hubs
An Azure real-time data ingestion service.
557 questions
JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
867 questions
{count} votes