在 Azure Function Apps 中保密

Keeping secrets in Azure Function Apps

本文:

https://www.visualstudio.com/en-us/docs/release/examples/azure/change-config-azure-webapps

讨论使用 Powershell Set-AzureWebsite 命令 "change the appSettings and connectionStrings values in the Web.config file"

这是否适用于 Azure Functions?

是的,它们基于相同的平台,因此工作原理相同。例如如果您设置名为 FOO 的 Azure 应用程序设置,您将拥有一个名为 FOO 的环境变量,您可以在函数逻辑中使用它。

或者如果使用C#,你也可以这样写ConfigurationManager.AppSettings["FOO"]