Skip to content

Don't fail if applicationPool already contains a given environment variable #94

@andrewlock

Description

@andrewlock

One of the main behaviors of ServiceMonitor.exe is to promote its environment variables to the applicationPool's config. However, if the environment variable is already defined for the pool, then ServiceMonitor.exe fails.

We are currently running into this issue now. Ideally it would be nice if ServiceMonitor.exe could skip environment variables that are already defined for the pool. There are a couple of ways this could be achieved in UpdateEnvironmentVarsToConfig , for example:

  • For each pool, retrieve the currently set env vars (if any), and skip those that are set.
  • Or, set each environment variable individually. If it fails, just skip it (assume already defined) and move to the next.

An alternative approach would be to allow adding to the deny list. e.g. you could support a SERVICEMONITOR_ADDITIONAL_SKIP_VARIABLES variable in FilterEnv that defines the variables to skip:

  • SERVICEMONITOR_ADDITIONAL_VARIABLES="MY_FIRST_VAR,MY_SECOND_VAR"

Would you be open to either of these options? We would be happy to contribute the feature if so?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions