Last active
July 7, 2022 00:17
-
-
Save paulyuk/7ce5003e681df854815a731f118e4991 to your computer and use it in GitHub Desktop.
Service Bus Queue and Deadletter Bicep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param resourceToken string | |
param location string | |
param skuName string = 'Basic' | |
param queueNames array = [ | |
'orders' | |
] | |
var deadLetterFirehoseQueueName = 'deadletterfirehose' | |
resource serviceBusNamespace 'Microsoft.ServiceBus/namespaces@2018-01-01-preview' = { | |
name: 'sb-${resourceToken}' | |
location: location | |
sku: { | |
name: skuName | |
} | |
} | |
resource deadLetterFirehoseQueue 'Microsoft.ServiceBus/namespaces/queues@2018-01-01-preview' = { | |
name: deadLetterFirehoseQueueName | |
parent: serviceBusNamespace | |
properties: { | |
requiresDuplicateDetection: false | |
requiresSession: false | |
enablePartitioning: false | |
} | |
} | |
resource queues 'Microsoft.ServiceBus/namespaces/queues@2018-01-01-preview' = [for queueName in queueNames: { | |
parent: serviceBusNamespace | |
name: queueName | |
dependsOn: [ | |
deadLetterFirehoseQueue | |
] | |
properties: { | |
forwardDeadLetteredMessagesTo: deadLetterFirehoseQueueName | |
} | |
}] | |
output SERVICEBUS_ENDPOINT string = serviceBusNamespace.properties.serviceBusEndpoint |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment