Azure / Azure/azure-functions-core-tools

func init wrong host.json for dotnet

Open
#2,361 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
5d 4h
Merged PRs (30d)
15

Description

Consider the following sample:

```
> func --version
3.0.3160
> md dotnetfn
> cd dotnetfn
C:\Users\gimmi\temp\fn3\dotnetfn
> func init --worker-runtime dotnet
> type host.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingExcludedTypes": "Request",
"samplingSettings": {
}
}
}
}
> cd ..
> md nodefn
> cd nodefn
> func init --worker-runtime node
> type host.json
{
"version": "2.0",
"logging": {
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
},
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
}
```

As you can see, for the `dotnet` runtime the configuration contain the `samplingExcludedTypes` field that is not correct, at least according to https://github.com/MicrosoftDocs/azure-docs/issues/47219

Contributor guide

Open the contributing guide

Research direction

Start by tracing the implementation of `func init --worker-runtime dotnet` and compare its generated `host.json` with the sample in this issue and the referenced Azure documentation issue. Done means the dotnet template emits the correct Application Insights sampling configuration rather than the reported `samplingExcludedTypes` field.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, csharp
Domain
cli, cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.