Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Built-in Service Bus trigger converts datetime values in JSON payload #734

Closed
johnstrand opened this issue Feb 24, 2023 · 12 comments
Closed
Labels

Comments

@johnstrand
Copy link

johnstrand commented Feb 24, 2023

Describe the Bug

I have a solution where one Logic App sends a message to a Service Bus queue, and another Logic App, using the "When messages are available in a queue"-trigger, processes them. The problem occurs when sending a JSON object with a property containing a datetime value without time zone indicator.

As a reduced example, I sent:

{
  "date": "2023-01-01T00:00:00"
}

to the queue, but on the receiving end, my message looks like this:

{
  "date": "2022-12-31T23:00:00Z"
}

So, somewhere along the way, the datetime value gets implicitly treated as UTC and then serialized with the Z-suffix. I fully expect that data sent to a queue should be received in an identical state, and this kind of mangling has a potential for causing issues.

As an experiment, I used the C# SDK to retrieve the same message from the same queue, and that time the message had the expected, original content.

Plan Type

Standard

Steps to Reproduce the Bug or Issue

Create a workflow that sends a message to Service Bus
Ensure that the workflow sends a property containing a datetime value without time zone indicator
Create a workflow that receives a message from Service Bus
Trigger the first workflow
Observe the mangled data

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Compose": {
                "type": "Compose",
                "inputs": "@triggerOutputs()?['body']?['contentData']",
                "runAfter": {}
            }
        },
        "triggers": {
            "When_messages_are_available_in_a_queue": {
                "type": "ServiceProvider",
                "inputs": {
                    "parameters": {
                        "queueName": "queue1",
                        "isSessionsEnabled": false
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "serviceBus",
                        "operationId": "receiveQueueMessages",
                        "serviceProviderId": "/serviceProviders/serviceBus"
                    }
                },
                "splitOn": "@triggerOutputs()?['body']"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {}
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Additional context

No response

AB#17312327

@github-actions
Copy link

This issue is stale because it has been open for 45 days with no activity.

@github-actions github-actions bot added the stale label Apr 10, 2023
@saroja-sattigeri
Copy link

saroja-sattigeri commented Apr 17, 2023

@johnstrand, Could you please test the same scenario via service bus explorer and let me know the status?

@github-actions github-actions bot removed the stale label Apr 17, 2023
@github-actions
Copy link

github-actions bot commented Jun 1, 2023

This issue is stale because it has been open for 45 days with no activity.

@github-actions github-actions bot added the stale label Jun 1, 2023
@github-actions
Copy link

This issue was closed because it has been inactive for 14 days since being marked as stale.

@jdelforno
Copy link

We've run into this issue and for the past week, have been trying to narrow it down.

The old connector doesn't have this issue so we're unsure as to why the new connector is converting timestamps.

@johnstrand
Copy link
Author

I've tried looking but been able to find it again, but I seem to recall seeing an issue or post somewhere that indicated that this was caused by the Service Bus trigger for isolated host Azure Functions

@saroja-sattigeri
Copy link

@johnstrand, Thanks for your response could you please test the same scenario via service bus explorer and let me know if you see same behavior there also?

@johnstrand
Copy link
Author

@saroja-sattigeri When fetching the data via Service Bus Explorer, or using the SDK in LINQPad, the message is retrieved correctly

@jdelforno
Copy link

Describe the Bug

I have a solution where one Logic App sends a message to a Service Bus queue, and another Logic App, using the "When messages are available in a queue"-trigger, processes them. The problem occurs when sending a JSON object with a property containing a datetime value without time zone indicator.

As a reduced example, I sent:

{
  "date": "2023-01-01T00:00:00"
}

to the queue, but on the receiving end, my message looks like this:

{
  "date": "2022-12-31T23:00:00Z"
}

So, somewhere along the way, the datetime value gets implicitly treated as UTC and then serialized with the Z-suffix. I fully expect that data sent to a queue should be received in an identical state, and this kind of mangling has a potential for causing issues.

As an experiment, I used the C# SDK to retrieve the same message from the same queue, and that time the message had the expected, original content.

Plan Type

Standard

Steps to Reproduce the Bug or Issue

Create a workflow that sends a message to Service Bus Ensure that the workflow sends a property containing a datetime value without time zone indicator Create a workflow that receives a message from Service Bus Trigger the first workflow Observe the mangled data

Workflow JSON

{
    "definition": {
        "$schema": "https://schema.management.azure.com/providers/Microsoft.Logic/schemas/2016-06-01/workflowdefinition.json#",
        "actions": {
            "Compose": {
                "type": "Compose",
                "inputs": "@triggerOutputs()?['body']?['contentData']",
                "runAfter": {}
            }
        },
        "triggers": {
            "When_messages_are_available_in_a_queue": {
                "type": "ServiceProvider",
                "inputs": {
                    "parameters": {
                        "queueName": "queue1",
                        "isSessionsEnabled": false
                    },
                    "serviceProviderConfiguration": {
                        "connectionName": "serviceBus",
                        "operationId": "receiveQueueMessages",
                        "serviceProviderId": "/serviceProviders/serviceBus"
                    }
                },
                "splitOn": "@triggerOutputs()?['body']"
            }
        },
        "contentVersion": "1.0.0.0",
        "outputs": {}
    },
    "kind": "Stateful"
}

Screenshots or Videos

No response

Additional context

No response

AB#17312327

Please refer to dotnet/runtime#1566 as I believe it's the upstream issue.

We've resolved the problem it seems by setting the WEBSITE_TIME_ZONE to "UTC". Whilst not ideal.. it's working and not converting time zones.

@jdelforno
Copy link

MSFT Support team have confirmed that this is an issue via MSFT Ticket: 2306210030002343 and are investigating potential options.

@saroja-sattigeri
Copy link

Thanks for the update @jdelforno

@saroja-sattigeri
Copy link

saroja-sattigeri commented Jul 6, 2023

Hi @jdelforno, As product group is looking into other options for above behavior in MS ticket just wanted to check if any further concerns before closing this Github issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants