Use this when checking systems before a change.
Pre-change Validation
Pre-change validation checks that systems are healthy and in the expected state before a change, such as backups taken, services up and configuration matching, so problems are not blamed on the change.
1. Pre-change validation: dry run, health, backups, capacity.
2. Attach results to change.
3. Abort if not ready.
4. Automate.
5. Repeatable.
pre-checks → evidence → proceed
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 Command read-back and what it shows Verify boundary
Read back Change Management → Pre-change Validation with git diff --check. Known-good is the candidate passes source and platform validation, target preconditions match expected baseline, rollback material is available and success/failure criteria are defined before change; broken/suspicious remains when any candidate, dependency or target precondition remains unresolved or the change is allowed to proceed without a measurable rollback/independent check. Classify success only when the expected discriminator is present, then repeat the original acceptance/workload test and one adjacent regression check. git diff --check shows only a bounded class of textual diff hygiene problems, but it does not show configuration semantics, target readiness or change safety.
Step 2 Observation-driven branch and next-check logic Narrow the fault
Start from the exact failing target and timestamp. Capture git diff --check before mutation. Branch on evidence: if diff check reports concrete whitespace/conflict issues, fix the candidate first; if diff check is clean but parser/schema fails, stop at candidate validity; if candidate is valid but target/preconditions fail, resolve environment readiness; if all preconditions pass, proceed with explicit rollback and verification criteria. Treat an error, failed result, unexpected state or missing object as a branch trigger and move only one boundary at a time.
Step 3 Common mistakes Narrow the fault
- Skipping pre-checks under time pressure.
- Prove the system is healthy before changing it.
- Take or confirm a backup.
- Compare current configuration with what the change expects.
- Pre-change validation (plan/diff, health, backups) — readiness
terraform plan / ansible --check— dry run- Backup verified — rollback point
ReferenceHow it works1 section · depth on demand
How it works
Change Management → Pre-change Validation owns proposed diff, syntax/schema/policy validation results, target preconditions, maintenance/rollback readiness and dependency health checked before mutation. Pre-change validation should fail closed before deployment when the candidate is malformed, the target is outside expected baseline, prerequisites are unhealthy or rollback/verification criteria are undefined. Keep adjacent boundaries separate: platform-native parsers, schema tools, credentials, target inventory, capacity and maintenance-window constraints require additional checks beyond source-control hygiene. Diagnostic distinction: a clean source diff check removes one class of defect but cannot show semantic validity, target compatibility or operational readiness.
ReferenceImportant terms & boundaries1 section · depth on demand
Method
Pre-change validation confirms, just before a change, that the plan is still valid and the environment is ready.
1. Confirm the change is approved and inside the window.
2. Re-run the plan/dry run and compare with the approved plan — stop if it differs.
3. Check target health and absence of active incidents.
4. Take backups/snapshots and record their locations.
5. Capture a pre-change state snapshot for later comparison.
6. Confirm rollback access (out-of-band management, console, credentials).
terraform plan -out=tfplan && terraform show -json tfplan | jq '.resource_changes | length'
A plan that changed since approval means something else changed the environment — investigate before continuing.
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 Change Management > Pre-change Validation. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/azure/well-architected/operational-excellence/safe-deployments · confidence 94%