Book Image

Azure Active Directory for Secure Application Development

By : Sjoukje Zaal
Book Image

Azure Active Directory for Secure Application Development

By: Sjoukje Zaal

Overview of this book

Azure Active Directory for Secure Application Development is your one-stop shop for learning how to develop secure applications using modern authentication techniques with Microsoft Azure AD. Whether you’re working with single-tenant, multi-tenant, or line-of-business applications, this book contains everything you need to secure them. The book wastes no time in diving into the practicalities of Azure AD. Right from the start, you’ll be setting up tenants, adding users, and registering your first application in Azure AD. The balance between grasping and applying theory is maintained as you move from the intermediate to the advanced: from the basics of OAuth to getting your hands dirty with building applications and registering them in Azure AD. Want to pin down the Microsoft Graph, Azure AD B2C, or authentication protocol best practices? We’ve got you covered. The full range of Azure AD functionality from a developer perspective is here for you to explore with confidence. By the end of this secure app development book, you’ll have developed the skill set that so many organizations are clamoring for. Security is mission-critical, and after reading this book, you will be too.
Table of Contents (14 chapters)
Part 1: Getting Started with the Microsoft Identity Platform
Part 2: Authentication and Protocols
Part 3: Azure AD B2C

Setting up an Azure AD tenant

In this section, we are going to set up a new Azure AD tenant inside an Azure subscription.

Important Note

If you are new to Azure and don't have a subscription already, you can sign up for a free account here:

Microsoft also offers the Microsoft 365 Developer Program. Here you can sign up for an E5 licensed tenant with no need to sign up for a subscription, no credit card needed, and you get access to sample data packs. The tenant is live by default for 90 days and it will automatically renew if it is actively used. If you want to use an environment that includes a fully functional E5 license including all the features and sample data, this is the way to go. You can sign up for this program here:

To create a new Azure AD tenant, you have to take the following steps:

  1. Open a web browser and navigate to
  2. In the overview page of Azure AD, in the top menu, select + Create a resource:
Figure 1.3 – Azure portal overview

Figure 1.3 – Azure portal overview

  1. Search for Azure Active Directory in the search box and select it.
  2. Click the Create button to start creating a new Azure AD tenant.
  3. Next, in the Basic tab, you need to select the type of tenant that you want to create, an Azure Active Directory or Azure Active Directory (B2C) tenant. Azure Active Directory will be selected by default. Make sure that it is selected and click Next: Configuration:
Figure 1.4 – Selecting the type of tenant to create

Figure 1.4 – Selecting the type of tenant to create

  1. In the next screen, you need to specify the values for the Azure AD tenant. I've used the following values, but you have to fill in a unique name here:
    • Organization name: PacktPubDev.
    • Initial domain name: PacktPubDev. This will result in the following domain name:
    • Country/Region: Here, select your current country or region.

Your settings will look like the following screenshot:

Figure 1.5 – Specifying Azure AD tenant details

Figure 1.5 – Specifying Azure AD tenant details

  1. Click Review + create and Create. If needed, prove that you are not a robot and then click Submit to create the Azure AD tenant.

It will take a couple of minutes before the Azure AD tenant is created. After it is created, we can start adding our first user to it. Let's cover this in the next section.