Send, receive, and process emails within the Azure cloud
Overview
This article is the hands-on step-by-step tutorial for a developer or administrator to send and receive emails using various programming languages within various cloud services).
Why
Because emails are unique to individuals, they are often used as user names to log into websites.
To test services that send and receive emails in production.
Cloud email services
AWS has an email service called Simple Email Service (SES).
Azure administrators can consider integrating with these email services to work with Azure:
- Azure’s Azure Communication Service (new for
- Azure’s own SendGrid service.
- Twilio’s SendGrid service.
- Gmail?
- Microsoft 365 service for Outlook?
Azure Communication Service (ACS)
This service offered by Microsoft was in preview as of 2021-11-25.
-
At the marketing page, says “Build multichannel communication experiences for video, voice, chat, and SMS on any device, with GitHub and Visual Studio tools”.
https://azure.microsoft.com/en-us/products/communication-services
https://learn.microsoft.com/en-us/azure/communication-services/overview
-
At the pricing page, select a region. Notice that the first 5,000 emails are free.
https://azure.microsoft.com/en-us/pricing/details/communication-services/
Notice the components to pricing:
- $250 per million emails sent (1,000,000 emails * $0.00025)
- $24 per MB of data sent (1,000,000 emails * 0.2 MB * $0.00012)
Send an email using Try in the GUI, as described by this Quickstart for Azure CLI, C#, JavaScript, Java, Python, PowerPlatform
https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/email/create-email-communication-resource
- Click “+ Create”.
-
Search for Azure service “Email” and select “Email Communication Services”
https://portal.azure.com/#view/HubsExtension/BrowseResource/resourceType/Microsoft.Communication%2FEmailServices
- Click “+ Create” for Basics page.
- Select a Subscription.
-
For Resource group, click “Create new”, then type a name with no spaces.
PROTIP: If different people/departments administer resources in your company, construct a name that include a way to differentiate them, such as “test” or “prod”, and date created:
ACS-west-us-test-231125a
PROTIP: Although the service operates globally across Azure regions, Region is needed in the name for “Resource group location”.
Include Country code such as “US” in the name due to data sovereignty laws.
PROTIP: Include the date created in the name so you can sort by name to see the most recent, for Tag cleanup during Azure Spring Clean (in March), etc.
- For “Resource group location”, select the Region you typed in the name.
-
For Instance Details Name, type the same name as the Resource created above.
REMEMBER: Azure resource names cannot be changed after creation.
PROTIP: Add a hidden-title Tag for (undocumented/hidden) “friendly name” which can be changed after creation, to make it easier to find in the Azure Portal. visible in JSON views.
-
Click “Next” to specify Tags associated for cost and activity tracking by Project, Country, etc.
PROTIP: Add a “CreatedBy” Tag with your name so you can be EASILY contacted if there’s a problem.
- Click “Review + create”, “Create” for the Deployment page.
-
Click “Operation details” for the Resource just created.
Notice the default Duration is “1 minute 5 seconds”.
-
Click the Resource Name for its “Email Communication Service” page.
https://learn.microsoft.com/en-us/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp
Notice the “Overview” page has a “Try it” button.
SendGrid via Twilio
Based on these references:
- SendGrid service.
- https://docs.sendgrid.com/for-developers/partners/microsoft-azure-2021
- https://docs.sendgrid.com/for-developers/partners/microsoft-azure
-
Login within an Admin email to the Azure portal at https://portal.azure.com
If you wish to have a separate email billing from Twilio:
-
Navigate to Azure Subscriptions if you wish to have a separate billing.
https://portal.azure.com/#view/Microsoft_Azure_Billing/SubscriptionsBladeV1
-
Click “Add” for a new separate Azure Subscription. Click “All other offers”.
- Click “Select offer” under “Pay-A-You-Go”.
- Authenticate with your Password.
- At the Agreement page, Click “Next”.
- Verify Payment Information
- PROTIP: I recommend you select “No technical support”. Click “Sign up”.
- Wait for “Getting started with Azure”.
WARNING: Links here send you to different courses than the ones listed below:
- Introduction to Azure solutions - 26 min to Learn how Azure enables you to empower employees, engage customers, optimize operations, and transform products.
- Describe core Azure architectural components - 34 min to Examine the various concepts, resources, and terminology that are necessary to work with Azure architecture.
- Explore Azure compute services - 52 min to Learn how to take advantage of several virtualization services in Azure compute, which can help your applications scale out.
- Plan and manage your Azure costs - 1 hr 2 min to Learn how to plan and manage your Azure costs, including cost analysis, cost management, and cost optimization.
- Introduction to Azure fundamentals - 43 min to Learn about the basics of cloud computing and Azure, and how to get started with Azure’s subscriptions and accounts.
-
Again, Navigate to Azure Subscriptions if you wish to have a separate billing.
https://portal.azure.com/?quickstart=True#view/Microsoft_Azure_Billing/SubscriptionsBladeV1
- Select the Subscription you just created. It has “Not available” for Current cost.
- Rename the Subscription to “Twilio SendGrid” by clicking on the name. Click “Save”.
-
If you have multiple Azure Active Directory tenants, be sure you are viewing the tenant your subscription is assigned to. You can select Switch directories to view your additional tenants. For more on Azure AD, see “Associate or add an Azure subscription to your Azure Active Directory tenant.”
Create a SendGrid resource
https://docs.sendgrid.com/for-developers/partners/microsoft-azure-2021#create-a-twilio-sendgrid-account
-
Get to “Marketplace”.
https://portal.azure.com/#view/Microsoft_Azure_Marketplace/MarketplaceOffersBlade/selectedMenuItemId/home
- Type “Twilio SendGrid” in the “Search the Marketplace” box.
- Click on “Subscribe” in the “Twilio SendGrid” box to select “Free 100 (2022)”.
- For Subscription, select
-
For Resource group, click “Create new”, then type a name with no spaces.
PROTIP: If several Twilio accounts will be created in your company, administered by different people/departments, include a way to differentiate them:
- TwilioSendGridTestX231230a
- TwilioSendGridProdX231230a
PROTIP: “X” in the name means “eXpiration”. Calculate the date one month from today’s date. For example, if today is 2021-11-30, then the expiration date is 2021-12-30.
- For Resource group location, select yours (such as “East US”).
-
For Saas Details Name, type the same name as created above.
-
IMPORTANT: For Recurring billing, click “Off”. The account can be made recurring later.
PROTIP: Set a calendar reminder to cancel this subscription before the end of the month.
-
Click “Review + subscribe”.
Configure on Twilio.com
- Click “Configure account now”. Authenticate the email to use. Accept.
-
“Tell Us About Yourself” page at
https://signup.sendgrid.com/account_details?s2s=true
-
SECURITY PROTIP: Use a different email than the one you used to login to Azure Portal. But The email address is used to log into Twilio.com, so it needs to be a valid email address.
dontcontact@mycompany.com
NOTE: Twilio Sendgrid Support is available at
https://support.sendgrid.com/hc/en-us/requests/new/submit
NOTE: Phone support is available for paying (Pro and Premier) customers. If you are a Pro or Premier customer, you can find the phone number for your region in the Support section of your SendGrid account.
-
Provide a fake Phone Number so you don’t get calls.
555-555-5555
-
Click “Get Started!”
https://www.twilio.com/console
-
In the Welcome page”
Configure Two-factor authentication
Create an API key
Complete Sender Authentication
Create a SendGrid API Key
https://docs.sendgrid.com/for-developers/partners/microsoft-azure-2021#create-a-sendgrid-api-key
https://azuremarketplace.microsoft.com/en-us/marketplace/apps/sendgrid.tsg-saas-offer?tab=Overview
https://azuremarketplace.microsoft.com/en-us/marketplace/apps/sendgrid.tsg-saas-offer?tab=Overview
- SendGrid service from Twilio
- https://docs.sendgrid.com/for-developers/partners/microsoft-azure
Programming languages
- Bash shell
-
PowerShell
- JavaScript Node.JS on Mobile services
- Python
- PHP
-
Ruby
- C# .NET
- Java
- Java via an Azure webpage
Resources
More
This is one of a series about cloud computing:
- Dockerize apps
- Kubernetes container engine
- Hashicorp Vault and Consul for keeping secrets
- Hashicorp Terraform
- Ansible server configuration automation
- Serverless software app development
- Terraform (declarative IaC)
- Build load-balanced servers in AWS EC2
- AWS On-boarding (CLI install)
- AWS MacOS instances in the cloud)
- AWS Certifications
- AWS IAM admin.
- AWS Data Tools
- AWS Security
- AWS VPC Networking
- AWS X-Ray tracing
- AWS server deployment options
- AWS Lambda
- AWS Cloud Formation/cloud-formation/)
- AWS Lightsail
- AWS Deeplens AI
- AWS Load Balanced Servers using CloudFormation
-
Microtrader (sample microservices CI/CD to production Docker within AWS)
-
AWS Data Processing: Databases, Big Data, Data Warehouse, Data Lakehouse
- Google Cloud Platform
-
Bash Windows using Microsoft’s WSL (Windows Subsystem for Linux)
- Azure cloud introduction
- Azure Cloud Onramp (Subscriptions, Portal GUI, CLI)
- Azure Cloud Powershell
- PowerShell GitHub API programming
- PowerShell DSC (Desired State Configuration)
- PowerShell Modules
- Microsoft AI in Azure cloud
- Azure cloud DevOps
- Azure Networking
- Azure Storage
- Azure Compute
- Dynatrace cloud monitoring
- Digital Ocean
- Cloud Foundry