Azure / logicapps

Azure Logic Apps labs, samples, and tools
MIT License
367 stars 302 forks source link

Stateful Logic App Peek Lock Trigger skips run history for malformed JSON messages with Content-Type 'application/json #1235

Open bahto opened 9 hours ago

bahto commented 9 hours ago

Describe the Bug with repro steps

Bug Report:

"Stateful Logic App Peek Lock Trigger skips run history for malformed JSON messages with Content-Type 'application/json'"


Steps to Reproduce:

  1. Configure the Logic App:

    Create a stateful Logic App workflow with the following steps:

  1. Place a message on the queue:

    Use a message with the following characteristics:

    • Body: Malformed JSON, for example:
    {
        "specversion": "1.0",
        "type": "sourceSystem.event.customer.created",
        "source": "sourceSystem",
        "subject": "a089V00000L9XXXXXX",
        "id": "a089V00000LXXXXXXX",
        "time": "",
        "datacontenttype": "application/json",
        "data": 
     }
    • Content-Type : application/json.
  2. Observe the behavior:

    • The message is processed under the hood and moved to the Dead Letter Queue (DLQ).
    • No run history is displayed in the Logic App, even though the message was processed.
  3. Test with a different configuration:

    Place a similar message on the queue, but leave the Content-Type header empty or remove it.

    • In this case, the Logic App run history does display the processing correctly.

Expected Behavior:

The Logic App run history should always be visible, regardless of whether the JSON message is malformed or not, as long as the trigger processes the message.

What type of Logic App Is this happening in?

Consumption (Portal)

Which operating system are you using?

Windows

Are you using new designer or old designer

New Designer

Did you refer to the TSG before filing this issue? https://aka.ms/lauxtsg

Yes

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Compose": {
                "type": "Compose",
                "inputs": "@triggerBody()?['contentData']",
                "runAfter": {}
            },
            "Complete_the_message_in_a_queue": {
                "type": "ServiceProvider",
                "inputs": {
                    "parameters": {
                        "queueName": "sampleq1",
                        "lockToken": "@triggerBody()?['lockToken']"
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "serviceBus",
                        "operationId": "completeQueueMessageV2",
                        "serviceProviderId": "/serviceProviders/serviceBus"
                    }
                },
                "runAfter": {
                    "Compose": [
                        "SUCCEEDED"
                    ]
                }
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {},
        "triggers": {
            "When_messages_are_available_in_a_queue_(peek-lock)": {
                "type": "ServiceProvider",
                "inputs": {
                    "parameters": {
                        "queueName": "sampleq1"
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "serviceBus",
                        "operationId": "peekLockQueueMessagesV2",
                        "serviceProviderId": "/serviceProviders/serviceBus"
                    }
                },
                "splitOn": "@triggerOutputs()?['body']"
            }
        }
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Browser

Chrome

Additional context

No response

hartra344 commented 2 hours ago

Moving this to the backend issue repo. If this is affecting an production environments for you, I would highly recommend opening a support ticket for quicker responses.