如何使用 Visual Studio 2015 在 Azure 函数中定义连接字符串?
How can I define Connection string in Azure function using Visual Studio 2015?
我为 Azure 函数使用 Visual Studio 2015。但我有疑问:
1) 如何使用 VS 2015 在 Azure 函数中定义 Azure SQL 数据库的连接字符串?
2) 如何从 VS 2015 中的 Azure 函数获取连接字符串?
The App Service Application settings blade is where you configure and manage framework versions, remote debugging, app settings, and connection strings. When you integrate your function app with other Azure and third-party services, you can modify those settings here.
在 How to manage a function app in the Azure portal
的“应用程序设置”部分了解更多信息
要读取应用程序设置(存储在 appsettings.json 中并作为环境变量提供),您可以这样做
public static string GetEnvironmentVariable(string name)
{
return $"{name}: {Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process}");
}
的环境变量部分中有更多相关信息
我为 Azure 函数使用 Visual Studio 2015。但我有疑问:
1) 如何使用 VS 2015 在 Azure 函数中定义 Azure SQL 数据库的连接字符串?
2) 如何从 VS 2015 中的 Azure 函数获取连接字符串?
The App Service Application settings blade is where you configure and manage framework versions, remote debugging, app settings, and connection strings. When you integrate your function app with other Azure and third-party services, you can modify those settings here.
在 How to manage a function app in the Azure portal
的“应用程序设置”部分了解更多信息要读取应用程序设置(存储在 appsettings.json 中并作为环境变量提供),您可以这样做
public static string GetEnvironmentVariable(string name)
{
return $"{name}: {Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process}");
}
的环境变量部分中有更多相关信息