Pilot program management using Application Request Routing

by IIS Team

Overview

This topic leads the reader through the steps to launch and manage pilot or beta programs using Application Request Routing. Application Request Routing can be used to target and route the appropriate users to the pilot site, or it can also be used to limit and manage the amount of traffic that is routed to the pilot site. This walkthrough focuses on how Application Request Routing can be used to route specific requests to the pilot site based on the user's profile.

Goal

To configure Application Request Routing to manage and mitigate risks around launching a pilot program.

Prerequisites

This walkthrough requires the following prerequisites:

  • IIS 7.0 or above on Windows 2008 (any SKU) or newer.
  • Microsoft Application Request Routing Version 1 and dependent modules.
  • Minimum of four content servers with working sites and applications. Two servers will be used to simulate the production site, and the other two servers will simulate the pilot site.
  • Alternate browser to Microsoft Internet Explorer, such as Firefox, on a computer with .NET 3.5 installed. (This setup is used only for testing purposes.)

If Application Request Routing Version 1 has not been installed, it is available for download at:

  • Download Microsoft Application Request Routing Version 1 for IIS 7 (x86) here.
  • Download Microsoft Application Request Routing Version 1 for IIS 7 (x64) here.

Follow the steps outlined in this document to install Application Request Routing.

Another prerequisite is that the reader has defined and configured two server farms by following the steps outlined in Define and Configure an Application Request Routing (ARR) Server Group. One server farm will represent the production environment, while the other will represent the pilot environment.

Step 1 – Change the URL rewrite rules to route requests based on user's profile

In this step, URL rewrite rules are changed so that only the users who have installed .NET 3.5 and are using Microsoft Internet Explorer (IE) are routed to the pilot site, defined as pilotSiteServers. All others are routed to the production site, defined as productionSiteServers.

To change the URL rewrite rules using the UI:

  1. Launch IIS Manager.

  2. Select the server farm, pilotSiteServers.

  3. The following icons are shown:

    Screenshot of the icons in the server farm pane.

  4. Double-click Routing Rules.

  5. Since this scenario involves multiple server farms with conditional matching of HTTP request headers, the changes are made using the URL rewrite UI that exposes additional options. Click URL Rewrite under Advanced Routing.

    Screenshot of U R L Rewrite under the Advanced Routing section in Routing Rules.

  6. Note that two rules have already been created, but they must be changed.

    Screenshot of the U R L Rewrite pane with preset default rules.

  7. The order of the rules matter in this walkthrough. If ARR_productionSiteServers_loadbalance is above ARR_pilotServers_loadbalance, you can change the order of the rules by using Move Up or Move Down after selecting the rule.

  8. Select ARR_pilotSite_Servers_loadbalance, and then click Edit... in the Actions pane.

    Screenshot of the Edit Rule pane for A R R pilot Site Servers load balance with default settings selected.

  9. Clients with IE with .NET 3.5 should be specified to go to the pilotSiteServers server farm. Do this by adding conditions. Click Add Conditions, and thenclick Add....

    Screenshot of an empty Add Conditions dialog.

  10. Enter {HTTP_USER_AGENT} as Condition input and *MSIE* as Pattern. This condition checks to see if the client is using IE.

    Screenshot of Condition input as curly brace H T T P underscore USER underscore AGENT curly brace and Pattern as asterisk M I S E asterisk.

  11. Add another condition to check for the .NET version. Click Add..., and then enter {HTTP_USER_AGENT} as Condition input and *.NET CLR 3.5* as Pattern.

    Screenshot of another condition with Pattern as asterisk dot NET space C L R space 3 dot 5 asterisk.

  12. Finally, uncheck the Stop processing of subsequent rules checkbox, and then click Apply to save the changes.

    Screenshot of unchecked Stop processing of subsequent rules after the Action properties section.

As noted above, the order of the rules matters. This is because URL rewrite processes the rules in order when Stop processing of subsequent rules is unselected. So in this case, the first rule, ARR_pilotSiteServers_loadbalance, will be considered first. This rule tries to match whether the client is using IE and has .NET 3.5 installed. If so, the requests are forwarded to the pilotSiteServers server farm. Since the Stop processing of subsequent rules checkbox is unchecked, it will process the second rule, ARR_productionSiteServers_loadbalance, which will route all remaining requests to the productionSiteServers server farm.

To change the URL rewrite rules using the command-line:

  1. Open a command prompt with administrator privileges.

  2. Navigate to %windir%\system32\inetsrv.

  3. To change the ARR_pilotSiteServers_loadbalance rule to check for IE and .NET 3.5 in HTTP_USER_AGENT, enter:

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /+"[name='ARR_pilotSiteServers_loadbalance'].conditions.[input='{HTTP_USER_AGENT}',pattern='*MSIE*']" /commit:apphost
    
    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /+"[name='ARR_pilotSiteServers_loadbalance'].conditions.[input='{HTTP_USER_AGENT}',pattern='*.NET CLR 3.5*']" /commit:apphost
    
  4. To unselect Stop processing of subsequent rules for ARR_pilotSiteServers_loadbalance, enter:

    appcmd.exe set config  -section:system.webServer/rewrite/globalRules /[name='ARR_pilotSiteServers_loadbalance'].stopProcessing:"False"  /commit:apphost
    

Summary

You have now successfully changed the rules in URL rewrite and leveraged Application Request Routing to route only a subset of your users to the pilot site. For additional Application Request Routing properties and capabilities, refer to other Application Request Routing walkthroughs.