Tutorial: Configure Cloudflare with Azure Active Directory for secure hybrid access
In this tutorial, learn how to integrate Azure Active Directory (Azure AD) with Cloudflare Zero Trust. Using this solution, you can build rules based on user identity and group membership. Users can authenticate with their Azure AD credentials and connect to Zero Trust protected applications.
Prerequisites
To get started, you need:
An Azure AD subscription
- If you don't have one, you can get an Azure free account.
An Azure AD tenant linked to your Azure AD subscription
A Cloudflare Zero Trust account
- If you don't have one, go to Get started with Cloudflare's Zero Trust platform
Integrate organization identity providers with Cloudflare Access
Cloudflare Zero Trust Access helps enforce default-deny, Zero Trust rules that limit access to corporate applications, private IP spaces, and hostnames. This feature connects users faster and safer than a virtual private network (VPN).
Organizations can use multiple Identity Providers (IdPs) simultaneously, reducing friction when working with partners or contractors.
To add an IdP as a sign-in method, configure Cloudflare Zero Trust dashboard and Azure AD.
The following architecture diagram shows the implementation.
Integrate a Cloudflare Zero Trust account with Azure AD
To integrate Cloudflare Zero Trust account with an instance of Azure AD:
On the Cloudflare Zero Trust dashboard, navigate to Settings > Authentication.
For Login methods, select Add new.
Under Select an identity provider, select Azure AD.
The Add Azure ID dialog appears. Enter credentials from your Azure AD instance and make necessary selections.
Select Save.
Register Cloudflare with Azure AD
Use the instructions in the following three sections to register Cloudflare with Azure AD.
Sign in to the Azure portal.
Under Azure Services, select Azure Active Directory.
In the left menu, under Manage, select App registrations.
Select the + New registration tab.
Name your application and enter your team domain, with callback at the end of the path: /cdn-cgi/access/callback. For example,
https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callback
Select Register.
Certificates & secrets
On the Cloudflare Access screen, under Essentials, copy and save the Application (client) ID and the Directory (tenant) ID.
In the left menu, under Manage, select Certificates & secrets.
Under Client secrets, select + New client secret.
In Description, name the client secret.
Under Expires, select an expiration.
Select Add.
Under Client secrets, from the Value field, copy the value. Consider the value an application password. This example's value is visible, Azure values appear in the Cloudflare Access configuration.
Permissions
In the left menu, select API permissions.
Select + Add a permission.
Under Select an API, select Microsoft Graph.
Select Delegated permissions for the following permissions:
Email
openid
profile
offline_access
user.read
directory.read.all
group.read.all
Under Manage, select + Add permissions.
Select Grant Admin Consent for ....
On the Cloudflare Zero Trust dashboard, navigate to Settings> Authentication.
Under Login methods, select Add new.
Select Azure AD.
Enter the Application ID, Application secret, and Directory ID values.
Note
For Azure AD groups, in Edit your Azure AD identity provider, for Support Groups select On.
Select Save.
Test the integration
To test the integration on the Cloudflare Zero Trust dashboard, navigate to Settings > Authentication.
Under Login methods, for Azure AD select Test.
Enter Azure AD credentials.
The Your connection works message appears.
Next steps
Feedback
Submit and view feedback for