Fix date format for serviceBusQueue trigger metadata to ensure ISO8601 compliance#354
Draft
Fix date format for serviceBusQueue trigger metadata to ensure ISO8601 compliance#354
Conversation
Co-authored-by: swapnil-nagar <1988068+swapnil-nagar@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Improve date format for dates in triggerMetadata for servicebusQueue trigger.
Fix date format for serviceBusQueue trigger metadata to ensure ISO8601 compliance
Jun 25, 2025
|
Doing transformations on the RPC metadata after it comes in seems more like a workaround than a fix -- is this a problem that needs to be fixed upstream? |
Contributor
Yes, we do plan to address this in the upstream, which is why this PR is currently in draft. Additionally, the upcoming PR for the new SDK binding support will include this fix, so we intend to deliver this improvement as part of that new feature. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR fixes an issue where
enqueuedTimeUtcandexpiresAtUtcfields in serviceBusQueue trigger metadata were missing timezone information, causing timezone-dependent behavior when parsing dates.Problem
When using Azure Functions with serviceBusQueue triggers, the
context.triggerMetadatacontained date fields formatted without timezone information:Solution
Added automatic timezone correction for serviceBusQueue triggers to ensure ISO8601 compliance:
Implementation Details
fixDateFormatForServiceBus()function infromRpcTriggerMetadata.tsenqueuedTimeUtc,expiresAtUtc)Testing
Added comprehensive test cases covering:
This is a minimal, surgical fix that ensures consistent date parsing behavior regardless of the Azure Functions host's timezone settings.
Fixes #351.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.