Skip to content

Instantly share code, notes, and snippets.

@paulyuk
Last active July 7, 2022 00:17
Show Gist options
  • Save paulyuk/7ce5003e681df854815a731f118e4991 to your computer and use it in GitHub Desktop.
Save paulyuk/7ce5003e681df854815a731f118e4991 to your computer and use it in GitHub Desktop.
Service Bus Queue and Deadletter Bicep
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