azure-functions-core-tools icon indicating copy to clipboard operation
azure-functions-core-tools copied to clipboard

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

Open davidpetric opened this issue 2 years ago • 1 comments

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:

{
  "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:

[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'.

davidpetric avatar Jan 05 '24 16:01 davidpetric

This is a tooling issue - moving this to core-tools to see if there is a way to have a better error message.

satvu avatar Feb 21 '24 22:02 satvu