Attempting to delete an existing environment variable by deleting it from the
env block of a manifest file does not work.
You may expect setting/unsetting
env variables via the manifest file to behave similar to running cf CLI commands, resulting in unexpected behavior.
For example, when developers push new versions of applications using blue/green deployments, old settings are preserved and applied even though the settings have been removed from the manifest.
This happens because, an environment variable is set on the container and belongs to the container’s environment. It persists even when the app is restarted or stopped. Removing the
env block from the manifest, only tells cloud foundry to not set the
env variable. It is not an instruction to delete it.
For more information, refer to
Environment Variables - App Manifest Attribute Reference.