Answer the question
In order to leave comments, you need to log in
How to properly store C# secrets on Linux?
I have an Asp.Net Core web application.
Development in Windows, hosting in Linux
Deployment occurs via FTP directly from the developer's machine to the "combat" server (and subsequent restart of the service).
The application itself runs as a service.
Question: how to store secrets in Linux?
Of.guide suggests storing secrets in the user's folder (from whom the project is launched?). There are doubts about the correctness of this decision.
It seems more correct to be able to pass secrets through the environment variables of the service, but I can not google a way to "merge" these variables and configuration files.
Answer the question
In order to leave comments, you need to log in
In general, it turned out to be simple
. It is easy to write in the service file
Environment=KEY=VALUE
. At the same time, nested fields are separated by a double underscore
. For example, ConnectionString turns from
{
"ConnectionStrings": {
"DefaultConnection": "SomeString"
}
}
Environment=ConnectionStrings__DefaultConnection='SomeString'
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question