Skip to content

Validate triggers in Test-AdfCode and catch Az trigger errors #435 - #509

Merged
NowinskiK merged 2 commits into
developfrom
issue-435-trigger-validation
Oct 16, 2026
Merged

NowinskiK merged 2 commits into
developfrom
issue-435-trigger-validation

Conversation

@NowinskiK

Copy link
Copy Markdown
Member

Resolves #435 via its two sub-issues. Closes #507, closes #508. Reasoning for the approach is in this comment on #435.

#507: Test-AdfCode validates triggers (build/test time)

  • Warns about every trigger with runtimeState: Started and no pipeline reference, and counts it in WarningCount.
  • Handles the pipelines array (Schedule, BlobEvents, CustomEvents) and the single pipeline object (TumblingWindowTrigger). Stopped triggers are not reported.
  • Docs: new "Trigger Validation" section in docs/FEATURES/BUILD_AND_TEST.md.

#508: start/stop trigger errors are caught (deployment time)

  • Start-AzDataFactoryV2Trigger / Stop-AzDataFactoryV2Trigger write non-terminating errors, so try/catch never saw them under the default $ErrorActionPreference. Both calls now use -ErrorAction Stop, so retries and warnings work whatever the caller's preference is. This also completes the Adds TryCatch to StopTrigger, continuing if fails #404 retry from v1.19.0.
  • Missing or invalid pipeline references is not retried (it is permanent).
  • Start-Trigger returns $true/$false. Start-Triggers tries every trigger and warns about the ones that failed. The deployment carries on.

Tests

  • Test-AdfCode: adf2/TR_without_pipeline.json fixture plus 8 cases per trigger type and state (in TestDrive).
  • Start-Trigger / Stop-Trigger / Start-Triggers: mocks write a non-terminating error, as the real cmdlets do. 9 of the 10 new tests failed before the fix.
  • Locally with Pester 6.2.0, trigger and Test-AdfCode test files: 43/43 passed with $ErrorActionPreference = 'Stop' (as in CI). With Continue: 42/43, the one failure being the existing "wrong path to DF" test, which fails on develop too.
  • Also checked against real Azure with the default preference: the error is now caught, retried and reported as a warning.

Notes

  • The changelog entries are under [Unreleased]. The version (likely 1.20.0) is still to be set at release.
  • "Not found" errors are still retried 5 times. They could be treated as permanent in a follow-up.

🤖 Generated with Claude Code

Kamil Nowinski and others added 2 commits October 16, 2026 22:39
…507

ADF refuses to start a trigger with runtimeState Started and no pipeline
reference, and the deployment can only pass on the API error. Validate it
at build/test time instead. Handles both 'pipelines' (array) and
'pipeline' (TumblingWindowTrigger). Part of #435.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Start-/Stop-AzDataFactoryV2Trigger write non-terminating errors, so
try/catch never caught them under the default ErrorActionPreference:
no retry, no warning, raw error in the error stream. Call them with
-ErrorAction Stop. Do not retry "Missing or invalid pipeline references".
Start-Trigger returns success like Stop-Trigger; Start-Triggers warns
about failed starts and the deployment carries on. Part of #435.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@NowinskiK
NowinskiK merged commit 28037af into develop Oct 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant