• <small id='63RxR'></small><noframes id='63RxR'>

      <bdo id='63RxR'></bdo><ul id='63RxR'></ul>

    <tfoot id='63RxR'></tfoot>
        <legend id='63RxR'><style id='63RxR'><dir id='63RxR'><q id='63RxR'></q></dir></style></legend>
        <i id='63RxR'><tr id='63RxR'><dt id='63RxR'><q id='63RxR'><span id='63RxR'><b id='63RxR'><form id='63RxR'><ins id='63RxR'></ins><ul id='63RxR'></ul><sub id='63RxR'></sub></form><legend id='63RxR'></legend><bdo id='63RxR'><pre id='63RxR'><center id='63RxR'></center></pre></bdo></b><th id='63RxR'></th></span></q></dt></tr></i><div id='63RxR'><tfoot id='63RxR'></tfoot><dl id='63RxR'><fieldset id='63RxR'></fieldset></dl></div>
      1. Azure 函数 2.0 版 - 应用 blobTrigger 无法正常工作

        Azure function version 2.0 - app blobTrigger not working(Azure 函数 2.0 版 - 应用 blobTrigger 无法正常工作)

      2. <small id='rP64N'></small><noframes id='rP64N'>

          <bdo id='rP64N'></bdo><ul id='rP64N'></ul>

        • <tfoot id='rP64N'></tfoot>
              <i id='rP64N'><tr id='rP64N'><dt id='rP64N'><q id='rP64N'><span id='rP64N'><b id='rP64N'><form id='rP64N'><ins id='rP64N'></ins><ul id='rP64N'></ul><sub id='rP64N'></sub></form><legend id='rP64N'></legend><bdo id='rP64N'><pre id='rP64N'><center id='rP64N'></center></pre></bdo></b><th id='rP64N'></th></span></q></dt></tr></i><div id='rP64N'><tfoot id='rP64N'></tfoot><dl id='rP64N'><fieldset id='rP64N'></fieldset></dl></div>

                  <tbody id='rP64N'></tbody>

                  <legend id='rP64N'><style id='rP64N'><dir id='rP64N'><q id='rP64N'></q></dir></style></legend>
                  本文介绍了Azure 函数 2.0 版 - 应用 blobTrigger 无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个正常工作的函数应用程序,它有一个 blob 输入和一个事件中心输出(在测试版中工作).随着最新的变化,我的功能不再起作用.我已尝试根据发行说明更新 host.json 文件,但它没有引用 blob 触发器:

                  <代码>{版本":2.0",扩展":{blobTriggers":{名称":斑点",类型":blobTrigger",方向":在",路径":iot3gblob/{name}",连接":AzureWebJobsStorage"},事件中心":{类型":事件中心","name": "outputEventHubMessages",路径":ioteventhub","connection": "IoTEventHubConnection",基数":许多",方向":出去"}},主持人" :{LocalHttpPort":7071,CORS":*"},禁用":假}

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

                  [FunctionName("iotserverparser")]公共异步静态任务运行([BlobTrigger("iot3gblob/{name}", Connection = "AzureWebJobsStorage")]流 blob,[事件中心(outputEventHubMessages",连接 ="IoTEventHubConnection")]

                  如前所述,这是因为上次 Azure Function App 更新,我还没有看到任何关于如何在这个新的 2.0 版本中使用 Blob Trigger 的示例.

                  解决方案

                  要将 Azure Function 与 Blob 文件更新连接,请执行以下步骤.

                  1. 单击功能"菜单中的+"图标.

                  2. 然后选择Azure Blob Storage trigger":

                  3. 弹出/侧边栏打开后,您需要填写您的 blob 相关信息.
                    这很简单,但首先,单击新建"链接,它会弹出另一个视图,您可以在其中看到您的存储帐户列表.

                  4. 确保从列表中选择您希望收到通知的确切存储帐户.

                  5. 在存储帐户连接"输入框下会看到存储名称(您可能还会看到存储名称末尾附加了一些附加标签,例如..._STORAGE",没关系).

                  6. 除了帐户连接,您还需要提供容器名称,您可以在您的存储帐户Blob"部分找到该名称.

                  7. 现在创建 blob 触发器之前的最终外观应该是:

                  <块引用>

                  这里确保您不要触摸 Path 输入下的 {name} 部分.需要该变量来反映更改的文件/blob 名称.

                  1. 最后,点击创建"按钮,然后尝试上传 Blob 容器中的任何文件.您应该会看到代表更改的日志.

                  <小时>

                  此外,就是这样,不需要额外的引用 (#r) 或 usings 来查看 blob 更改.

                  <块引用>

                  请注意,在日志"部分下,blob 更改可能会有所延迟.但是,如果一段时间后您仍然看不到任何更新,请再次检查您是否提供了正确的存储帐户和容器名称.为此,您可能需要再次创建 blob 触发器.

                  I had a working Function App that got a blob input and an event hub output (worked in beta). With latest changes, my function no longer works. I've tried to update the host.json file according to the release note, but it has not reference to blob trigger:

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

                  Also, when upgrading Microsoft.NET.Sdk.Functions from 1.0.14 to 1.0.19 the blobTrigger attribute is not recognized and my code will not compile:

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

                  As mentioned before, this is because of the last Azure Function App update and I have not seen any example of how to work with Blob Trigger in this new 2.0 version.

                  解决方案

                  To connect Azure Function with Blob file updates, do the following steps.

                  1. Click on the '+' icon from the Functions menu.

                  2. Then choose "Azure Blob Storage trigger":

                  3. After a popup/sidebar will open, and you need to fill your blob related information.
                    That is quite easy, but first, click on the "new" link and it will popup another view where you can see the list of your storage accounts.

                  4. From the list, make sure to choose the exact storage account for which you want to be notified.

                  5. After you shall see the storage name appearing under the "Storage account connection" input box (you may also see some additional label appended at the end of storage name, like "..._STORAGE", that's ok).

                  6. Besides the account connection, you also need to provide the container name, which you can find if you check your storage account "Blobs" section.

                  7. Now the final look before creating the blob trigger should be:

                  Here make sure you don't touch the {name} part under the Path input. That variable is needed to reflect the changed file/blob name.

                  1. Finally, click on the "Create" button and after try to upload any file in your blob container. You should see the logs representing the changes.


                  Moreover, this is it, no additional references (#r) or usings are necessary to see the blob changes.

                  Note that blob changes might reflect with a bit delay under the Logs section. However, if after some time you still don't see any updates there then check once more that you have provided correct Storage Account and container names. To do that you might need to create the blob trigger again.

                  这篇关于Azure 函数 2.0 版 - 应用 blobTrigger 无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Adding and removing users from Active Directory groups in .NET(在 .NET 中的 Active Directory 组中添加和删除用户)
                  set equality in linq(在 linq 中设置相等)
                  HashSet conversion to List(HashSet 转换为 List)
                  How to set timeout for webBrowser navigate event(如何为 webBrowser 导航事件设置超时)
                  Test whether two IEnumerablelt;Tgt; have the same values with the same frequencies(测试两个IEnumerablelt;Tgt;具有相同频率的相同值)
                  How do you determine if two HashSets are equal (by value, not by reference)?(您如何确定两个 HashSet 是否相等(按值,而不是按引用)?)
                    <tbody id='jOsSQ'></tbody>
                    <bdo id='jOsSQ'></bdo><ul id='jOsSQ'></ul>
                    <i id='jOsSQ'><tr id='jOsSQ'><dt id='jOsSQ'><q id='jOsSQ'><span id='jOsSQ'><b id='jOsSQ'><form id='jOsSQ'><ins id='jOsSQ'></ins><ul id='jOsSQ'></ul><sub id='jOsSQ'></sub></form><legend id='jOsSQ'></legend><bdo id='jOsSQ'><pre id='jOsSQ'><center id='jOsSQ'></center></pre></bdo></b><th id='jOsSQ'></th></span></q></dt></tr></i><div id='jOsSQ'><tfoot id='jOsSQ'></tfoot><dl id='jOsSQ'><fieldset id='jOsSQ'></fieldset></dl></div>

                        <legend id='jOsSQ'><style id='jOsSQ'><dir id='jOsSQ'><q id='jOsSQ'></q></dir></style></legend>

                        <small id='jOsSQ'></small><noframes id='jOsSQ'>

                        • <tfoot id='jOsSQ'></tfoot>