Use this when checking data and results against rules in automation.
Validation · Automation Design
Validation in automation design checks inputs, current state and results against rules — formats, ranges, existence — catching bad data before it causes damage.
1. Validate inputs, environment and results.
2. Fail early with clear messages.
3. Use schemas.
4. Validate generated configs before pushing.
5. Test validation itself.
input → schema → environment → result validation
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
git diff --checkPrimary Commands
Configuration and operational commands for this Topic.
Verification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Known-good, broken and when it is fixed Verify boundary
Verification for Automation Design → Validation must discriminate known-good from broken/suspicious state. With git diff --check, known-good is: the pending diff has no whitespace errors reported by Git. Broken/suspicious is: reported errors indicate malformed patch text or conflict remnants before execution. Read back the same target after the minimal approved change, then run tool/language-specific syntax/schema tests and the original preflight validation.
Step 2 Verification path Verify boundary
The negative fixture should deliberately exercise risks such as implicit defaults, hidden dependencies, duplicate dispatch, worker drift, timeout without cancellation, retries against non-idempotent operations and confusing control-plane completion with target convergence, choosing the cases most relevant to schema and semantic validation before execution, actionable errors with field/path identity and revalidation after defaults/transforms are applied.
Step 3 Observation-driven troubleshooting tree Narrow the fault
Troubleshoot Automation Design → Validation from one exact failing target, revision/input and timestamp. Capture git diff --check before mutation, then branch by the first divergent observation: static syntax fails, repair the source before environment testing; syntax passes but schema or references fail, fix the contract/input boundary; preview differs from the approved delta, stop before mutation; all preflight passes but postcondition fails, troubleshoot execution or target state rather than weakening validation. Typical failure signatures include validator disagreement between local and CI, stale generated artifacts, a clean diff with invalid semantics, a preview that omits provider side effects, or post-change state that violates an earlier approved assumption.
Step 4 Failure signatures, dependencies and operational guardrails Narrow the fault
Failure-signature and guardrail reference for Automation Design → Validation: Validator disagreement between local and CI, stale generated artifacts, a clean diff with invalid semantics, a preview that omits provider side effects, or post-change state that violates an earlier approved assumption. Operational guardrail: Record which validator, version, input revision and target scope produced the result; git diff --check is intentionally only a whitespace/conflict-marker check. Dependencies that can mimic the same symptom are tool and schema versions, renderer or template inputs, environment-specific variables, policy engines, target reachability and any simulator/check-mode limitations.
Step 5 Common mistakes Narrow the fault
- Validation only in the UI, not in the automation.
- Validate inputs, current state and results.
- Reject bad data before it causes damage.
- Validation messages must say what is wrong.
- Schema validation (JSON Schema, pydantic, argument specs) — input checks
- Pre-flight checks — environment
- Post-change validation — result
ReferenceHow it works1 section · depth on demand
How it works
Automation Design → Validation owns the validation chain from source/static checks through schema/type checks, semantic policy, dry-run or preview, bounded execution and postcondition verification. Execution mechanics: Validation should move from cheapest non-mutating checks to environment-aware checks, then to a bounded preview/test and finally to post-change read-back; each layer answers a different question and a pass at one layer must not be promoted to a pass at the next. Keep adjacent dependencies separate: tool and schema versions, renderer or template inputs, environment-specific variables, policy engines, target reachability and any simulator/check-mode limitations. The mapped read surface git diff --check exposes whitespace/conflict-marker style errors in pending repository changes.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
Validation in automation design checks data and conditions at every stage: inputs before the run, the target's state before a change, the rendered configuration before deployment, and the result afterwards. Each check stops a different kind of mistake.
| Stage | Example check |
|---|---|
| Input | Schema validation of YAML/JSON |
| Pre-change | Device reachable, enough disk space, no active alarms |
| Rendered output | Linting, terraform validate, config syntax check |
| Post-change | Interface up, neighbor established, service responds |
check-jsonschema --schemafile schemas/vlans.json data/vlans.yml
ansible-lint playbooks/
Fail fast with a clear message; a validation error before the change is far cheaper than a rollback after it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in Automation Design > Validation. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/well-architected/operational-excellence/enable-automation · confidence 94%Deep reference
Healthy vs suspicious evidence
Output interpretation
For schema and semantic validation before execution, actionable errors with field/path identity and revalidation after defaults/transforms are applied, prefer typed fields and stable IDs over human presentation text.