Gabriela Gavrailova

// Product Marketing Associate for Devs

We all know that the future of computing is in the cloud. People are using cloud services more and more frequently (even if they don’t know it), and businesses are moving in the same direction because it’s less expensive and more efficient. One of the best examples for a cloud-based platform is Microsoft Azure. Keep reading to find out more about Azure and how you can integrate it with Mailjet with.

What is Azure?

Azure is a cloud computing platform, launched in February 2010 by Microsoft. It offers services that help you leverage any other Microsoft technology such as cloud-hosted versions of common enterprise Microsoft solutions like Active Directory and SQL Server. Azure is a platform with endless possibilities that combines Infrastructure as a Service (IaaS), Platform as a Service (PaaS), and Software as a Service (SaaS) solutions. Yeah, you heard us right. All that in one.

Microsoft Azure is a collection of cloud computing services where you can add different resources that you need. With a usage-based billing formula, Azure is a compelling option for enterprises transitioning from on-premise Windows servers to the cloud because it makes it easier to manage everything you need.

But, the billing system doesn’t only make Azure a solution for big companies. The infinite scalability of Azure can make it just right for your small, personal business as well. And any organization using technologies like Windows Server and Active Directory will find Azure to be a really effective, new solution. Microsoft Azure provides a directory of hundreds of different services you can use, including full virtual machines, databases, file storage, backups, and services for mobile and web apps.

What makes Azure so interesting?

Instead of building an expensive, on-premise server installation, or renting servers from data centres, Azure’s billing structure is based on resource consumption. This makes Azure a less expensive solution in most cases. Of course, the pricing depends on what types of services and storage option you choose.

One of the best things that Azure is offering is the ability to instantly provision computing resources on demand. This means that you can manage all the recourse you want directly fromAzure, and for this, you won’t need to have a ton of different accounts. Microsoft maintains a growing directory of Azure services, with more being added all the time. One of the best examples is the combination of Azure and Office 365 which will make the life of your IT guys easier. If you’re looking for even more uses, you can integrate Azure with your email solution, which is possible with our integration with Azure.

You can use the Azure cloud platform for building, deploying and managing services and applications anywhere you want, while being sure that it provides secure, reliable access to your cloud-hosted data. We all know that Microsoft has one of the most proven architectures. By using Microsoft Azure, you can rely on a better disaster recovery too. Azure is not a centralized local solution, and this creates limitless options for disaster recovery plans.

If that wasn’t enough, Azure also comes with advanced alert capabilities so you will know in an instant if there are any issues that are impacting your business.

Azure has so many functionalities that we’re almost 100% certain that you will find everything you need, including an integration with Mailjet.

How to connect Mailjet and Azure

By integrating with Azure, Mailjet helps to save time and money by providing a transactional and marketing email service all from within the Azure platform. You can use our API or SMTP solutions to send and receive emails, easily synchronize your data back into your applications hosted on Azure, track email events in real-time and much more. You will also gain access to an advanced user interface which includes a real-time metrics dashboard and advanced email marketing features such as A/B Testing, Real-time Monitoring, Campaign Comparison, and Segmentation. Do you want to give al these features a try? Let’s start then and see how you can enable Mailjet in Azure.

Enable Mailjet in Azure

First off, you’re going to need to access your Azure account and click on the “New” button in the left part of the page.

mailjet-azure-dashboard

Then just enter “Mailjet” and choose our service.

mailjet-azure-resources

You will have to select the “Create” button once you have opened the new tab by double-clicking on Mailjet.

mailjet-azure-create

And now the set up begins – you will need to choose a ‘Name’ to identify the Mailjet Email Service in your Azure settings. The name needs to be between 2 and 64 characters long and alphanumeric. Make sure to also select the “Subscription” type you prefer and choose an existing ‘Resource Group’ for the Mailjet Email Service, or create a new one. Keep in mind that the Resource Group name should be up to 90 characters long, can only include alphanumeric characters, periods, underscores, hyphens, and parentheses.

You will have to select the “Location” and the “Pricing Tier” you would like to use. And of course, you will have to agree with all the legal terms of use. Don’t forget to tick the ‘Pin to dashboard’ checkbox to be able to find the Mailjet resource more easily after the deployment. Click on ‘Create’ to start the deployment.

