如何使用二头肌创建多个主题的规则来创建多个订阅?
我的目标是创建具有多个订阅的多个主题,并且每个订阅都有其自己的规则(在这种情况下为SQLFILTER)。 以下解决方案不起作用,使以下例外: *内部错误-System.NotimplementEdexception:在数组访问索引表达式重写期间,索引表达式计数与无法访问的符号之间的不匹配。 我是使用命名空间规则完全错误还是缺少什么? NotimplementedException确实使我感到困惑。 我正在使用二头肌版本0.6.1。我还没有测试过旧版本的二头肌,但肯定会这样做。
param topics array = [
'customerevents'
'ekonomievents'
'orderevents'
]
var customerSubs = json(loadTextContent('./objects/customerSubscriptions.json'))
param parentResource string
resource servicebusNamespace 'Microsoft.ServiceBus/namespaces@2021-11-01' existing = {
name: parentResource
}
resource topicResource 'Microsoft.ServiceBus/namespaces/topics@2021-11-01' = [for topic in topics : {
name: topic
parent: servicebusNamespace
}]
resource subscriptionCustomer 'Microsoft.ServiceBus/namespaces/topics/subscriptions@2021-11-01' = [for (subscription, i) in customerSubs : {
name: subscription.name
dependsOn: topicResource
parent: topicResource[0]
}]
resource subscriptionCustomerRules 'Microsoft.ServiceBus/namespaces/topics/subscriptions/rules@2021-11-01' = [for (subscription, i) in customerSubs : {
name: uniqueString(subscription.name)
parent: subscriptionCustomer[i]
properties:{
filterType:'SqlFilter'
sqlFilter: {
sqlExpression: '1=1'
requiresPreprocessing: false
}
}
}]
My goal here is to create multiple topics with multiple subscriptions and every subscription has its own rule(an sqlfilter in this case).
The below solution which doesn't work renders this exception:
*Internal Error - System.NotImplementedException: Mismatch between count of index expressions and inaccessible symbols during array access index expression rewriting.
Am I using the namespace rule totally wrong or what am I missing? The NotImplementedException really makes it all confusing to me.
I'm using Bicep version 0.6.1. I have not tested an older version of bicep yet but will definitely do so.
param topics array = [
'customerevents'
'ekonomievents'
'orderevents'
]
var customerSubs = json(loadTextContent('./objects/customerSubscriptions.json'))
param parentResource string
resource servicebusNamespace 'Microsoft.ServiceBus/namespaces@2021-11-01' existing = {
name: parentResource
}
resource topicResource 'Microsoft.ServiceBus/namespaces/topics@2021-11-01' = [for topic in topics : {
name: topic
parent: servicebusNamespace
}]
resource subscriptionCustomer 'Microsoft.ServiceBus/namespaces/topics/subscriptions@2021-11-01' = [for (subscription, i) in customerSubs : {
name: subscription.name
dependsOn: topicResource
parent: topicResource[0]
}]
resource subscriptionCustomerRules 'Microsoft.ServiceBus/namespaces/topics/subscriptions/rules@2021-11-01' = [for (subscription, i) in customerSubs : {
name: uniqueString(subscription.name)
parent: subscriptionCustomer[i]
properties:{
filterType:'SqlFilter'
sqlFilter: {
sqlExpression: '1=1'
requiresPreprocessing: false
}
}
}]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论