We're using blue/green and canary deployments with revision labels for several Azure Container Apps, such as an API and an authentication service. Each revision has environment variables that point to other services and frontend URLs. A staging revision uses staging endpoints and is tested through the staging label URL.
The problem appears when promoting that revision to production: moving the production label only changes which revision receives traffic. It does not change the revision's environment variables, so the promoted revision still points to staging services. What is the recommended way to handle configuration that differs between staging and production? Is there a native slot-style setting that stays with each environment, or should the deployment pipeline create a production revision using the promoted image and production-specific configuration?
2 Answers
Treat staging and production as separate runtime environments, even when they use the same image digest. Canary or blue/green traffic shifting is intended to compare two versions within the same environment, and both versions need configuration that is valid for that environment. Make releases backward-compatible with their dependencies, then deploy the same immutable image to production with production endpoints, secrets, and other settings before shifting traffic. There isn’t an App Service-style sticky slot setting that rewrites revision-scoped environment variables during promotion.
Container App environment variables are part of the revision configuration, not something that automatically changes when a label moves. Keep the image artifact environment-neutral, then inject environment-specific values when creating the revision. In practice, promotion usually means deploying the already-tested image again with the production configuration, creating a new production revision, and then moving production traffic or its label to that revision. Secrets and configuration can be supplied through Container Apps settings or a secret store rather than being baked into the image.

Changing the label alone won’t do this because it only changes routing. The staging revision still has the exact settings it was created with, so a separate production revision or deployment step is needed.