Azure app service's configuration value with \n substring

Artyom Slesarenko 0 Reputation points
2023-05-16T05:17:40.35+00:00

I want to add in my app service application setting which includes some \n. If I add it by using New application setting button, it will replace \n to space. I tried to use advanced edit to add it in JSON, but it was converted to multiple strings. Also I tried to use \n and in that case it shows correctly if I add it as first variant. But in that case if I copy it it also stands to be with \n. What the correct way to set application setting which contains \n?

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,935 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 30,281 Reputation points Microsoft Employee Moderator
    2023-05-16T21:37:05.2166667+00:00

    I think this OS and language runtime dependent @Artyom Slesarenko . I wasn't able get it a new line to show up on a Linux app running PHP or dotnet. I also attempted a test variable in my WSL instance and wasn't able to get \n to be recognized as a new line.

    What did work however, at least in .NET 7, was using an app configuration reference. This is a viable option if all you're doing is setting a app setting.

    enter image description here

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.