Hello @Jonas Karlsson,
Sure, I can provide you with an example of how to extract the OperationId from the AI context and set it as a custom property in the ingestion Logic App, as well as an example of how to retrieve the custom property in the consuming Logic App and set it as the OperationId in the AI telemetry.
In the ingestion Logic App, you can use the "Parse JSON" action to parse the request body and extract the "operation_Id" property from the AI context. Here's an example of how you can do this:
- Add a "Parse JSON" action to your ingestion Logic App.
- Set the "Content" property to the body of the request.
- Set the "Schema" property to the JSON schema of the request.
- Add a "Set Variable" action to your ingestion Logic App.
- Set the value of the variable to the "operation_Id" property of the parsed JSON. For example:
{
"name": "setOperationId",
"type": "SetVariable",
"inputs": {
"name": "operationId",
"value": "@{body('Parse_JSON')?['operation_Id']}"
}
}
- Add a "Service Bus - Send Message" action to your ingestion Logic App.
- Set the "User Properties" property to a JSON object that includes the operation_id. For example:
{
"name": "sendToServiceBus",
"type": "ServiceBus",
"inputs": {
"body": "@{triggerBody()}",
"userProperties": {
"operation_id": "@{variables('operationId')}"
}
}
}
In the consuming Logic App, you can retrieve the custom property from the Service Bus message and set it as the OperationId in the AI telemetry. Here's an example of how you can do this:
- Add a "Parse JSON" action to your consuming Logic App.
- Set the "Content" property to the body of the Service Bus message.
- Set the "Schema" property to the JSON schema of the message.
- Add a "Set Variable" action to your consuming Logic App.
- Set the value of the variable to the "operation_id" property of the parsed JSON. For example:
{
"name": "setOperationId",
"type": "SetVariable",
I hope the above provided information will helps you in understating better and solve your issue, if you have a further concern, please feel free to reach out.