Latest visual studio 2017 + functions tools -> 15.3.3 generates invalid function.json every time.
I am unable to deploy a single new function that I create through visual studio... Here is an example of the type of function.json that it is generating, any help looking into this would be super helpful as I have to manually edit these things to get them to work right now every time I deploy from visual studio.
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "queueTrigger",
"queueName": "new-user-queue",
"connection": "AzureWebJobsStorage",
"name": "myQueueItem"
}
],
"disabled": false,
"scriptFile": "..\\bin\\newuserqtoqfunc.dll",
"entryPoint": "newuserqtoqfunc.NewUserQueToQueService.Run"
}
Portal.Azure.com complains that
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
is not valid, by the way that is even after upgrading the sdk from nuget it still adds that lovely bit from above.
That is issue number one, then issue number two is
"bindings": [
{
"type": "queueTrigger",
"queueName": "new-user-queue",
"connection": "AzureWebJobsStorage",
"name": "myQueueItem"
}
The above does not include a direction which is also invalid... I literally cannot deploy from visual studio at all and I am not doing anything fancy you can try this yourselves with an inbound queue and an outbound queue project that does nothing but move a message between queues... the only way to do this and correct the function.json is deploy then go in and edit the function.json myself by hand in order to get them to work.
Thanks for looking into it.
Is the trigger working for you after the changes ?
https://github.com/Azure/Azure-Functions/issues/478
Hi thuru, yes absolutely after manually correcting the function.json it works great.
The problem is that the very latest version of visual studio + azure function tools seems to be broken in the way it generates that thus the deployment is broken because of that and I have to go in manually every-time and modify the function.json to make it valid.
@lbacaj That generated function.json looks correct. What error does the portal give?
Also, you should upgrade Microsoft.NET.Sdk.Functions to the latest, which is 1.0.2
@lindydonna do you see the issue https://github.com/Azure/Azure-Functions/issues/478 has similarity, I still couldn't run the trigger, but the difference here is I'm using Service Bus Trigger
Hi All, I have the same problem with the Time Trigger doesn't start, and no errors in the Log. Here's the function.json that I manually change since the generated from VS2017 missing "direction" and the SDK version.
{ "bindings": [ { "type": "timerTrigger", "schedule": "0 */1 * * * *", "useMonitor": true, "runOnStartup": false, "name": "myTimer", "direction": "in" }, { "type": "documentDB", "name": "documents", "databaseName": "RudiDB", "collectionName": "RudiCollection", "partitionKey": "dateReceived", "sqlQuery": "SELECT * FROM c WHERE c.history = null or c.history.wq = null or c.history.wq = 0", "connection": "upsrudidev_DOCUMENTDB", "direction": "in" } ], "generatedBy": "Microsoft.NET.Sdk.Functions-1.0.2.0", "configurationSource": "attributes", "disabled": false, "scriptFile": "..\bin\FunctionApps.dll", "entryPoint": "FunctionApps.MoveDocuments.Run" }
and in the log, just says:
2017-09-07T16:27:27 Welcome, you are now connected to log-streaming service. 2017-09-07T16:28:27 No new trace in the past 1 min(s). 2017-09-07T16:29:27 No new trace in the past 2 min(s).
Hi @lindydonna thanks for the reply here
That function Json is not correct. The below is correct, I have to modify it by hand to make it correct, the difference here is highlighted in bold
"bindings": [ { "type": "queueTrigger", "queueName": "new-user-queue", "connection": "AzureWebJobsStorage", "direction": "in", "name": "myQueueItem" } ], "disabled": false, "scriptFile": "..\bin\newuserqtoqfunc.dll", "entryPoint": "newuserqtoqfunc.NewUserQueToQueService.Run" }
Then again what visual studio is generating is missing direction which Portal.Azure.com will complain about and will not run.
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
"bindings": [
{
"type": "queueTrigger",
"queueName": "new-user-queue",
"connection": "AzureWebJobsStorage",
"name": "myQueueItem"
}
],
"disabled": false,
"scriptFile": "..\\bin\\newuserqtoqfunc.dll",
"entryPoint": "newuserqtoqfunc.NewUserQueToQueService.Run"
The other problem with the above which is what visual studio is generating every time is the following two decorators which Portal.azure.com also complains about
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.0.0",
"configurationSource": "attributes",
To be clear I have updated Nuget, visual studio, and the function tools to the very latest....
If it helps try going to "integrate" in the portal after deploying such function that is missing direction and includes those generatedBy and configurationSource

Then try to click

It will never work, you will never be able to get the standard editor to show up because that function.json being generated by visual studio and the tools is not valid....
Direction is required and generatedBy and configurationSource are not valid in the portal, they are even highlighted to let you know its not valid...
it tells you so just by highlighting it, it does not matter what version of nuget you use...

And to be clear removing all of that and adding direction will fix it, but that means you have to do this after every single deployment...
@lbacaj : the issue is here in more detail https://github.com/Azure/Azure-Functions/issues/478
@thuru thank you for that... I doubt that there is more detail 😄 but it does appear to be the same issue..
meaning that this is definitely a real issue
I am getting the same issue for blob trigger function, but manually editing the function.json to include direction does work as a work around, but is a little annoying. +1 on fixing this 👍
@ahmelsayed Could you please see if you can repro this?
This has been resolved by a VS update. Please make sure you are on the most up to date version of VS and the Azure functions extension.