Replacing SendGrid Free Tier with Azure Communication Services for Emails via SMTP

I have used SendGrid for many years now and have been impressed with the features available. It integrates well into Azure and provided a reliable way to send emails either in small volumes on their free tier, or at scale with a paid plan.
In May 2025 SendGrid announced that they would be discontinuing their current free tier, replacing it with a limited 60 day free trial. I have a few apps that just needed to send a handful of occasional emails, so I was not really looking to pay $19.95/mo in these cases.
Azure Communication Services (ACS) seemed like a good alternative as this service provides a pay-as-you-go pricing model, which is more suitable for my needs. Like SendGrid, ACS offers the ability to send emails both via an SDK and also SMTP, making it easier to integrate into my existing applications. In this short post I will cover the setup process of using Azure Communication Services for use with SMTP.
Email Communication Service
Although we will be using Azure Communication Services (ACS), we need to first set up a Email Communication Service
. It’s a simple service to set up in Azure, you only need a resource group and to decide where you want the data to be stored.
Once it has been created we need to select Provision Domain
inside the Email Communication Service resource. From here you have two options, under the Add Domain
menu; either a Custom Domain
or an Azure Domain
.
For custom domains, your domain does not have to be managed in Azure, but you will need to verify ownership by adding a TXT record to your DNS settings. With this approach, you will also want to configure SPF, DKIM and DKIM2 DNS entries to prevent the messages being marked as spam.
If you do not have a custom domain or don’t want to use it you must select to use an Azure Domain
from under the Add Domain
option so at least one domain is configured to send the emails from.
Either process is pretty quick to configure but can take some time to validate.
Azure Communication Services
Next create a new Azure Communication Services
resource in the Azure portal.
Once provisioned, navigate to the resource and select Email
-> Domains
. Select the option configure Domain
which will then allow you to select the domain you have just configured in the Email Communication Service. Note that only verified domains will be available to select, so you may need to wait a few minutes for the domain to be available.
Once the domain is selected, you will be able to go to Email
-> Try Email
and test sending the configured domain. This screen also has sample code for sending emails programmatically using the SDK, which is the recommended and easiest way to send messages.
Configuring SMTP
Although the SDK is the recommended approach, many applications rely on SMTP for sending emails, and Azure Communication Services supports this protocol.
SMTP settings rely on a pre-configured Microsoft Entra Application to provide a secret that will later become the SMTP password. The official guide is here with full screen shots however I have outlined the steps below as I found a few things not immediately obvious:
App Registration and Password
The first step requires an Azure App registration. Navigate to Microsoft Entra ID
section in the Azure portal and select Add
followed by App Registration
. From here you can create a new application providing a name.
From inside the App Registration page we need to add a Client Secret. From the navigation pane select Certificates & Secrets
. Click on New Client Secret
, provide a description and set an expiration period. Once created, make a note of the secret value as this will be used as the SMTP password.
Note that this secret will not be shown again, so make sure to store it securely. It will also expire so you must remember to renew it in the future.
Permissions
Before the next step, we need to configure the necessary permissions to allow the new App registration to use the Azure Communication Services we created.
From the Azure Communication Services resource, assign the Communication and Email Service Owner
RBAC role to your App registration. If you do not do this then the App registration is not available to select in the next step.
SMTP Username
To complete the SMTP setup we need a username. From inside the Azure Communication Services resource, navigate to Email
-> SMTP Usernames
. Here you will find the option to add a user name, using custom text or an email. As part of this you will need to select the Entra application you created earlier.
Note this is the SMTP username that you will use to authenticate when sending emails via SMTP, not the sender email address.
Sending Email
You can send emails using the SMTP however it you need to use Port 587 (SSL) and set the smtp server host to smtp.azurecomm.net.
.
Initially you will only be able to send from a DoNotReply@ address. To unlock other sending addresses you will need a custom domain and have higher than default sending limits enabled. These are outlined in this support article.
Limitations
Finally it is worth noting about costs and rate limits.
Email sending is charged on both a per message and a per mb of data transfer basis. These are charged at a fraction of a dollar per message. You can see the pricing details on the Azure Communication Services pricing page under the messaging tab.
The email sending limits are dependant if you are using a custom domain or Azure Domain. They are based per subscription and can be increased if needed via a support ticket. There are also limits on the number of recipients and attachments sizes. To review the full limits see the official Service limits for Azure Communication Services for email page.
Conclusion
Replacing SendGrid’s free tier with Azure Communication Services for SMTP email sending is a cost effective option for those looking for a pay-as-you-go model. I was able to quickly set up ACS and integrate it into my application, allowing me to continue sending emails without any disruption.
Title Photo by Markus Winkler from Pixabay