If you are running Barracuda Email Security Gateway on Microsoft Azure, Microsoft imposes certain restrictions and limitations. At this time, Microsoft does not allow outbound mail on port 25 in an effort to stop spammers from creating a site and sending spam outbound through Azure.
Microsoft supports sending outbound mail from the Barracuda Email Security Gateway on Microsoft Azure to Microsoft 365 via port 587 if you want to use Microsoft 365 to relay email on behalf of the Barracuda Email Security Gateway in Azure.
See the Microsoft Support article Enhanced Azure Security for sending Emails for more information on restrictions and limitations.