Conditional Access: Block access by location
With the location condition in Conditional Access, you can control access to your cloud apps based on the network location of a user. The location condition is commonly used to block access from countries/regions where your organization knows traffic shouldn't come from.
Note
Conditional Access policies are enforced after first-factor authentication is completed. Conditional Access isn't intended to be an organization's first line of defense for scenarios like denial-of-service (DoS) attacks, but it can use signals from these events to determine access.
Define locations
- Sign in to the Azure portal as a Conditional Access Administrator, Security Administrator, or Global Administrator.
- Browse to Azure Active Directory > Security > Conditional Access > Named locations.
- Choose New location.
- Give your location a name.
- Choose IP ranges if you know the specific externally accessible IPv4 address ranges that make up that location or Countries/Regions.
- Provide the IP ranges or select the Countries/Regions for the location you're specifying.
- If you choose Countries/Regions, you can optionally choose to include unknown areas.
- Provide the IP ranges or select the Countries/Regions for the location you're specifying.
- Choose Save
More information about the location condition in Conditional Access can be found in the article, What is the location condition in Azure Active Directory Conditional Access
Create a Conditional Access policy
- Sign in to the Azure portal as a Conditional Access Administrator, Security Administrator, or Global Administrator.
- Browse to Azure Active Directory > Security > Conditional Access.
- Select New policy.
- Give your policy a name. We recommend that organizations create a meaningful standard for the names of their policies.
- Under Assignments, select Users or workload identities.
- Under Include, select All users.
- Under Exclude, select Users and groups and choose your organization's emergency access or break-glass accounts.
- Under Cloud apps or actions > Include, and select All cloud apps.
- Under Conditions > Location.
- Set Configure to Yes
- Under Include, select Selected locations
- Select the blocked location you created for your organization.
- Click Select.
- Under Access controls > select Block Access, and click Select.
- Confirm your settings and set Enable policy to Report-only.
- Select Create to create to enable your policy.
After confirming your settings using report-only mode, an administrator can move the Enable policy toggle from Report-only to On.
Next steps
Conditional Access common policies
Determine impact using Conditional Access report-only mode
Simulate sign in behavior using the Conditional Access What If tool