Skip to content

environment variables with DOTNET_CONTAINER_ or DOTNET_SDK_CONTAINER_ prefix #41609

@kasperk81

Description

@kasperk81

i see that it's an existing pattern in containers that a generic SDK_ prefix is used instead of DOTNET_CONTAINER_ or DOTNET_SDK_CONTAINER_ which is a better namespace prefix.

  1. The Twelve-Factor App Methodology

https://12factor.net/config
A litmus test for whether an app has all config it needs in env vars is whether the codebase could be made open source at any moment, without compromising any credentials. Using namespaced prefixes like MYAPP_ helps prevent collisions and makes it clear which app an environment variable pertains to.

  1. Heroku's Best Practices for Config Vars

https://devcenter.heroku.com/articles/config-vars
Use a common prefix for related variables to group them logically. For example, if your app’s name is 'MYAPP', then a good practice is to prefix your variables with 'MYAPP_' to avoid collisions with other applications and to make it clear which application a variable pertains to.

  1. AWS Lambda Environment Variables Best Practices

https://docs.aws.amazon.com/lambda/latest/dg/configuration-envvars.html
To avoid naming conflicts, use a consistent naming convention, such as APPNAME_VARIABLE, where APPNAME is the name of your application or service.

  1. Kubernetes Configuration Best Practices

https://kubernetes.io/docs/tasks/inject-data-application/environment-variable-expose-pod-information/
Use descriptive variable names and consider namespacing them with your application or organization name to avoid conflicts and to maintain clarity.

  1. Google Cloud Environment Variables Best Practices

https://cloud.google.com/functions/docs/configuring/env-var
Prefix your environment variables with the service name or application name to prevent collisions and to organize them clearly, such as SERVICE_NAME_VARIABLE_NAME.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-CLIArea-ContainersRelated to dotnet SDK containers functionalityuntriagedRequest triage from a team member

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions