当我从 Visual Studio 部署 Azure 函数时,function.json 文件始终不正确。队列触发函数的 function.json 文件示例如下:
{
"generatedBy": "Microsoft.NET.Sdk.Functions-1.0.12",
"configurationSource": "attributes",
"bindings": [
{
"type": "queueTrigger",
"connection": "AzureWebJobsStorage",
"queueName": "queue",
"name": "myQueueItem"
}
],
"disabled": false,
"scriptFile": "../bin/x.dll",
"entryPoint": "x"
}
为了使函数在 azure 中工作,正确的 function.json 是:
{
"bindings": [
{
"type": "queueTrigger",
"connection": "AzureWebJobsStorage",
"direction" : "in",
"queueName": "queue",
"name": "myQueueItem"
}
],
"disabled": false,
"scriptFile": "../bin/x.dll",
"entryPoint": "x"
}
是否有任何自动部署/ Visual Studio 部署的解决方案可以自动执行此操作?目前,我在每次部署时都在编辑所有 function.json 文件。任何解决方案或解决方法将不胜感激。