From dece30e44715235d209cf2a77ef06716910abb77 Mon Sep 17 00:00:00 2001 From: Michael Flanakin Date: Wed, 26 Aug 2026 15:12:45 -0700 Subject: [PATCH] fix(hubs): make ADF trigger startTime Z-suffix conditional on UTC fallback FinOps hub deployments to regions not covered by timeZones.bicep's region-to-Windows-timezone map (e.g. Sweden Central) fail with InvalidWorkflowTriggerRecurrence. Data Factory requires startTime to end in 'Z' when timeZone resolves to 'UTC', but the three schedule triggers (config_DailySchedule, config_MonthlySchedule, queries_DailySchedule) hardcoded startTime without a trailing 'Z', which is only valid when timeZone is non-UTC. Emit the 'Z' suffix only when timeZones.outputs.Timezone resolves to the 'UTC' fallback, so mapped, non-UTC regions keep scheduling on local wall-clock time as before. Fixes #2157 Note: the reporter also saw a failure in Norway East, which IS in the timezone map (non-UTC), so this fix does not explain or address that - it needs separate diagnostic info and is treated as a distinct, unverified issue. Co-Authored-By: Claude Sonnet 5 --- .../Microsoft.CostManagement/ManagedExports/app.bicep | 9 +++++++-- .../Microsoft.FinOpsHubs/IngestionQueries/app.bicep | 6 +++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/templates/finops-hub/modules/Microsoft.CostManagement/ManagedExports/app.bicep b/src/templates/finops-hub/modules/Microsoft.CostManagement/ManagedExports/app.bicep index 9137669c1..386875b56 100644 --- a/src/templates/finops-hub/modules/Microsoft.CostManagement/ManagedExports/app.bicep +++ b/src/templates/finops-hub/modules/Microsoft.CostManagement/ManagedExports/app.bicep @@ -112,7 +112,11 @@ resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' existing = { recurrence: { frequency: 'Hour' interval: 24 - startTime: '2023-01-01T01:01:00' + // Data Factory requires a trailing 'Z' on startTime when timeZone resolves to 'UTC' (the + // fallback for regions not in timeZones.bicep's map); a missing 'Z' fails trigger activation + // with InvalidWorkflowTriggerRecurrence. Mapped, non-UTC regions must keep the no-'Z' format + // so they continue scheduling on local wall-clock time. + startTime: timeZones.outputs.Timezone == 'UTC' ? '2023-01-01T01:01:00Z' : '2023-01-01T01:01:00' timeZone: timeZones.outputs.Timezone } } @@ -138,7 +142,8 @@ resource dataFactory 'Microsoft.DataFactory/factories@2018-06-01' existing = { recurrence: { frequency: 'Month' interval: 1 - startTime: '2023-01-05T01:11:00' + // See trigger_DailySchedule above for why the 'Z' suffix is conditional on the UTC fallback. + startTime: timeZones.outputs.Timezone == 'UTC' ? '2023-01-05T01:11:00Z' : '2023-01-05T01:11:00' timeZone: timeZones.outputs.Timezone schedule: { monthDays: [ diff --git a/src/templates/finops-hub/modules/Microsoft.FinOpsHubs/IngestionQueries/app.bicep b/src/templates/finops-hub/modules/Microsoft.FinOpsHubs/IngestionQueries/app.bicep index 38fcfb22b..43fe519cd 100644 --- a/src/templates/finops-hub/modules/Microsoft.FinOpsHubs/IngestionQueries/app.bicep +++ b/src/templates/finops-hub/modules/Microsoft.FinOpsHubs/IngestionQueries/app.bicep @@ -96,7 +96,11 @@ resource trigger_DailySchedule 'Microsoft.DataFactory/factories/triggers@2018-06 recurrence: { frequency: 'Hour' interval: 24 - startTime: '2023-01-01T01:01:00' + // Data Factory requires a trailing 'Z' on startTime when timeZone resolves to 'UTC' (the + // fallback for regions not in timeZones.bicep's map); a missing 'Z' fails trigger activation + // with InvalidWorkflowTriggerRecurrence. Mapped, non-UTC regions must keep the no-'Z' format + // so they continue scheduling on local wall-clock time. + startTime: timeZones.outputs.Timezone == 'UTC' ? '2023-01-01T01:01:00Z' : '2023-01-01T01:01:00' timeZone: timeZones.outputs.Timezone } }