appsettings.json Diff for Environment Drift

When Valid JSON Still Breaks Prod

Configuration binding in .NET is sensitive to both key paths and types. Common drift patterns include:

  • Missing sections like ConnectionStrings or Redis in one environment
  • Different logging levels between staging and prod
  • Endpoints pointing at old services or regions

Example: Connection String Drift

// staging
{
  "ConnectionStrings": {
    "Default": "Server=sql-staging;Database=app;User Id=app;Password=staging;"
  }
}

// production
{
  "ConnectionStrings": {
    "Default": "Server=sql-prod;Database=app;User Id=app;Password=prod;"
  }
}

Both configs are valid JSON, but a hidden drift in ConnectionStrings.Default can explain why staging works while prod fails or connects to the wrong database.

Run a Safe appsettings.json Diff

Use the Config Diff Inspector to flatten both configs and compare:

  • Missing keys like Redis.Host or Auth.Authority
  • Type mismatches on flags and numeric limits
  • Changed critical values for databases, queues, and APIs

Compare appsettings.json Files

Paste two appsettings.json files into the Config Diff Inspector to see exactly where prod and staging drift.

Related Guides

An unhandled error has occurred. Reload