Deploying Azure Email Communication Service with Bicep
To be able to use send Emails through the Azure Communication Service you need a few ressources that are best created using Infrastructure-as-Code – in this case with Bicep.
Here’s what we need:
Email Communication Service
Email Communication Services Domain – either provided by Azure which is good for testing purposes or a custom one for production
SenderUsername for the domain (e.g. noreply@mydomain.com)
Communication Service that is linked to the Domain
To support different environments we also want to use an Azure-managed domain e.g. for dev & test scenarios and a proper custom domain for production.
Note
Only a sucessfully verified Email Communication Service Domain can be linked to the Communication Service. So you might need to run the script, verify the domain when it first fails and then run the script again.
Code
Here’s the full code which can be called directly as a module by just passing the info if we’re in a production environment or not.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
One thought on “Deploying Azure Email Communication Service with Bicep”
Hey Thomas, It was quite a insightful article for me as I’m trying to deploy about 100 email communication service to my Azure account.
I’m from non technical background and trying to understand how to deploy around 100 communication services with 100 different domains. Your article is the closet thing I found on internet.
Can you please give me some idea on how to do this? Deploying 100 communication service and 100 domains into my account and how to verify these domains after all.
Hey Thomas, It was quite a insightful article for me as I’m trying to deploy about 100 email communication service to my Azure account.
I’m from non technical background and trying to understand how to deploy around 100 communication services with 100 different domains. Your article is the closet thing I found on internet.
Can you please give me some idea on how to do this? Deploying 100 communication service and 100 domains into my account and how to verify these domains after all.