Azure / Azure/azure-functions-core-tools

NodeJS host.json file when invalid works locally but not when deployed

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

Description

Since the azure functions core tools is trying to emulate Azure Functions I consider this a bug or an enhancement.

I created a function that used bindings for table storage, read & write and used http triggers for this. My host.json file was invalid and everything worked locally when it should not work locally.

I spent hours debugging this by deleting code, hardcoding variables etc to finally find out my host.json was invalid. The azure Functions App wasn't helpful when debugging this because it kept only showing a HTTP 404.

I had this in the host.json file:
````json
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0]"
}
````

When it should have been this:
````json
"extensionBundle": {
"id": "Microsoft.Azure.Functions.ExtensionBundle",
"version": "[1.*, 2.0.0)"
}
````

I'm not sure how hard this would be to emulate correctly, but maybe a JSON Schema checker could do the trick.

Contributor guide

Open the contributing guide

Research direction

No source file or test is named. Start by reproducing the invalid host.json behavior with Azure Functions Core Tools and trace how host.json is loaded locally. Done means invalid configuration is rejected locally with a useful diagnostic consistent with deployment behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, nodejs
Domain
cli, developer-experience
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.