diff --git a/src/Azure.Functions.Cli/StaticResources/host.json b/src/Azure.Functions.Cli/StaticResources/host.json index 83a921673..a85a33a30 100644 --- a/src/Azure.Functions.Cli/StaticResources/host.json +++ b/src/Azure.Functions.Cli/StaticResources/host.json @@ -1,3 +1,11 @@ { - "version": "2.0" + "version": "2.0", + "logging": { + "applicationInsights": { + "samplingExcludedTypes": "Request", + "samplingSettings": { + "isEnabled": true + } + } + } } \ No newline at end of file diff --git a/test/Azure.Functions.Cli.Tests/E2E/InitTests.cs b/test/Azure.Functions.Cli.Tests/E2E/InitTests.cs index 80b0bf0a6..05e872e0e 100644 --- a/test/Azure.Functions.Cli.Tests/E2E/InitTests.cs +++ b/test/Azure.Functions.Cli.Tests/E2E/InitTests.cs @@ -416,6 +416,33 @@ public Task init_function_app_powershell_supports_managed_dependencies() }, _output); } + [Fact] + public Task init_function_app_contains_logging_config() + { + return CliTester.Run(new RunConfiguration + { + Commands = new[] { "init . --worker-runtime node" }, + CheckFiles = new FileResult[] + { + new FileResult + { + Name = "host.json", + ContentContains = new [] + { + "applicationInsights", + "samplingExcludedTypes", + "Request", + "logging" + } + } + }, + OutputContains = new[] + { + "Writing host.json" + } + }, _output); + } + [Fact] public Task init_managed_dependencies_is_only_supported_in_powershell() {