Thank you for your inquiry regarding setting the maximum message size for Azure Service Bus topics via Bicep templates. I’d like to clarify the situation and provide more detailed information on this feature.
Configuring Message Size in Azure Service Bus
While Azure Service Bus does not allow you to directly configure message size limits for the Standard tier, it is possible to configure the maximum message size for Service Bus topics in the Premium tier using the maxMessageSizeInKilobytes
property in Bicep.
This configuration applies specifically to Premium tier namespaces, and the setting is supported when using the AMQP protocol, which allows larger message sizes.
Example Bicep Template for Premium Tier
Here is an example of how you can configure the message size for a Service Bus topic in the Premium tier:
In this example:
- The
maxMessageSizeInKilobytes
property is set to 1024 KB (1 MB) for the topic.
The namespace is configured with the Premium SKU, which supports larger message sizes.
Key Points to Consider
Premium tier only: The ability to set the message size is available only in the Premium SKU.
AMQP protocol: This configuration works when using the AMQP protocol. For HTTP/SBMP protocol, the message size limit is fixed to 1 MB.
Standard tier: If you're using the Standard tier, the maximum message size is restricted to 256 KB and cannot be configured.
Conclusion
Yes, you can configure the maximum message size for a Service Bus topic in the Premium tier using the maxMessageSizeInKilobytes
property within your Bicep template. This allows you to set the message size limit up to 100 MB (for AMQP) depending on your needs.
Hope this helps. Do let us know if you have any further queries.
If this answers your query, do click Accept Answer and Yes for "Was this answer helpful." And if you have any further questions, let us know.