diff --git a/Function1.cs b/Function1.cs index b30571c..859fa61 100644 --- a/Function1.cs +++ b/Function1.cs @@ -7,6 +7,7 @@ using Microsoft.Azure.WebJobs.Host; using Newtonsoft.Json; using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; namespace azure_function_config { @@ -14,7 +15,7 @@ public static class Function1 { [FunctionName("Function1")] public static IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] - HttpRequest req, TraceWriter log, ExecutionContext context) + HttpRequest req, ILogger log, ExecutionContext context) { var config = new ConfigurationBuilder() .SetBasePath(context.FunctionAppDirectory) @@ -25,10 +26,10 @@ public static IActionResult Run([HttpTrigger(AuthorizationLevel.Function, "get", var cstr = config.GetConnectionString("SqlConnectionString"); var setting1 = config["Setting1"]; - log.Info(cstr); - log.Info(setting1); + log.LogInformation($"{cstr}"); + log.LogInformation($"{setting1}"); - log.Info("C# HTTP trigger function processed a request."); + log.LogInformation("C# HTTP trigger function processed a request."); string name = req.Query["name"]; diff --git a/azure-function-config.csproj b/azure-function-config.csproj index 5df18de..238c4ff 100644 --- a/azure-function-config.csproj +++ b/azure-function-config.csproj @@ -1,13 +1,13 @@ - netstandard2.0 - v2 + netcoreapp2.1 + V2 azure_function_config azure_function_config - - + + diff --git a/host.json b/host.json index 7a73a41..dfa11a1 100644 --- a/host.json +++ b/host.json @@ -1,2 +1,3 @@ -{ +{ + "version": "2.0" } \ No newline at end of file diff --git a/local.settings.json b/local.settings.json index 98acc30..01466ec 100644 --- a/local.settings.json +++ b/local.settings.json @@ -1,6 +1,7 @@ { "IsEncrypted": false, "Values": { + "FUNCTIONS_WORKER_RUNTIME": "dotnet", "AzureWebJobsStorage": "UseDevelopmentStorage=true", "AzureWebJobsDashboard": "UseDevelopmentStorage=true", "Setting1": "Value1"