我正在从服务总线主题获取消息。
我想在这里参数化主题名称。
我试过了
"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/