[英]How do you insert a newline in an Azure App Service app setting?
In an Azure App Service web app, how do you insert a newline character (ie. \\n) into an app setting using the Azure portal? 在Azure App Service Web应用程序中,如何使用Azure门户在应用程序设置中插入换行符(即\\ n)? Using
\\n
doesn't appear to get escaped like it would be in C#/json/etc. 使用
\\n
似乎不会像在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.
我们还在Visual Studio Team Services中使用持续集成,并且不希望在构建过程中不进行文本转换。
I don't think the Portal supports doing this. 我不认为Portal支持这样做。 However, you should be able to do it via API.
但是,您应该可以通过API进行操作。 eg try this:
例如试试这个:
"test": "1234\\n5678"
"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: 您可以通过Azure PowerShell任务来执行此操作,但只需保留换行符即可,该值不会出现在多行中,例如:
$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 有关更新应用程序设置的文章: 使用PowerShell为Azure App Service应用/更新应用程序设置
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.