View on GitHub

Azure Practical Training

A course on becoming an Azure Cloud Engineer

1.3 - Hybrid Identity

Why a Hybrid Identity?

In the previous, rather lengthy chapter, we looked at Azure Active Directory and how it forms the absolute foundation of any Azure landscape. We also discussed the differences between Azure AD and Windows Server Active Directory Domain Services. While such a comparison might have felt redundant for some readers, I consider it crucial for anyone from the Windows Server ecosystem.

Active Directory (AD), which we often refer to as WS AD or AD DS, was previewed in 1999 and made publicly available with the release of Windows Server 2000. It provided authentication and authorisation for users and devices in a Windows-based network environment. As a core component of many enterprise-grade business applications including, but not limited to, Microsoft’s own Exchange, SharePoint and Dynamics, it quickly became one of the essential IT services.

As a result, when a decade later, Microsoft launched Azure, many organisations were long-time users of Active Directory Domain Services. They had, sometimes extensive and complex, deployments of AD that included all the information about their users, group assignments, computers and more. Allowing organisations to bring those identities to their cloud environments made sense. Thankfully, Microsoft was already getting AD DS identities into the cloud for the Business Productivity Online Standard Suie, the predecessor of Officer 365.

Directory Synchronisation

Introducing Azure AD Connect

After several name changes and several updates, we ended up with a tool called Microsoft Azure Active Directory Connect. AAD Connect is a tool installed locally within your Windows Server ecosystem, either on a dedicated virtual machine or on one of the domain controllers. It will connect to both your Azure AD tenant (outbound HTTPS, so no reverse proxy or natting is needed) and your local AD DS and orchestrate the replication of objects. The synchronisation will, however, be one-directional only - from AD DS to AAD.

The installation process is pretty straightforward. I recommend using the custom settings mode, even if only to set up a dedicated service account. You can also specify a SQL server if you have a shared database instance that you use for the smaller apps in your environment.

Azure AD Connect Custom Settings

The tool does need an MS SQL Database instance, so if you don’t specify one, the installation wizard o will configure SQL 2019 Express as a default. Be mindful of the capacity consideration, as MS SQL does tend to consume as much memory as possible.

Once the required components are installed, you must make the most crucial choice in your AD Connect deployment - the sign-in method.

Three modes of sign-in

Azure AD Connect offers three sing-in modes that provide different options:

The table below offers a comparison of features between the three options:

Option PHS and SSO PTA and SSO AD FS
Sync new user, contact, and group accounts created in my on-premises Active Directory to the cloud automatically. X X X
Set up my tenant for Office 365 hybrid scenarios. X X X
Enable my users to sign in and access cloud services using their on-premises password. X X X
Implement single sign-on using corporate credentials. X X X
Ensure no password hashes are stored in the cloud.   X X
Enable cloud-based multi-factor authentication solutions. X X X
Enable on-premises multi-factor authentication solutions.     X
Support smartcard authentication for my users.4     X
Display password expiry notifications in the Office Portal and on the Windows desktop.     X

You can also choose not to configure an Azure AD Connect sign-in method if you want to handle it via a federated third-party tool.

Once you’ve made the critical decision regarding user sing-ins, you’ll have to configure a few other settings regarding the synchronisation scope. Choose the domains and OUs and configure filtering. If you want to enable password write-back, you’ll find this option in the “Optional Features” section of the setup wizard.

Azure AD Connect Health

Directory synchronisation can be a critical component of your hybrid cloud environment. But even if you don’t find yourself overly reliant on Azure AD Connect, monitoring synchronisation for any issues is a good idea. AAD Connect Health is a service designed just for that. You can find it in the Azure Portal under the Azure Active Directory blade in the Azure AD Connect section.

Azure AD Connect Health

The tool will provide rich insights into alerts, performance and usage metrics. To install and configure the monitoring agents, follow the official documentation.

Azure AD Connect Cloud Sync

In 2019 Microsoft released a more modern replacement for Azure AD Connect - AAD Connect Cloud Sync. Since then, the tool has been under development, and at the time of writing, it almost offers functional parity compared to its predecessor.