mailjet-azure-setup

Once the deployment has finished, you will see a ‘Deployment Succeeded’ pop-up notification. You will be able to find the Mailjet resource on the Dashboard if the ‘Pin to Dashboard’ option has been selected during the setup. Otherwise, you will find it in the ‘All Resources’ section of the main menu.

mailjet-azure-all-resources

The Mailjet resource will have been added, and all new accounts get activated automatically right away so you can access your resource and start creating awesome еmail campaigns immediately. For now, you can use your Mailjet account only through Azure, but if you want to have the possibility to access your account from our site, please follow the steps described here.

Find Your Mailjet API Keys

To use Mailjet with SMTP or API, you will need your API key and your secret key because they function as user name and password. To grab them, you need to access to the Mailjet configuration screen from Azure, then click on ‘Manage’.

mailjet-azure-manage

You will arrive at your ‘Mailjet Account Settings’ page. Under ‘REST API’, click on ‘Master API key & Sub API key management’.

mailjet-azure-api

You will see your ‘Public’ and ‘Secret API Key’ here. You will also see any Sub-account API Keys that may have been added.

mailjet-azure-api-key

There is only one step left for you to have your Mailjet resource completely functional – add a sender and validate it.

Configure Mailjet for Use

Click on ‘Manage’ to access your Mailjet Account Settings where you can validate a sender address for your Mailjet resource. To do this, click on ‘Add a Sender Domain or Address’ from your Account page.

mailjet-azure-sender

From here, you will add a new sender address. If you want to use more than one email address linked to the same top-level domain, you can add the domain instead. For more information, please see the Mailjet FAQ.

mailjet-azure-domains

You will also have to configure your SPF and DKIM records, just to be sure that you are doing everything you can to achieve the best deliverability possible. A good option would be to set up DMARC and customize your return path, too.

Setting up your Mailjet’s SMTP relay

To set up your SMTP relay you will have to click on “Manage” the Mailjet resources and access the Settings tab. Under the Properties tab, you will have to fill out your API key and also set up Mailjet’s SMTP server in-v3.mailjet.com and the port you would like to use. If you want to check which ports Mailjet supports, you can visit our article on the subject.

mailjet-azure-smtp

And your password (API secret key) needs to be added in Key Management.

mailjet-azure-management

You are all set up to use Mailjet’s SMTP relay from your Azure now. But if you prefer to use API, keep reading. 😉

Using Mailjet’s API

As you probably guessed already, to use Mailjet’s API with Azure, you will have to use our .NET wrapper and reference the Mailjet .NET class library. The Mailjet NuGet Package is an easy way to retrieve the Mailjet API and configure your application with all dependencies. NuGet is a Visual Studio extension that facilitates installing and updating tools and libraries. It is included with Microsoft Visual Studio 2015 and above.

Open a new “Project” in Visual Studio and choose the template:

mailjet-azure-api-setup

In Visual Studio, go to ‘Tools’ → ‘NuGet Package Manager’ → ‘Package Manager Console’ to open the Console.

mailjet-azure-api-resources

Select the Project from the ‘Default Project’ menu, then enter ‘Install-Package Mailjet.Api’ in the Console to install it.

mailjet-azure-console

Once installed, you will be able to view the installed dependency under ‘Dependencies’ → ‘NuGet’ → ‘Mailjet.Api’.

mailjet-azure-api-console

Mailjet.Api is the name of Mailjet’s .NET class library. It contains the following namespaces: – Mailjet.Client – Mailjet.Client.Resources

Add the following code namespace declarations at the start of a C# file, in which you want to programmatically access the Mailjet Email Service.

using Mailjet.Client;
using Mailjet.Client.Resources;

And now you can benefit from all advantages of Mailjet’s API.

mailjet-azure-happy

Summing it up

Now you know more about what Azure is: one of the best cloud computing platforms with the most functionalities. By using Azure, you can forget about the expensive on prem infrastructure and be sure that you can have access to your infra anytime,anywhere. You can also add countless additional resources to your platform and manage everything you need in one place. The integration with Mailjet will give you the possibility to take care of your emailing from Azure with more ease and create perfect emails. Don’t miss out on such a sweet opportunity.

Follow us on Twitter and Facebook for more tips and news.