2
votes

I'm using an ARM template to deploy to Azure. However the Azure Service Bus deployment section is proving difficult.

Can Anyone tell me how to configure the same settings as in the classic Portal, e.g.: duplicate Detection History Time Lock Duration Maximum Queue Size Maximum delivery count Default Message Time to Live

Alternatively is there a way to do it in Powershell and call that from the ARM script instead?

2

2 Answers

2
votes

In fact you can. Problem is ServiceBus ARM Template is not well documented (for the moment).

Full template available here.

Interesting part:

"properties": {
    "path": "[parameters('serviceBusQueueName')]",
    "maxSizeInMegabytes": "2048", 
    "defaultMessageTimeToLive": "7.00:00:00",
    "lockDuration": "00:01:00",
    "enableDuplicateDetection": "true",
    "duplicateDetectionHistoryTimeWindow": "00:15:00",
    "enablePartitioning": "true",
    "maxDeliveryCount": "5"        
}

Here defaultMessageTimeToLive, lockDuration and duplicateDetectionHistoryTimeWindow are Timespan.

My tip when you don't know the name of the property:

  • Find the MDSN documentation (C#) to create a queue or topic or subscription (ie: QueueDescription)
  • Look at the properties of the class and just put in the template the same property with camelCase.

Most of the time, it does the trick !

0
votes

Currently these properties cannot be set using the ARM templates directly. You need to configure these using ServiceBus Powershell scripts.
Here is the link to sample PS scripts
https://code.msdn.microsoft.com/Service-Bus-PowerShell-a46b7059/sourcecode?fileId=134510&pathId=2004509049