Azure-functions-host: Return helpful error if you set host.json to 3.0

Created on 28 Nov 2019  路  8Comments  路  Source: Azure/azure-functions-host

With functions version 3.0 a lot of folks are going to get confused and change the host.json version to 3.0 which will cause the app to fail. I don't think we need to break semver and alias to 3.0, but at the very least let's return a very clear and helpful error message so users can self mitigate before opening a ticket. Am thinking something like:

"invalid setting for host.json version of "3.0". We recommend you set this version to "2.0". This does not correspond to the function runtime version, only to the schema version of the host.json file."

3.x Supportability error-message-improvement

Most helpful comment

I can say that I've already made this mistake. X)

All 8 comments

I can say that I've already made this mistake. X)

yes me too

for some reason setting 2.0 in host.json for v3 doesnt seem to work online because of this error

The function runtime is unable to start. Microsoft.Azure.WebJobs.Script: FunctionTimeout must be greater than 00:00:01 and less than 00:10:00.

I had to change it to 3.0

+1 vote if that matters. I made the same mistake.

Recently had to change it to 3.0 (functions randomly stopped deploying with 2.0)

Recently had to change it to 3.0 (functions randomly stopped deploying with 2.0)

Actually, that turned out to be bullshit. The 2.0 or 3.0 values both work fine. It was just the fact that we changed the host.json file that made the deployment work again (once). Next day same problem for us (however that is an unrelated problem to this issue)

+1 the current error is confusing.

The host.json file is missing the required 'version' property.

Thank you for this. :)

Was this page helpful?
0 / 5 - 0 ratings