代码之家  ›  专栏  ›  技术社区  ›  Darth Veder

Azure函数部署失败,因为函数.json是错的

  •  1
  • Darth Veder  · 技术社区  · 7 年前

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

    正确的函数.json为了使该函数在azure中工作:

    {
          "bindings": [
    {
      "type": "queueTrigger",
      "connection": "AzureWebJobsStorage",
      "direction" : "in",
      "queueName": "queue",
      "name": "myQueueItem"
    }
    ],
      "disabled": false,
      "scriptFile": "../bin/x.dll",
      "entryPoint": "x"
    }
    

    是否有自动部署/visualstudio部署的解决方案可以自动执行此操作?目前我正在编辑所有的函数.json每次部署都要归档。任何解决方案或解决办法将不胜感激。

    1 回复  |  直到 7 年前
        1
  •  0
  •   Jerry Liu Phantom    7 年前

    同意@Thomas,已经测试了v1队列触发器模板 Microsoft.NET.Sdk.Functions-1.0.12 最新的 Microsoft.NET.Sdk.Functions-1.0.22 , function.json

    函数.json 两者都在Azure上工作,下面这两行用来说明 由VS生成,部署后不建议修改。

    "generatedBy": "Microsoft.NET.Sdk.Functions-1.0.22",
    "configurationSource": "attributes",
    

    第一个不行

    函数执行结果可能不会立即显示,您可以转到 https://functionappname.scm.azurewebsites.net/DebugConsole 并导航到 D:\home\LogFiles\Application\Functions\function\{FunctionName} 检查日志文件。

    您也可以访问 D:\home\LogFiles\Application\Functions\Host 检测详细的主机日志。

    would not work

    推荐文章