I am using Visual Studio 2015 for Azure function. But I have questions:
1) How to define connection string of Azure SQL Database in Azure function using VS 2015?
2) How can I get the connection string from an Azure function in VS 2015?
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.
More info at the Application Settings section of How to manage a function app in the Azure portal
To read an appsetting (which are stored in appsettings.json and made available as environment variables) you can do something like this
public static string GetEnvironmentVariable(string name)
{
return $"{name}: {Environment.GetEnvironmentVariable(name, EnvironmentVariableTarget.Process}");
}
More info on that in the Environment Variables section of Azure Functions C# script developer reference