Set service bus topic max message size via Bicep script

Laurens van de Venn 220 Reputation points
2025-04-29T14:37:29.3166667+00:00

Hi,

Is it possible to set Service bus Topic max message size via Bicep to 10Mb?

Regards,

Laurens van de Venn

Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
690 questions
{count} votes

Accepted answer
  1. Khadeer Ali 5,155 Reputation points Microsoft External Staff Moderator
    2025-04-29T14:51:40.02+00:00

    @Laurens van de Venn ,

    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:

    https://learn.microsoft.com/en-us/azure/templates/microsoft.servicebus/namespaces/topics?pivots=deployment-language-bicep#resource-format

    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.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.