Business Use Case: The web platform can only be accessed from specific countries for example USA & India. Users from other countries are not allowed to access it.

Solution: Azure Front door provides a simple solution by using rules engine configuration. (Please refer to the below image where we can see Rules Engine Configuration)

Check “Add” icon in the above image where we can define rules.

  • Define rules engine name(Example :GeoMatch )
  • Add a Condition(IF) and Select Remote Address
  • The remote address match condition identifies requests based on the requester’s location or IP address. You can specify multiple values to match, which will be combined using OR logic.
  • Select Operator as Geo Not Match and select countries in Value.
  • Add an action(Then) (Please configure as mentioned in the above image.)

Let’s see what we achieved using the above configuration.

In the above screenshot, India and USA are selected as a Value. If the request does not come from these two countries, it will be redirected to the default webpage. Use Replace Destination Host as a redirect URL and save Rules. That’s it, we are done.

Stay tuned for more short blogs on Azure. Happy Learning…