Add regression test for ADF schedule trigger time zone IDs - #2237
Open
RolandKrummenacher wants to merge 3 commits into
Open
Add regression test for ADF schedule trigger time zone IDs#2237RolandKrummenacher wants to merge 3 commits into
RolandKrummenacher wants to merge 3 commits into
Conversation
Data Factory schedule triggers validate the timeZone field against Windows time zone IDs; an invalid value (e.g. the display name 'Japan Standard Time' instead of the Windows ID 'Tokyo Standard Time', fixed in #2236) passes deployment but fails at trigger activation. Adds a Pester test that parses timeZones.bicep and verifies every mapping resolves in the Windows time zone registry with exact casing, rejects IANA-style and display-name IDs, checks region keys against open data, and pins the 'UTC' fallback. Extends the PowerShell Tests workflow paths to trigger on timeZones.bicep changes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…loy templates The compiled templates in docs/deploy are regenerated at release time and lagged the src fixes: finops-hub-latest.json and finops-hub-14.0.json still mapped Japan regions to the display name 'Japan Standard Time', and finops-hub-preview.json shipped a whole set of pre-fix display names (Australian Eastern/Brasil/Central European/Greenwich Mean) that fail ADF trigger activation. Surgically corrects the mapping values to the Windows time zone IDs matching the current src mapping (northeurope goes to 'GMT Standard Time' per src, not W. Europe). Extends HubsAdfTriggerTimeZones.Tests.ps1 to also validate the mappings in finops-hub-latest.json and finops-hub-preview.json so shipped artifacts can no longer drift invalid, and adds those paths to the Pester workflow triggers. Raised in the PR #2236 review discussion. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Adds regression coverage to ensure Azure Data Factory schedule-trigger timeZone values used by FinOps hubs remain valid Windows time zone IDs (as validated by ADF at trigger activation time), and updates shipped deploy templates that had drifted to invalid display-name values.
Changes:
- Adds a new Pester unit test that parses
timeZones.bicepand verifies mappings are valid (including canonical ID casing on Windows) and region keys match the expected normalization / open-data region set. - Extends the same Windows-registry validation to the shipped deploy artifacts (
finops-hub-latest.jsonandfinops-hub-preview.json) and adds parser guards to avoid silent “zero testcases” passes. - Fixes invalid time zone mapping values in deploy templates (notably replacing display names with valid Windows time zone IDs) and updates the dev workflow path filters to run the Pester job when these mapping sources change.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| src/powershell/Tests/Unit/HubsAdfTriggerTimeZones.Tests.ps1 | New unit tests validating time zone mappings in source bicep and shipped templates, with Windows-registry validation and structural guards. |
| docs/deploy/finops-hub-preview.json | Corrects multiple region mappings from display names to valid Windows time zone IDs in the shipped preview template. |
| docs/deploy/finops-hub-latest.json | Fixes Japan region mapping values to a valid Windows time zone ID in the shipped latest template (both embedded mapping blocks). |
| docs/deploy/finops-hub-14.0.json | Applies the same Japan mapping fix to the versioned 14.0 shipped template (both embedded mapping blocks). |
| .github/workflows/dev.yml | Expands pull-request path filters so PowerShell tests run when timeZones.bicep or the shipped deploy templates change. |
flanakin
approved these changes
Aug 5, 2026
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.
🛠️ Description
Data Factory schedule triggers validate the
timeZonefield against Windows time zone IDs (the set enumerated by[TimeZoneInfo]::GetSystemTimeZones()/Get-TimeZone -ListAvailableon Windows). An invalid value — such as the display nameJapan Standard Timeinstead of the Windows IDTokyo Standard Time, fixed in #2236 — passes template deployment but fails later at trigger activation withErrorCode=InvalidWorkflowTriggerRecurrence.This PR adds regression coverage so this class of bug is caught in CI instead of at deployment time, and fixes the shipped deploy templates that had already drifted:
src/powershell/Tests/Unit/HubsAdfTriggerTimeZones.Tests.ps1parses thetimezoneobjectmapping intimeZones.bicepand verifies:Windows-latestPester job, i.e. against the same ID set ADF validates);Area/Location) or a known display-name trap (Japan Standard Time,Universal Coordinated Time);toLower(replace(location, ' ', ''))lookup normalization and exists insrc/open-data/Regions.csv;'UTC';docs/deploy/finops-hub-latest.jsonandfinops-hub-preview.json, since those are regenerated at release time and can lag a src fix. Older versioned templates are historical artifacts and intentionally not covered.finops-hub-latest.json/finops-hub-14.0.json,finops-hub-preview.jsonshipped a whole set of pre-fix display names (Australian Eastern Standard Time,Brasil Standard Time,Central European Time,Greenwich Mean Time,Japan Standard Time) that all fail trigger activation. This PR surgically corrects those 24 mapping values to the Windows IDs matching the current src mapping (diff is limited to mapping lines only; no full template regeneration, to avoid pulling unreleaseddevchanges into released artifacts).northeuropemaps toGMT Standard Timeper src, notW. Europe Standard Time.dev.ymlnow also triggers the Pester job on changes totimeZones.bicep,finops-hub-latest.json, andfinops-hub-preview.json(same pattern as the existing KQL path filters).On non-Windows machines the registry checks are skipped (
-Skip:(-not $IsWindows)) since .NET resolves time zones via ICU/IANA there; the structural checks still run cross-platform.devthe test fails on exactly the twoJapan Standard Timeentries intimeZones.bicep(that's the bug it exists to catch); the deploy-template checks are green with the fixes in this PR. Keeping this as a draft until #2236 is merged.📷 Screenshots
Verified in both directions locally (Windows):
dev+ this PR's template fixes: 211 passed, 3 failed — exactly thejapaneast/japanwestsrc registry checks and the display-name check forJapan Standard Time(fixed by Fix/managed exports japan timezone #2236).🙋♀️ Checklist
🤖 Generated with Claude Code