Protect access to Microsoft 365 with dedicated egress IPs
Last updated Oct 12, 2026 Note
Only available on Zero Trust Enterprise plans.
This tutorial covers how to secure access to your Microsoft 365 applications with Cloudflare Gateway dedicated egress IPs.
You can map a named location in Microsoft Entra ID to a location associated with your dedicated egress IPs. Traffic will egress from Cloudflare with these IP addresses. If users attempt to access your Microsoft applications without these IPs, Entra ID will block access.
Before you begin
Make sure you have:
- In Cloudflare, a Zero Trust Enterprise plan with dedicated egress IPs
- In Microsoft 365, an organization managed with Microsoft Entra ID ↗︎
Create an egress policy in Cloudflare Gateway
- In Cloudflare One ↗︎, go to Traffic policies > Egress policies.
- Select Add a policy.
- Name your policy, then add conditions to check users are configured in Microsoft Entra ID. For example, you can check for identity conditions:
| Selector | Operator | Value |
|---|---|---|
| User Group Names | in | Sales and Marketing, Retail, U.S. Sales |
Additionally, you can check for device posture conditions:
| Selector | Operator | Value | Logic |
|---|---|---|---|
| Passed Device Posture Check | is | CrowdStrike Overall ZTA score (Crowdstrike s2s) |
And |
| Passed Device Posture Check | is | AppCheckMac - Required Software (Application) |
|
| 4. Enable Use dedicated Cloudflare egress IPs. Select your desired IPv4 and IPv6 addresses. For example: |
| Primary IPv4 address | IPv6 address |
|---|---|
203.0.113.0 |
2001:db8::/32 |
Create a named IP range location in Microsoft Entra ID
- Log in to the Microsoft Azure portal ↗︎.
- In the sidebar, select Microsoft Entra ID.
- Go to Security > Named locations.
- Select IP ranges location.
- Name your location, then add the IP addresses used in your Cloudflare dedicated egress IP policy.
- Select Upload.
This named location corresponds with the locations of your dedicated egress IPs.
Create a conditional access policy in Microsoft Entra ID
- In Protect, go to Conditional Access.
- Select Create new policy.
- Configure which Entra ID users you want to limit access for, and which traffic, applications, or actions you want to protect.
- In Conditions, select Locations. Enable Configure.
- In Include, select Any location. In Exclude, select the named location you created.
- In Access controls, go to Grant. Enable Block access.
Your policy will block access for your selected users from any location except those using your dedicated egress IPs.
Test your policies
- Using Cloudflare One Client, sign in to your Zero Trust organization with a user's account.
- Go to any Microsoft 365 app within your organization. Entra ID should allow access.
- Disconnect the Cloudflare One Client from your Zero Trust organization. Entra ID should block access to any Microsoft 365 applications.
Was this helpful?
YesNo
On this page
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/cloudflare-one/tutorials/m365-dedicated-egress-ips/#page","headline":"Protect access to Microsoft 365 with dedicated egress IPs","description":"This tutorial covers how to secure access to your Microsoft 365 applications with Cloudflare Gateway dedicated egress IPs.","url":"https://developers.cloudflare.com/cloudflare-one/tutorials/m365-dedicated-egress-ips/","inLanguage":"en","image":"https://developers.cloudflare.com/cloudflare-one/tutorials/m365-dedicated-egress-ips/og.png?v=70ccd05096641baf","dateModified":"2026-10-12","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["Microsoft","IPv4","IPv6"]}
description: This tutorial covers how to Integrate Cloudflare Access with Okta. It also covers the steps to set up Cloudflare Access and integrate Okta with Zero Trust. title: Require U2F with Okta image: https://developers.cloudflare.com/cloudflare-one/tutorials/okta-u2f/og.png?v=72e774539b743495
Documentation Index
Fetch the complete documentation index at: https://developers.cloudflare.com/cloudflare-one/llms.txt
Use this file to discover all available pages before exploring further.
Docs