<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Tips &amp; Tricks for ASP.NET, IIS, and Visual Web Developer : ARR</title><link>http://blogs.msdn.com/webdevelopertips/archive/tags/ARR/default.aspx</link><description>Tags: ARR</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Tip #36: Did you know... How to manage pilot or beta program for your site using Application Request Routing in IIS7.0?</title><link>http://blogs.msdn.com/webdevelopertips/archive/2008/12/22/tip-36-did-you-know-how-to-manage-pilot-or-beta-program-for-your-site-using-application-request-routing-in-iis7-0.aspx</link><pubDate>Mon, 22 Dec 2008 21:11:33 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9247655</guid><dc:creator>WebDevTools</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/webdevelopertips/comments/9247655.aspx</comments><wfw:commentRss>http://blogs.msdn.com/webdevelopertips/commentrss.aspx?PostID=9247655</wfw:commentRss><description>&lt;p&gt;Won't it be cool if you can target and route appropriate users of your site to your pilot/beta/new looking site based on user's profile. This may help you in managing select users who have previously signed for pilot program and redirect them to new looking web site and gather feedback. This is a very typical situation when your web site is evolving or going a major change. IIS7.0 Application Request Routing (ARR) module helps you achieve this. The other situation where this can help is to limit and manage the amount of traffic that is routed to pilot site. There can be numerous other scenarios like ones mentioned where ARR can assist but the focus of the tip will be to learn how to get this done through ARR. You can apply it to other related scenario too.&lt;/p&gt;  &lt;p&gt;Let's say for example we would like to redirect all users who have .NET Framework 3.5 installed and are using the browser Internet Explorer to the pilot site. For achieving this using ARR, follow the below steps:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Launch IIS Manager. &lt;/li&gt;    &lt;li&gt;Create a server farm named &amp;quot;&lt;strong&gt;pilotSiteServers&lt;/strong&gt;&amp;quot; using this &lt;a href="http://learn.iis.net/page.aspx/485/define-and-configure-an-application-request-routing-server-farm/" target="_blank"&gt;walkthrough&lt;/a&gt;. This server farm will represent the pilot/beta environment. &lt;/li&gt;    &lt;li&gt;Create another server farm named &amp;quot;&lt;strong&gt;productionSiteServers&lt;/strong&gt;&amp;quot; as above. This server farm will represent the production environment. &lt;/li&gt;    &lt;li&gt;Select the server farm &amp;quot;&lt;strong&gt;pilotSiteServers&amp;quot;. &lt;/strong&gt;The following icons will be shown: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/srv-farm.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="192" alt="srv-farm" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/srv-farm_thumb.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Double click on &amp;quot;&lt;strong&gt;Routing&lt;/strong&gt; &lt;strong&gt;Rules&lt;/strong&gt;&amp;quot;. &lt;/li&gt;    &lt;li&gt;Since this scenario involves multiple server farms with conditional matching of HTTP request headers, we will use URL Rewrite UI which exposes additional options. Click on &amp;quot;&lt;strong&gt;URL Rewrite&lt;/strong&gt;&amp;quot; under &amp;quot;&lt;strong&gt;Advanced Routing&lt;/strong&gt;&amp;quot;. &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/adv.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="61" alt="adv" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/adv_thumb.png" width="201" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;You will note that two rules are already there. &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/twoRules.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="113" alt="twoRules" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/twoRules_thumb.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;These rules has to be changed. The order of rule is important. I will explain it in a while. For now, if &lt;strong&gt;ARR_productionSiteServers_loadbalance&lt;/strong&gt; is above &lt;strong&gt;ARR_pilotSiteServers_loadbalance&lt;/strong&gt;, change the order of the rules by using &lt;strong&gt;Move Up&lt;/strong&gt; or &lt;strong&gt;Move Down&lt;/strong&gt; after selecting the rule. &lt;/li&gt;    &lt;li&gt;Select &lt;strong&gt;ARR_pilotSiteServers_loadbalance&lt;/strong&gt;, and then click &lt;strong&gt;Edit...&lt;/strong&gt; in the &lt;strong&gt;Actions&lt;/strong&gt; pane. &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/edit.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="504" alt="edit" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/edit_thumb.png" width="504" border="0" /&gt;&lt;/a&gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;We need to define conditions now. Remember our aim is to &amp;quot;redirect all users who have .NET Framework 3.5 installed and using the browser Internet Explorer to the pilot site&amp;quot; &lt;/li&gt;    &lt;li&gt;Click &lt;strong&gt;Add Conditions&lt;/strong&gt;, and then&lt;strong&gt; &lt;/strong&gt;click &lt;strong&gt;Add...&lt;/strong&gt;.       &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="289" alt="add" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add_thumb.png" width="454" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;Enter &lt;strong&gt;{HTTP_USER_AGENT}&lt;/strong&gt; as &lt;strong&gt;Condition input&lt;/strong&gt; and &lt;strong&gt;*MSIE*&lt;/strong&gt; as &lt;strong&gt;Pattern&lt;/strong&gt;.&amp;#160; This condition checks to see if the client is using IE.       &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="289" alt="add2" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add2_thumb.png" width="454" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;Add another condition to check for the .NET version.&amp;#160; Click &lt;strong&gt;Add...&lt;/strong&gt;, and then enter &lt;strong&gt;{HTTP_USER_AGENT}&lt;/strong&gt; as &lt;strong&gt;Condition input&lt;/strong&gt; and &lt;strong&gt;*.NET CLR 3.5*&lt;/strong&gt; as &lt;strong&gt;Pattern&lt;/strong&gt;.       &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add3.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="289" alt="add3" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add3_thumb.png" width="454" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;Finally, uncheck the &amp;quot;&lt;strong&gt;Stop processing of subsequent rules&amp;quot;&lt;/strong&gt; checkbox, and then click &amp;quot;&lt;strong&gt;Apply&amp;quot;&lt;/strong&gt; to save the changes.       &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add4.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="137" alt="add4" src="http://blogs.msdn.com/blogfiles/webdevelopertips/WindowsLiveWriter/Tip36Didyouknow...Howtomanagepilotorbe.0_F0D4/add4_thumb.png" width="454" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;   &lt;/li&gt;    &lt;li&gt;Now let me answer why the order of rules mattered. This is because URL rewrite processes the rules in order when &amp;quot;&lt;strong&gt;Stop processing of subsequent rules&amp;quot;&lt;/strong&gt; is unselected.&amp;#160; So in this case the first rule &lt;strong&gt;ARR_pilotSiteServers_loadbalance &lt;/strong&gt;will be considered first.&amp;#160; This rule tries to match whether the client is using IE and has .NET Framework 3.5 installed.&amp;#160; If so, the requests are forwarded to the &lt;strong&gt;pilotSiteServers&lt;/strong&gt; server farm.&amp;#160; Since the &amp;quot;&lt;strong&gt;Stop processing of subsequent rules&amp;quot;&lt;/strong&gt; checkbox is unchecked, it will also process the second rule. This means the rule &lt;strong&gt;ARR_productionSiteServers_loadbalance&lt;/strong&gt; will also get processed. This will route all other request to &lt;strong&gt;productionSiteServers&lt;/strong&gt; server farm. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;That's it, we are done. For details regarding pre-requisite and command line equivalent of the above URL Rewrite rules look &lt;a href="http://learn.iis.net/page.aspx/487/pilot-program-management-using-application-request-routing/" target="_blank"&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Don Raman      &lt;br /&gt;&lt;/strong&gt;SDET, &lt;a href="http://www.iis.net/"&gt;IIS Team&lt;/a&gt;&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9247655" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/webdevelopertips/archive/tags/IIS/default.aspx">IIS</category><category domain="http://blogs.msdn.com/webdevelopertips/archive/tags/URL+Rewrite/default.aspx">URL Rewrite</category><category domain="http://blogs.msdn.com/webdevelopertips/archive/tags/ARR/default.aspx">ARR</category></item></channel></rss>