Azure 为连接到 CosmosDB 的标准逻辑应用生成 URL [英] Azure generate URL for a standard Logic app with connection to CosmosDB

查看:18
本文介绍了Azure 为连接到 CosmosDB 的标准逻辑应用生成 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在标准逻辑应用中有一个工作流,它有 HTTP 触发器.当工作流被触发时,工作流从 CosmosDB 中检索一些数据.类似的东西:

I have a workflow in a standard logic app, that have HTTP trigger. When the workflow is trigged, the workflow, retrieve some data from a CosmosDB. Something like:

之前的方法需要有一个 API 连接.我已经创建并部署了一个V2"API 连接.我们称之为 myCosmosCon

The previous method will require to have an API connection. I have already created and deployed a 'V2' API connection. Let's call it myCosmosCon

也在我的逻辑应用程序的 ARM 模板中,我已经将连接 API(到 myCosmosCon)的 connectionRuntimeUrl 添加到 appSettings(配置):

Also in the ARM template for my logic app I have already added a connectionRuntimeUrl of my connection API (to myCosmosCon) to appSettings (configuration):

....
"siteConfig": {
      "appSettings": [
       {
          "name": "subscriptionId",
          "value": "[subscription().subscriptionId]"
       },
       {
          "name": "resourceGroup_name",
          "value": "[resourceGroup().name]"
       },
       {
            "name": "location_name",
            "value": "[resourceGroup().location]"
       },
       {
            "name": "connectionRuntimeUrl",
            "value": "[reference(resourceId('Microsoft.Web/connections', parameters('connection_name')),'2016-06-01', 'full').properties.connectionRuntimeUrl]"
      },
      .....               
      ]
    }, 

然后我在connections.json中写了以下内容:

Then I wrote the following in the connections.json:

{
"managedApiConnections": {
  "documentdb": {
    "api": {
      "id": "/subscriptions/@appsetting('subscriptionId')/providers/Microsoft.Web/locations/@appsetting('location_name')/managedApis/documentdb"
    },
    "connection": {
      "id": "/subscriptions/@appsetting('subscriptionId')/resourceGroups/@appsetting('resourceGroup_name')/providers/Microsoft.Web/connections/myCosmosCon"
    },
    "connectionRuntimeUrl": "@appsetting('connection_runtimeUrl')",
    "authentication": {
        "type": "ManagedServiceIdentity"
    }
  }
}

}

现在,当我部署我的 Logic 应用程序、工作流等的 ARM 模板时,我没有看到任何错误,工作流看起来也不错.唯一的问题是没有生成HTTP触发器的URL链接,我无法运行程序.

Now, when I deploy the ARM template of my Logic app, workflow, ... etc. I see no errors, the workflow looks also good. The only problem is the URL link to the HTTP trigger is not generated, I can't run the program.

但是,如果我将 connection.json 文件中的 connection_runtimeUrl 更改为具有实际值;看起来像:

However, if I change the connection_runtimeUrl in the connections.json file to have the actual value; to look something like:

      "connectionRuntimeUrl": "https://xxxxxxxxxxxxx.xx.common.logic-norwayeast.azure-apihub.net/apim/myCosmosCon/xxxxxxxxxxxxxxxxxxxxxxxx/",

URL 是直接生成的,我可以简单地运行工作流.在那之后,如果我按原样返回connection_runtimeUrl(调用appsettings()),它仍然有效!!链接也留在那里.

The URL is generated directly and I can simply run the workflow. AFTER that, if I return the connection_runtimeUrl as it was (a call to appsettings()), it still working!! the link also stay there.

貌似我在部署Logic应用和工作流的时候,connections.json没有编译,也没有调用,所以Azure认为有错误,没有生成链接.

It looks like the when I deploy the Logic app and the workflow that the connections.json, do not compile or make the call, so Azure think that there is an error and do not generate the link.

知道如何解决问题吗??

Any idea about how to solve the problem??

谢谢!

推荐答案

我遇到了完全相同的问题/错误.我认为唯一的解决方法是部署工作流两次.第一次使用指向虚拟连接的实际 URL,第二次使用 appsetting 引用.

I'm having trouble with the exact same issue/bug. The only work around as I see it is to deploy the workflow twice. First time with an actual URL pointing to a dummy connection and the second time with the appsetting reference.

这篇关于Azure 为连接到 CosmosDB 的标准逻辑应用生成 URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