This post will cover how to setup your first Azure App. We’ll connect a Outlook user using the Nylas dashboard.
In this post, let’s take a look at creating an Azure App to use with Nylas. This is useful when building applications requiring access to a user’s communication data. In this scenario, we’ll be allowing Outlook users to connect their accounts so we can access their email, calendar, and contacts. We created a similar post on how to create a Google API project. This post will walk the reader through how to create an Azure App.
Also, check out our livestream that walks you through setting up your first Azure app:
Sign up here if you need to create a Nylas account for free!
Create a new App in the Nylas dashboard
Note the starter app (quickstart apps) does not allow setting up Outlook Authentication
We’ll be using Azure console to create an Azure App, so make sure you signup for an Azure account!
No local environment setup is required, we’ll be using the Nylas and Azure dashboards to set everything up.
Azure App Overview
A few items we need to consider upfront are authentication flow and supported account types.
The two different authentication flows are: hosted and native authentication. Hosted authentication flow is a no-code approach to connecting users. The differences between hosted and native authentication are discussed in the Nylas docs. We’ll be using hosted authentication.
Most applications will be external public-facing applications. This requires additional checks before publishing and you are initially limited on the total number of test accounts. For the purposes of this blog, when creating an app in Azure, when selecting Supported account types, we will use Accounts in any organizational directory that is open to all users.
Let’s jump into Azure and create our app. This involves a few steps, so we’ll go through them one by one.
Understanding Required APIs and Permissions
The Nylas docs contain a list of different Azure permissions we can set up when building with Nylas. Keep in mind that we have a few Azure scopes that will be required (openid, profile, and User.Read) when creating an Azure app. For now, let’s consider the flow where we are just accessing the user’s calendar data, so that will requires us to include the Calendars.Read Azure API permission.
Now we’ve created an Azure App that we can start to configure the APIs we want to use.
Enable APIs and Permissions
The APIs that we enable will allow us to access specific user communication data: profile data, contacts, emails, calendars, and available resources (i.e. room availability). For now lets’ consider connecting the Azure Calendar API so that we can receive emails.
We’ve gone ahead and added the required permissions (openid, profile, and User.Read), so let’s add the Calendar scope (Calendar.Read):
Now we’ve enabled the Azure permissions to receive a user’s calendar data such as upcoming events.
Configure OAuth Credentials
We need to create API credentials, so Nylas can communicate with Azure API and similar service providers to retrieve the user data for us. The purpose of doing this is so our application can receive a consistent structure of communication data across all providers as we build out our application.
Let’s set up the Azure API OAuth Credentials on Azure:
After creating the new secret, you will have a Value and Secret ID:
Note: Ensure to securely store the Secret ID, this should not be publicly available (i.e. the client credentials have been deleted)
We will be taking the Secret ID and adding it to the Nylas Dashboard shortly. Another value that we will need is the Application (client) ID for the app we created (azure-app):
Now we’ve set up OAuth credentials so we can start communicating with the Azure API to access user communication data like upcoming calendar events.
Update Nylas Dashboard
Let’s add the Azure OAuth credentials to the Nylas dashboard:
Note in the above image, we created a new application azure-app before adding the Azure OAuth credentials user to the Office365 Auth section of Authentication.
Connecting accounts with Nylas
Let’s test out the integration by connecting an Outlook account using the Nylas Dashboard (this is equivalent to using Nylas’ Hosted Authentication):
Note: Ensure to securely store the access token, this should not be publicly available (i.e. the client credentials have been deleted)
Now we’ve successfully tested connecting to an Outlook account using the Nylas Dashboard.
Continue building with Nylas and learn more by visiting the documentation. Sign up here if you need to create a Nylas account for free!
Delivering Unified User Experiences with Transactional and Contextual Email APIs
A Small Guide to Virtual Calendars
How to Mail Merge in Outlook Step by Step
Subscribe for our updates
Please enter your email address and receive the latest updates.
Ram loves teaching, building and exploring technologies. He is passionate about empowering developers to ship amazing products to market as fast as possible 🚀. Ram is excited to share knowledge and help others. He’s a Relaxed Tomato 🍅.