Skip to content

azd propagates dynamic linker/loader (LD_/DYLD_) variables from .env into external tools #8953

Description

@hemarina

Description

When azd runs external tools (docker, npm, python, maven, go, dotnet, bicep, kubectl, azd exec, hooks, and extensions), it builds the tool's environment from the current process environment plus the values stored in the azd environment's .env file (.azure/<env>/.env).

Today that includes environment variable names in the platform dynamic linker/loader namespace — those beginning with LD_ (Linux ld.so) or DYLD_ (macOS dyld), such as LD_PRELOAD, LD_LIBRARY_PATH, or DYLD_INSERT_LIBRARIES. These variables change how a process resolves and loads shared libraries at startup, and a project's .env should not influence that for the tools azd invokes.

Expected behavior

azd should not carry LD_/DYLD_-prefixed variables from the environment's .env file into the environments of the tools it runs. Names outside that reserved namespace (for example LDFLAGS, LDLIBS) should be unaffected, and matching should be case-insensitive.

Notes

  • Most tool paths build their environment via Environment.Environ().
  • A few paths build it directly from Environment.Dotenv() (azd exec, the AKS/kubectl sync, and the .NET container app Bicep template context), so they need the same treatment.

Metadata

Metadata

Assignees

Labels

area/environmentEnvironment management, .env filesarea/securitySecurity, permissions, RBACarea/toolsExternal tools (Docker, npm, Python)bugSomething isn't working

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions