The Mysterious ARR Server Farm to URL Rewrite link
Application Request Routing (ARR) is a reverse proxy plug-in for IIS7+ that does many things, including functioning as a load balancer. For this post, I’m assuming that you already have an understanding of ARR.
Today I wanted to find out how the mysterious link between ARR and URL Rewrite is maintained. Let me explain…
ARR is unique in that it doesn’t work by itself. It sits on top of IIS7 and uses URL Rewrite. As a result, ARR depends on URL Rewrite to ‘catch’ the traffic and redirect it to an ARR Server Farm.
As the last step of creating a new Server Farm, ARR will prompt you with the following:
If you accept the prompt, it will create a URL Rewrite rule for you. If you say ‘No’, then you’re on your own to create a URL Rewrite rule.
When you say ‘Yes’, the Server Farm’s checkbox for “Use URL Rewrite to inspect incoming requests” will be checked. See the following screenshot.
However, I’m not a fan of this auto-rule. The problem is that if I make any changes to the URL Rewrite rule, which I always do, and then make the wrong change in ARR, it will blow away my settings. So, I prefer to create my own rule and manage it myself.
Since I had some old rules that were managed by ARR, I wanted to update them so that they were no longer managed that way.
I took a look at a config in applicationHost.config to try to find out what property would bind the two together. I assumed that there would be a property on the ServerFarm called something like urlRewriteRuleName that would serve as the link between ARR and URL Rewrite. I found no such property.
After a bit of testing, I found that the name of the URL Rewrite rule is the only link between ARR and URL Rewrite. I wouldn’t have guessed. The URL Rewrite rule needs to be exactly ARR_{ServerFarm Name}_loadBalance, although it’s not case sensitive.
Consider the following auto-created URL Rewrite rule:
And, the link between ARR and URL Rewrite exists:
Now, as soon as I rename that to anything else, for example, site.com ARR Binding, the link between ARR and URL Rewrite is broken.
To be certain of the relationship, I renamed it back again and sure enough, the relationship was reestablished.
Why is this important? It’s only important if you want to decouple the relationship between ARR the URL Rewrite rule, but if you want to do so, the best way to do that is to rename the URL Rewrite rule. If you uncheck the “Use URL Rewrite to inspect incoming requests” checkbox, it will delete your rule for you without prompting.
Conclusion
The mysterious link between ARR and URL Rewrite only exists through the ARR Rule name. If you want to break the link, simply rename the URL Rewrite rule. It’s completely safe to do so, and, in my opinion, this is a rule that you should manage yourself anyway.