From 6e6892af83837a3685c1d7192b0aa3dc138009ca Mon Sep 17 00:00:00 2001 From: Joakim Carselind Date: Tue, 8 May 2018 20:13:29 +0200 Subject: [PATCH] Escape environment values service files (#6279) --- aspnetcore/host-and-deploy/linux-apache.md | 7 +++++++ aspnetcore/host-and-deploy/linux-nginx.md | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/aspnetcore/host-and-deploy/linux-apache.md b/aspnetcore/host-and-deploy/linux-apache.md index d2930c0b62..0236e24c94 100644 --- a/aspnetcore/host-and-deploy/linux-apache.md +++ b/aspnetcore/host-and-deploy/linux-apache.md @@ -185,6 +185,13 @@ WantedBy=multi-user.target > [!NOTE] > **User** — If the user *apache* isn't used by the configuration, the user must be created first and given proper ownership for files. +> [!NOTE] +> Some values (for example, SQL connection strings) must be escaped for the configuration providers to read the environment variables. Use the following command to generate a properly escaped value for use in the configuration file: +> +> ```console +> systemd-escape "" +> ``` + Save the file and enable the service: ```bash diff --git a/aspnetcore/host-and-deploy/linux-nginx.md b/aspnetcore/host-and-deploy/linux-nginx.md index ccd9054f66..1dd04f5b02 100644 --- a/aspnetcore/host-and-deploy/linux-nginx.md +++ b/aspnetcore/host-and-deploy/linux-nginx.md @@ -180,6 +180,13 @@ WantedBy=multi-user.target **Note:** If the user *www-data* isn't used by the configuration, the user defined here must be created first and given proper ownership for files. **Note:** Linux has a case-sensitive file system. Setting ASPNETCORE_ENVIRONMENT to "Production" results in searching for the configuration file *appsettings.Production.json*, not *appsettings.production.json*. +> [!NOTE] +> Some values (for example, SQL connection strings) must be escaped for the configuration providers to read the environment variables. Use the following command to generate a properly escaped value for use in the configuration file: +> +> ```console +> systemd-escape "" +> ``` + Save the file and enable the service. ```bash