In an Azure App Service web app, how do you insert a newline character (ie. \\n) into an app setting using the Azure portal? Using \\n
doesn't appear to get escaped like it would be in C#/json/etc.
If it's not possible, what is the recommended way to configure long strings of text to pass into an app? We're also using continuous integration in Visual Studio Team Services and would prefer to not get into text transformations during the build process.
I don't think the Portal supports doing this. However, you should be able to do it via API. eg try this:
"test": "1234\\n5678"
You can do it through Azure PowerShell task, but just remain newline symbol, the value won't be in multiple lines, for example:
$webAppName="XXX"
$resourceGroupName="XXX"
$newAppSettings =@{"newSetting01"="newValue01";"newSetting02"="t1\nt2\n123456"}
Set-AzureRmWebApp -AppSettings $newAppSettings -Name $webAppName -ResourceGroupName $resourceGroupName
There is an article about update application setting: Apply / Update application settings for Azure App Service using PowerShell
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.