Skip to content
T-Minus 365Try CloudCapsule

Automate Travel Request in Microsoft 365 | Secure Travel

Nick Ross · Updated

Many of us have set up a geo-blocking conditional access policy (opens in new tab) to prevent sign ins from unapproved countries. If you haven’t already, look to implement this as it gives you great protection against potentially malicious sign ins. This policy inevitably creates a support burden when users are traveling to a country that is not approved (in most cases because they are going on vacation) and they want to access work email/resources. I came across this great article that showed how to automate these request using Access Packages in Entra: Secure your users when they go on vacation – Agder in the cloud (opens in new tab)

While access packages are great, they do require an Entra P2 license which most of our customers are not going to have. For that reason, I wanted to provide a solution you could create in any tenant leveraging Microsoft Forms and Power Automate to automate these requests. In this article, we will cover this solution and I provide you a zip file you can use to import the Power Automate flow as a template in your customer environments.

What we are accomplishing:

Let’s look at a hypothetical example of what we are performing in the tenant:

1. A conditional access policy is set up to block all logins from outside the US

2. A user will be on vacation in Italy for 2 weeks. The user submits a travel request via a form that includes the country they will be traveling to and the start and return dates. A ticket is created in PSA.

3. The country requested is verified as an “approved country” for travel. On the start date, the user is added to a “Temporary Travel” group that is being excluded from our geo-blocking CAP and included in a “Temporary Travel” CAP we have that allows access from approved temporary country locations.

4. On the return date, the user is removed from the Temporary Travel group and no longer has access to sign in from Italy.

Security Benefits

  • We are not creating blanket exclusions to our base geo-location policy for users. We are effectively approving a temporary whitelist to a select list of countries for that individual user
  • We are not modifying the conditional access policies themselves but rather the group membership part of the exclusions/inclusions
  • We automate the flow to avoid human error that leaves holes in our conditional access policy protections over time

Steps:

1. Configure approved countries as a Named Location

  1. In the Entra Admin Center, go to Protection>Conditional Access>Named Locations> +Countries location
  2. Provide a name (i.e. Temporary Travel)
  3. Add your list of approved countries

Note that the list here is something you should define as an MSP, taking into consideration potential frequent countries users already travel to in the tenant. In my Power Automate template, you will notice that I have an array defined of about 39 countries. You can add and subtract those as needed.

Pro Tip If you copy and paste the country list here into an excel sheet, you can clean that up to have your approved list and then feed that into ChatGPT to get the array we will use later in the Power Automate flow. Prompt: convert the following into an array with the following format ["Test", "Test1", "Test 2"] ×

2. Create a group for Temporary Travel

In the Entra Admin center, create a new Security group called “Temporary Travel”. After creation, copy the object ID and paste it in notepad. We will use it later in the Power Automate flow.

3. Create a Microsoft Form

I made this very simplistic but you could add other fields as needed. Note that we will be creating this as a form in each customer environment. If you do that, you have the additional benefit of only authenticated users coming from this environment and you don’t have to request as much info like their email since that will natively come through with the form response as we will see in the Power Automate flow.

Here you will also use the “choice” selection for the Country List. Add the countries here you defined in your Named Location Policy. I like to add the “Other” option so users can type in the name of the country they are going to if it is not in the approved list. Also, click on the 3 dots on the question to make it a dropdown for the user.

4. Import the Power Automate Template

  1. Download the zip file here for free (Type $0 at checkout) to get the Power Automate Template: Automating Travel Request – Automate Travel Request · Tminus365 (opens in new tab)
  2. Go to https://make.powerautomate.com/ (opens in new tab)
  3. Click My Flows>Import>Import Package

4. Upload the zip file

5. Do not modify the Flow resource. For the connectors, click on “Select during import” for each and modify them to connect to a service account in your environment. If you do not already have one, I would recommend creating a dedicated service account specifically for power automate. They need to have enough permissions to grab the data requested in Entra. The outlook connection needs to have a mailbox associated with this user.

Pro Tip If you are creating new connections, use the Search bar in the upper right corner of the + New Connection page to quickly find the resource type you are looking for. ×

6. Click Import when finished>Click Open Flow after successful import.

5. Modify the template

Modify the first action to add the Microsoft Form you created earlier

Modify the Get response details action to dynamically grab the Form from the previous step.

Modify the Array of “Approved Countries” (Optional)

Modify ALL Timer Delay actions (Delay Until & Wait Until Return Date) to your time zone value. Refer to the following for the correct string value: Default Time Zones | Microsoft Learn (opens in new tab)

For the Get Group action, replace the guid here with the Object ID you grabbed earlier for your Temporary Travel group.

Modify ALL of the “Create Ticket” actions to go to your support email. Change the email template to include the company name in the subject line and body.

6. Test the flow

After you have saved your flow, click on Test in the right corner. Select manual and then submit the form to test to ensure there are no errors.

7. Update your existing Conditional Access policy for geo-blocking

In your existing policy, exclude the “Temporary Travel” group.

8. Create a new Conditional Access Policy for Temporary Travel

Create a new Conditional access policy that applies the following:

  • Assigned to our Temporary Travel Group
  • Targets All Cloud Apps
  • Includes our Temporary Travel Named location
  • Grants access but Requires MFA

Conclusion

I know these steps might seem cumbersome to set up for each customer but think of all of the potential time savings and security benefit from having this entire process automated!

Note: If you do have Entra P2 in tenants, it might be better to follow the Access Package steps outlined in the article I added at the beginning of this post given its built into your licensing.

See how your Microsoft 365 tenant measures up in about a minute.

CloudCapsule scans 300+ security controls, shows what to fix first, and keeps watching for drift after you fix it. Whether you manage one tenant or fifty, it’s the complete Microsoft 365 security workflow.

Try CloudCapsule for Free

No credit card required. Results in < 2 minutes.

Learn More at CloudCapsule.io

The weekly update

One email a week with what changed in Microsoft 365, plus new guides and videos.

Unsubscribe anytime. Privacy Policy

Keep reading

Automating Vendor Onboarding Request

Automation

Are you looking to streamline vendor onboarding requests in your organization? In this post, I’ll walk you through an end-to-end automation built in Power Automate that allows users to submit vendor onboarding requests, routes them through approval in Microsoft Teams, and—if approved—adds the software to a central inventory, notifies procurement, and even opens a ticket […]

Automate User Offboarding in Microsoft 365 | Full Tutorial

Automation

In a previous post, I showed you how to automate user onboarding via a Microsoft Form and Power Automate flow. Today we are shifting the focus to user offboarding. When managing employee offboarding, it’s crucial to ensure the process is both efficient and secure. The manual tasks, from revoking user access to transferring email permissions, […]

Automate User Onboarding with HaloPSA and Microsoft 365 | Full Tutorial

Automation

In last weeks post, I showed you how to use Microsoft Forms and Power Automate to automate employee onboardings across customers. This week, I am going to show you how to do this in HaloPSA leveraging the self-service portal customers can use as a front end. We will be using a webhook in Halo to […]