小编Dan*_*i T的帖子

Azure函数版本2.0-应用程序BlobTrigger无法正常工作

我有一个运行中的功能应用程序,它具有Blob输入和事件中心输出(在beta中工作)。随着最新的更改,我的功能不再起作用。我已经尝试根据发行说明更新host.json文件,但它没有引用blob触发器:

{


"version": "2.0",
  "extensions": {
      "blobTriggers" : {
        "name": "blob",
        "type": "blobTrigger",
        "direction": "in",
        "path": "iot3gblobs/{name}",
        "connection": "AzureWebJobsStorage"
      },

      "eventHubs": {
        "type": "eventHub",
        "name": "outputEventHubMessages",
        "path": "ioteventhub",
        "connection": "IoTEventHubConnection",
        "cardinality": "many",
        "direction": "out"
      }
    },
    "Host" : 
    {
      "LocalHttpPort": 7071,
      "CORS": "*"
    },
  "disabled": false
}
Run Code Online (Sandbox Code Playgroud)

另外,将Microsoft.NET.Sdk.Functions从1.0.14升级到1.0.19时,无法识别blobTrigger属性,并且我的代码无法编译:

[FunctionName("iotserverparser")]
        public async static Task Run(
            [BlobTrigger("iot3gblobs/{name}", Connection = "AzureWebJobsStorage")]
            Stream blob,
            [EventHub(
                "outputEventHubMessages", Connection =
                    "IoTEventHubConnection")]
Run Code Online (Sandbox Code Playgroud)

如前所述,这是由于上一次Azure Function App更新导致的,我还没有看到任何有关如何在此新2.0版本中使用Blob触发器的示例。

c# azure azure-storage-blobs azure-functions

5
推荐指数
1
解决办法
1279
查看次数

标签 统计

azure ×1

azure-functions ×1

azure-storage-blobs ×1

c# ×1