Azure / Azure/azure-functions-core-tools

No error or warning when a line in middle of local.settings.json is missing a comma

Open
#3,607 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
1.5k
Forks
498
Avg merge
4d 20h
Merged PRs (30d)
14

Description

Hi,

I had sorted some lines in `local.settings.json`, which moved a property from the end to somewhere in the middle, and of course, I forgot to check every property in the `Values` object to see if it has a comma `,` at the end.

`local.settings.json` causing the issue:
``` json
{
"IsEncrypted": false,
"Host": {
"CORS": "*"
},
"Values": {
"AzureWebJobsStorage": "UseDevelopmentStorage=true",
"FUNCTIONS_WORKER_RUNTIME": "dotnet-isolated",
"OriginalTokenHeaderName": "Original-Token" <-- here comma is missing
"UseCosmosTableApi": true
}
}
```

Expected: see an Exception/Error in the terminal.

Actual:
``` ps1
[2024-01-05T16:20:23.673Z] Starting JobHost
[2024-01-05T16:20:23.676Z] Starting Host (HostId=1854370345, InstanceId=ad549095-cf4d-496b-ac41-2b7582df95af, Version=4.27.5.21554, ProcessId=22608, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=(null))
[2024-01-05T16:20:23.681Z] Loading functions metadata
[2024-01-05T16:20:23.681Z] Reading functions metadata (Host)
[2024-01-05T16:20:23.683Z] 0 functions found (Host)
[2024-01-05T16:20:23.683Z] Reading functions metadata (Custom)
[2024-01-05T16:20:23.684Z] 1 functions found (Custom)
[2024-01-05T16:20:23.684Z] 0 functions loaded
[2024-01-05T16:20:23.698Z] Generating 0 job function(s)
[2024-01-05T16:20:23.716Z] No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).
[2024-01-05T16:20:23.725Z] HttpOptions
[2024-01-05T16:20:23.726Z] Initializing function HTTP routes
[2024-01-05T16:20:23.729Z] No HTTP routes mapped
[2024-01-05T16:20:23.728Z] {
[2024-01-05T16:20:23.729Z]
[2024-01-05T16:20:23.731Z] "DynamicThrottlesEnabled": false,
[2024-01-05T16:20:23.732Z] "EnableChunkedRequestBinding": false,
[2024-01-05T16:20:23.733Z] "MaxConcurrentRequests": -1,
[2024-01-05T16:20:23.733Z] "MaxOutstandingRequests": -1,
[2024-01-05T16:20:23.734Z] "RoutePrefix": "api"
[2024-01-05T16:20:23.734Z] }
[2024-01-05T16:20:23.738Z] Host initialized (53ms)
[2024-01-05T16:20:23.741Z] Host started (63ms)
[2024-01-05T16:20:23.742Z] Job host started
[2024-01-05T16:20:28.556Z] Host lock lease acquired by instance ID '000000000000000000000000668AF8E7'.

```

Contributor guide

Open the contributing guide

Research direction

Reproduce the issue with the shown local.settings.json and follow the startup path indicated by the terminal output, focusing on how configuration files are parsed and validated. Done means a missing comma prevents normal startup with a clear terminal error, with a regression test covering this malformed Values object.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.