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.
Description
When
azdruns 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.envfile (.azure/<env>/.env).Today that includes environment variable names in the platform dynamic linker/loader namespace — those beginning with
LD_(Linuxld.so) orDYLD_(macOSdyld), such asLD_PRELOAD,LD_LIBRARY_PATH, orDYLD_INSERT_LIBRARIES. These variables change how a process resolves and loads shared libraries at startup, and a project's.envshould not influence that for the toolsazdinvokes.Expected behavior
azdshould not carryLD_/DYLD_-prefixed variables from the environment's.envfile into the environments of the tools it runs. Names outside that reserved namespace (for exampleLDFLAGS,LDLIBS) should be unaffected, and matching should be case-insensitive.Notes
Environment.Environ().Environment.Dotenv()(azd exec, the AKS/kubectl sync, and the .NET container app Bicep template context), so they need the same treatment.