Azure Logic Apps Recurrence Trigger and Azure Service Bus Scheduled Message: Timezone Conversion Requirements
29K reputation · 13 Dec 2020, 14:34 UTC
Ensure that a Logic Apps recurrence trigger configured with a specific timezone correctly schedules Azure Service Bus messages at the intended local time.
In Consumption logic apps the trigger outputs local time that must be manually converted to UTC before setting the Service Bus ScheduledEnqueueTimeUtc property; Standard logic apps already provide the trigger time in UTC, but the underlying conversion logic still needs to be understood, especially during daylight‑saving transitions where offset changes can shift the intended instant.
What is the recommended method to convert the trigger's scheduled time to UTC for Service Bus in Consumption logic apps? How does the Standard logic app's triggerOutputs?['scheduledTime'] represent the original local time after timezone handling? What verification steps confirm that the enqueued message appears in Service Bus at the correct instant across a DST boundary?
1 answer
1 question comment
Use comments to ask for clarification. Post a solution as an answer.
29,025 reputation · 13 Dec 2020, 21:16 UTC
TimeZone ID format and field differences
When using @convertTimeZone in a Consumption workflow, the timeZone argument must be a Windows time‑zone name (e.g., "Pacific Standard Time"). Supplying an IANA identifier like "America/Los_Angeles" results in a runtime error because the function relies on the Windows time‑zone database embedded in the Logic Apps runtime.
In Consumption logic apps the recurrence trigger exposes triggerOutputs()?['startTime'] which is already expressed in the timeZone you set. Therefore you must convert that value to UTC before assigning it to scheduledEnqueueTimeUtc. In Standard logic apps the trigger normalises the fire instant to UTC and provides triggerOutputs()?['scheduledTime'] directly; this field already contains the correct UTC timestamp, so no conversion is needed unless you need to display the original local time.
To verify the conversion across a DST change, add a temporary Compose action that outputs both the raw startTime (or scheduledTime) and the result of @convertTimeZone. Then, after the workflow runs, inspect the Service Bus message’s scheduledEnqueueTimeUtc via the Service Bus Explorer or the Azure CLI command:
az servicebus queue message show \
--resource-group MyRG \
--namespace-name MyNs \
--queue-name MyQueue \
--name \
--query scheduledEnqueueTimeUtc
The returned UTC string should match the value produced by the convertTimeZone expression for both summer and winter dates, confirming that the offset adjustment is applied correctly.