Thank you for posting your query on Microsoft Q&A.
To set up a connection from an Azure server to SendGrid, you will need to open the following ports in the Network Security Group (NSG) level:
- Port 587: This is the default port for SMTP (Simple Mail Transfer Protocol) communication.
- Port 25: This is an alternate port that can be used for SMTP communication if port 587 is blocked by a firewall.
You can add these ports in your NSG inbound security rules.
Please note that it's recommended to only allow incoming traffic from trusted sources to these ports and to monitor network traffic for any suspicious activity.
Please refer https://docs.advantys.com/workflowgen-for-azure/azure-sendgrid-smtp-configuration