How to setup environment variables in dotnet?

i want to move my secret api keys and connection strings from appsettings.json file to the render environment variables for security purpose. i’m currently facing problems setting it up. Please, I need some help.

Hi there,

Can you please elaborate on the problems you’re running into?

If it’s retrieving the variable within code, have you tried Environment.GetEnvironmentVariable(): https://learn.microsoft.com/en-us/dotnet/api/system.environment.getenvironmentvariable?view=net-8.0

Regards,
Mike


Render Support Engineer, MT (UTC-7)

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.