gpt4 book ai didi

在 ARM 模板中定义时未应用 Azure 服务总线筛选器

转载 作者:行者123 更新时间:2023-12-03 03:03:36 25 4
gpt4 key购买 nike

我在下面定义了一个 ARM 模板片段,它创建服务总线主题、订阅和规则/过滤器。该规则与主题和订阅一起应用,但过滤器的值为 1=1。为什么该表达式不适用?

{
"apiVersion": "2017-04-01",
"name": "[concat(parameters('serviceBusNamespaceName'), '/TOPIC-NAME')]",
"type": "Microsoft.ServiceBus/namespaces/topics",
"location": "[variables('location')]",
"dependsOn": [
"[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'))]"
],
"properties": {
"path": "TOPIC-NAME",
"duplicateDetectionHistoryTimeWindow": "00:10:00",
"enableBatchedOperations": false,
"enablePartitioning": true,
"enableSubscriptionPartitioning": false,
"filteringMessagesBeforePublishing": false,
"maxSizeInMegabytes": 5120
},
"resources": [
{
"apiVersion": "2017-04-01",
"name": "SUB-NAME",
"type": "subscriptions",
"dependsOn": [
"[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'), '/topics/TOPIC-NAME')]"
],
"properties": {},
"resources": [
{
"apiVersion": "2017-04-01",
"name": "SUB-NAME",
"type": "Rules",
"dependsOn": [
"[concat('Microsoft.ServiceBus/namespaces/', parameters('serviceBusNamespaceName'), '/topics/TOPIC-NAME/subscriptions/SUB-NAME')]"
],
"properties": {
"filter": {
"sqlExpression": "MessageType = 'TYPE-OF-MESSAGE' AND MajorVersion = 1"
},
"action": {
"sqlExpression": "SET sys.Label='TYPE-OF-MESSAGE'"
}
}
}
]
}
]
}

最佳答案

您的订阅规则应定义如下:

"resources": [
{
"apiVersion": "2017-04-01",
"name": "SUB-NAME-FILTER",
"type": "Rules",
"dependsOn": [
"[parameters('serviceBusSubscriptionName')]"
],
"properties": {
"filterType": "SqlFilter",
"sqlFilter": {
"sqlExpression": "MessageType = 'TYPE-OF-MESSAGE' AND MajorVersion = 1"
"requiresPreprocessing": "false"
},
"action": {
"sqlExpression": "SET sys.Label='TYPE-OF-MESSAGE'"
}
}
}
]

关于在 ARM 模板中定义时未应用 Azure 服务总线筛选器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46693927/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com