• <legend id='3Je3t'><style id='3Je3t'><dir id='3Je3t'><q id='3Je3t'></q></dir></style></legend>
    <tfoot id='3Je3t'></tfoot>

  • <small id='3Je3t'></small><noframes id='3Je3t'>

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

      1. Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发

        Azure Functions: CosmosDBTrigger not triggering in Visual Studio(Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发)

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

        <small id='3HT15'></small><noframes id='3HT15'>

            <tbody id='3HT15'></tbody>

                • <bdo id='3HT15'></bdo><ul id='3HT15'></ul>

                • <legend id='3HT15'><style id='3HT15'><dir id='3HT15'><q id='3HT15'></q></dir></style></legend>

                  本文介绍了Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  TL;DR:这个例子 在 VS2017 中不适合我.

                  TL;DR: This example is not working for me in VS2017.

                  我有一个 Azure Cosmos DB,并希望在其中添加或更新某些内容时触发一些逻辑.为此,CosmosDBTrigger 应该很棒.

                  I have an Azure Cosmos DB and want to fire some logic when something adds or updates there. For that, CosmosDBTrigger should be great.

                  教程 演示在 Azure 门户中创建触发器,它适用于我.但是,在 Visual Studio(15.5.4,目前最新)中做同样的事情不会.

                  Tutorial demonstrates creating trigger in Azure Portal and it works for me. However, doing just the same thing in Visual Studio (15.5.4, latest by now) does not.

                  我使用默认 Azure Functions 模板、预定义 Cosmos DB 触发器和几乎默认 代码:

                  I use the default Azure Functions template, predefined Cosmos DB trigger and nearly default code:

                  [FunctionName("TestTrigger")]
                  public static void Run(    
                      [CosmosDBTrigger("Database", "Collection", ConnectionStringSetting = "myCosmosDB")]
                      IReadOnlyList<Document> input,
                      TraceWriter log)
                      {
                          log.Info("Documents modified " + input.Count);
                          log.Info("First document Id " + input[0].Id);
                      }
                  

                  应用程序运行没有错误但是当我实际在数据库中执行操作时没有任何反应.所以我无法调试东西并实际实现一些必需的逻辑.

                  App runs without errors but nothing happens when I actually do stuff in the database. So I cannot debug things and actually implement some required logic.

                  连接字符串local.settings.json中指定,被考虑.如果我故意犯规,触发吐出运行时错误.

                  Connection string is specified in the local.settings.json and is considered. If I deliberately foul it, trigger spits runtime errors.

                  看起来连接字符串指向了错误的数据库.但这正是我在通过 Azure 门户制作的触发器中拥有的一个复制粘贴字符串.

                  It all looks like the connection string is to a wrong database. But it is exactly the one, copypasted, string I have in the trigger made via Azure Portal.

                  我哪里出错了?我还能检查什么?

                  推荐答案

                  根据您的评论,您同时为同一个集合和同一个租约集合同时运行门户和本地应用程序.

                  Based on your comment, you were running both portal and local Apps at the same time for the same collection and the same lease collection.

                  这意味着两个应用程序在收集处理上相互竞争锁定(租约).门户应用程序在您的案例中获胜,获得了租约,因此本地应用程序无所事事.

                  That means both Apps were competing to each other for locks (leases) on collection processing. The portal App won in your case, took the lease, so the local App was sitting doing nothing.

                  这篇关于Azure Functions:CosmosDBTrigger 未在 Visual Studio 中触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 是否相等(按值,而不是按引用)?)

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

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

                      <tbody id='WgXN9'></tbody>
                    <legend id='WgXN9'><style id='WgXN9'><dir id='WgXN9'><q id='WgXN9'></q></dir></style></legend>

                        • <bdo id='WgXN9'></bdo><ul id='WgXN9'></ul>
                            <tfoot id='WgXN9'></tfoot>