azure - 如何将参数传递给逻辑应用中的服务总线主题名称?

标签 azure azure-logic-apps

我正在从服务总线主题获取消息。
我想在这里参数化主题名称。
我试过了

"path": /@{encodeURIComponent(encodeURIComponent('[parameters('topicname')]'))}/messages",

concat() 我也尝试过,但没有任何效果。

有人可以帮我解决这个问题吗?

最佳答案

如果您不想处理 concat(),您应该看看这篇文章:

您可以指定与 ARM 模板参数不同的逻辑应用参数
总而言之,您创建一个 ARM 参数、一个逻辑应用参数,然后将 ARM 参数映射到逻辑应用参数。它有点复杂,但您可以避免使用 concat 函数。

因此 ARM 模板应如下所示:

{
  "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
  "contentVersion": "1.0.0.0",
  "parameters": {
    "topicname": {
      "type": "string",
      "metadata": {
        "description": "The name of the topic."
      }
    }
    ...   
  },
  "variables": {
  ...
  },
  "resources": [
    {
      "type": "Microsoft.Logic/workflows",
      "properties": {
        "definition": {
                ... 
                "path": "/@{encodeURIComponent(encodeURIComponent(parameters('topicname')))}/messages",
                ... 
          },
          "contentVersion": "1.0.0.0",
          "outputs": {},
          "parameters": {
            "$connections": {
              "defaultValue": {},
              "type": "Object"
            },
            "topicname": {
              "type": "String"
            }            
          }
        },
        "parameters": {
          "$connections": {
          ...
          },
          "topicname": {
            "value": "[parameters('topicname')]"
          },

        }
      },
      "dependsOn": [

      ]
    }    
  ]
}

关于azure - 如何将参数传递给逻辑应用中的服务总线主题名称?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52331173/

相关文章:

powershell - Azure 订阅 Cmdlet

Azure 模拟器中带有 Ssl 证书的 WCF 服务

azure - 是否可以及时将文件和文件夹从 FTP 发送到 Azure Blob 存储?

azure - 如何在Azure逻辑应用程序中触发基于事件的Blob存储触发器?

c# - 本地网络应用程序接受带逗号的数字,而发布的不接受

azure - 无法在 Azure Functions 中创建文件

python - Azure 上的 python 函数应用程序中的全局变量

Azure 逻辑应用架构验证启用/禁用选项

添加 API 应用程序时出现 Azure 逻辑应用程序错误

c# - 对逻辑应用程序中的 Azure Function 故障使用react