.NET › CI/CD, Publishing & Deployment
How do feature flags decouple code deployment from feature release in a CI/CD workflow?
IntermediateAnswer
Feature flags let you deploy code containing a new feature to production while keeping it disabled/hidden behind a flag, separating the technical act of deployment (shipping code) from the business decision of release (making a feature visible/active) -- this allows continuous deployment of incomplete or in-progress features without user impact, and enables gradual rollout, A/B testing, or instant kill-switch rollback without a new deployment.
builder.Services.AddFeatureManagement();
if (await featureManager.IsEnabledAsync("NewCheckoutFlow")) {
return NewCheckoutHandler();
} else {
return LegacyCheckoutHandler();
}
// Code is deployed; the flag controls whether it's actually activeReal-world example A team merges and deploys a large in-progress checkout redesign to production daily behind a feature flag disabled for all users, avoiding a risky long-lived feature branch while keeping the feature completely invisible until it's ready and explicitly enabled.