The new service moves the synchronisation engine from on-premises to a cloud-based service (as the name might have indicated). As a customer, you still need to install an agent application, but Microsoft describes it as a “lightweight agent”. No more MS SQL is required, not even the express edition. Besides that, the new version also provides support for:

Synchronisation flow with AAD Connect Cloud Sync

Some features of Azure AD Connect are still not there, so check the Azure AD Connect Cloud Sync documentation before choosing. For example, Pass-Through Authentication is no longer available, so you will have to synchronise password hashes or use the federated model.

However, the two tools can coexist in a single environment, so you can mix and match based on what you need. The limitation is that both services cannot synchronise the same AD object, so you will need a domain- or OU-level scoping. Also, please keep in mind that once the new tool catches up on the missing functionality, Microsoft will start phasing out Azure AD Connect.

Active Directory in Azure

Getting our Active Directory users and groups synchronised to Azure AD is handy. Still, it is only one of the two sides to hybrid identities in Azure. More often than not, especially when working with applications designed for the Windows Server ecosystem, you will need traditional Active Directory Domain Services in your Azure environment.

When that’s the case, you have two options:

We’ll look at both to understand the better choice in your circumstances.

Extending AD to Azure

The typical case is deploying Active Directory Domain Controllers (DCs) to your Azure environment. If you’re new to Active Directory, the DC is the primary component, and you will need at least one, although the best practice tells us to have at least two. When you deploy additional Domain Controllers, the service will handle replication and high availability automatically, but there are a few things to keep in mind:

IMPORTANT - the above information is an abridged and condensed extract. Active Directory is a vast topic as the service has many advanced features and options. My goal is to give you enough to get you going and ensure you won’t shoot yourself in the foot. You’ll find more information here, but if AD DS is a complete unknown, I recommend you seek support from someone with experience.

The resulting topology of extending one’s Active Directory to Azure can be complex and costly. The figure below provides a good overview. If the icons and names still make little sense to you, worry not — we will go into each of them in detail in the coming chapters.

Example topology of AD DS extended to Azure

Azure AD Domain Services

If setting up and managing the entire stack of resources needed to extend your Active Directory to Azure seems too much, there is a managed service that does the same thing. In a way.

If Azure AD Connect synchronises Active Directory with your Azure AD tenant, Azure AD Domain Services sets up an opposite data flow. The service will deploy Domain Controllers, configure Active Directory Domain Services and set up the synchronisation from your AzureAD tenant towards the Active Directory domain. As a result, you get a managed Active Directory Domain Services environment connected to the Azure Virtual Network(s) of your choice. You can deploy multiple instances, or replica sets, even across multiple Azure regions. Each replica set will consist of two Domain Controllers configured in a zone-redundant topology (if the region supports Availability Zones).

Example multi-region deployment of Azure AD Domain Services with two replica sets

If it’s starting to sound too good to be true, you’re onto something. Although AAD DS is a fantastic service, several limitations will dictate whether the managed AD offering is for you or you will be forced to go the traditional route.

The most critical limitations include the following:

There are a few other limitations, but if you’re interested, I’ll have to send you to the official documentation here and here.

If none of the features unavailable in the managed Active Directory Domain Services offering is crucial to your use case, I recommend seriously considering Azure AD DS. While you can get a better deal, looking purely at consumption cost, with a pair of traditional Domain Controllers, the cost of managing, securing, updating and protecting those VMs cannot be underestimated. More on those topics in part 3.

IMPORTANT - When you deploy an Azure AD Domain Services instance, you must provide a subnet of a Virtual Network that the managed service will use to deploy Domain Controllers. The Network Security Group, which acts as the subnet’s Access Control Lis, requires particular rules. Unfortunately, some of them cannot be configured via the Azure Portal. To work around this issue, allow the AAD DS wizard to create the subnet or use a programmatic deployment for the NSG. Even though it might sound like back magic right now, please keep it in mind. It will all make perfect sense soon.

<- 1.2 - Azure Active Directory 1.4 - Managing Azure ->