<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Chiranth's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/chiranth/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/chiranth/feed.xml</link>
    <description />
    <lastBuildDate>Mon, 26 Mar 2018 17:21:39 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>403.7 and 500 Client Certificate Authentication Errors-IIS</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/403-7-and-500-client-certificate-authentication-errors-iis</link>
      <pubDate>Thu, 14 Jul 2016 09:10:51 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/?p=435</guid>
      <description><![CDATA[During the course of my work i have observed that troubleshooting client certificate authentication...]]></description>
      <content:encoded><![CDATA[<p>During the course of my work i have observed that troubleshooting client certificate authentication seems bit challenging as there is not much tools to collect appropriate data for it. However i am correlating a list of check points which has always helped me.</p> <p>When you have enabled client certificate authentication either using AD client certificate authentication or IIS client certificate mapping authentication you can follow the below steps in general.</p> <p>The most common error or status code you would face with respect to client certificate authentication is 403.7 which means the server is expecting a client certificate but the client is not sending it.</p> <p>Follow the steps in order to check what the issue might be</p> <p>1) Make sure you have set Require for client certificate in SSL settings in IIS</p> <p>2) When using IIS client certificate mapping we either use one to one mapping where we map individual certificate to an user or many to one mapping where we map all the certificates matching a criteria to a single user. The one to one mapping or the many to one mapping should be created at the site level. The most common mistake, I have seen is if people want to use client certificate authentication to a specific application under a site, they create the mappings at the application level which is wrong. You will have to create the mappings at the site level and enable client certificate authentication at the required level. The mappings will only be read at the site level and any mapping at the application level will be ignored. This is not mentioned in most of the internet articles.</p> <p>3) On the client machine in IE make sure you go to Internet Options-&gt;Security-&gt;Intranet or Internet(Based on the type of site)-&gt;Miscellaneous-&gt;Don't prompt for client certificate when only one certificate is disabled. We need to make sure it is disabled so that at least we get to know if we get a prompt for certificate selection and if this fails out after clicking on certificate or without even sending a certificate.</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2016/07/image442.png"><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/07/image_thumb391.png" width="441" height="101"></a></p> <p>4) In the client machine, confirm that the client certificate has a private key. You can check this by going to mmc-&gt;Add or remove snapin-&gt;Certificates(My User Account)-&gt;Personal-&gt;Certificates and then select the client certificate which you have installed for authentication. If the certificate is proper then you should be able to see the private key as below. ALso you can run the below command to check the validity of the certificate</p> <p>certutil –verifystore my &lt;Thumbprint of the certificate&gt;</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2016/07/image443.png"><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/07/image_thumb392.png" width="306" height="286"></a></p> <p>5)&nbsp; Also go to details tab of the certificate and click on Enhanced Key usage where you should see that this certificate is intended for client certificate authentication which also validates the certificate to be a genuine client certificate.</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2016/07/image444.png"><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/07/image_thumb393.png" width="430" height="173"></a></p> <p>6) If you go to the Certification Path tab in the certificate, you will be able to see the certificate chain. Double Click on each certificate in the chain and make a note of it.</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2016/07/image445.png"><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/07/image_thumb394.png" width="652" height="262"></a></p> <p>7) In the certification path the certificate at the top is called the Root Certificate and the certificates in between the Root CA and the actual certificate in the chain are called Intermediate CA’s. In the above image there is a single intermediary CA but there can be more than one intermediary CA as well. In the server machine and as well as the client machine go to mmc-&gt;Add or Remove Snapin-&gt;Certificates Local Computer-&gt;Trusted Root Certification Authorities-&gt;Certificates, make sure the Root CA is present in this location. Next go to Intermediate Certification Authorities-&gt;Certificates and make sure the Intermediate CA’s are present there. This step is important because during SSL handshake when the server requests for the client certificate it sends the list of Trusted Issuer List which will contain the list of the Trusted Root CA’s installed on the server to the client and based on the that the client certificate to be sent is chosen.</p> <table cellspacing="0" cellpadding="2" width="652" border="1"> <tbody> <tr> <td valign="top" width="650"><strong>Note:</strong> By default as mentioned above the Trusted issuer list is sent along with the certificate request during SSL handshake but this behaviour changed from windows 2012 or IIS 8 and onwards. In IIS 8 and onwards by default we don’t send any Trusted Issuer list. If we don't send any Trusted Issuer List then the client has the freedom of selecting any client certificate in its store.</td></tr></tbody></table> <p>&nbsp;</p> <p>8) The feature of sending the CTL or trusted list can also be controlled by setting the below registry key which can be used from windows 2008 and onwards. If the value is set to 1 then the list is send and if the value is 0 then the list will not be sent. In windows 2012 and onwards the default value is 0 and in the lower versions the default value is 1 if the key is not present.</p> <table cellspacing="0" cellpadding="2" width="400" border="1"> <tbody> <tr> <td valign="top" width="400"> <p>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\SecurityProviders\SCHANNEL  <p>Value name: SendTrustedIssuerList<br>Value type: REG_DWORD<br>Value data: 0 (False) or 1(True)</p></td></tr></tbody></table> <p>&nbsp;</p> <p>9) There is one more thing you need to cross check if this is a windows 2012 (IIS 8) and higher machine. By default the CTL is off, if the CTL is on and if in the server mmc-&gt;Add or Remove Snapin-&gt;Certificates Local Computer-&gt;Trusted Root Certification Authorities-&gt;Certificates you have a non-self signed certificate then you might receive a 403.7 error as well. More details on the issue is logged in the below kb. The solution is to delete the non-self signed certificate from the Trusted Root Certification Authority</p> <p><a title="https://support.microsoft.com/en-in/kb/2802568" href="https://support.microsoft.com/en-in/kb/2802568">https://support.microsoft.com/en-in/kb/2802568</a></p> <table cellspacing="0" cellpadding="2" width="665" border="1"> <tbody> <tr> <td valign="top" width="663">Note: A self-signed certificate is a certificate where the issuer and issued to fields will be same. A root certificate authority will always have a self signed certificate and hence if there are non-self signed certificates in the Trusted Root Certificate Store then that certificate is not a valid Root CA.</td></tr></tbody></table> <p>&nbsp;</p> <p>10) Thanks to Daniel Stolt, i had missed out a point. If the client is a web application or a web service and you are sending the client certificate from the code then the additional thing you will have to check is if the identity of the client application has permissions on the machine key for the client certificate. There are 2 ways you can do it.</p> <p><strong>Method A</strong>: Go to mmc-&gt;Add or Remove Snapin-&gt;Certificates Local Computer or Current User-&gt;Personal-&gt;Certificates. Right Click on the correct client certificate-&gt;Manage Private Keys and give permissions to the identity or user under which the client application is running.</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2016/07/image473.png"><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/07/image_thumb420.png" width="336" height="408"></a></p> <p><strong>Method B</strong>: This is bit complicated but interesting method. In this method we find out the machine key linked with the client certificate and then give the proper permissions required.</p> <p>a. Download and install "find private key" application<br><a href="http://blog.rhysgoodwin.com/windows-admin/findprivatekey-exe-pre-compiled/">http://blog.rhysgoodwin.com/windows-admin/findprivatekey-exe-pre-compiled/</a></p> <p>b.&nbsp; Find the Thumbprint of the client certificate<br>Run -&gt; MMC -&gt; File-&gt; ADD or REMOVE SNAP IN-&gt;certificates-&gt; Local Computer or Current User-&gt;Ok<br>Expand Personal-&gt;Certificates-&gt;Choose the appropriate certificate and open it<br>In the certificate-&gt;details tab-&gt;Thumbprint-&gt;Copy it</p> <p>c. find the private key path for the certificate suing the thumbprint copied<br>Syntax:<br>FindprivateKey.exe My LocalMachine -t "THumbprint of the certificate"</p> <table cellspacing="0" cellpadding="2" width="676" border="1"> <tbody> <tr> <td valign="top" width="674"> <p>Example:<br>FindprivateKey.exe trustedPeople LocalMachine -t "46 96 43 58 73 0b e9 4c 89 6f 5b ee fb c2 d7 08 03 6e 28 0b"<br>C:\Temp&gt;FindprivateKey.exe My LocalMachine -t "46 96 43 58 73 0b e9 4c 89 6f 5b ee fb c2 d7 08 03 6e 28 0b"<br>Private key directory:<br>C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys<br>Private key file name:<br>7a1fb2a3cb309c7af2d6fe47e8394f24_032abc89-fbae-4ac1-aab5-6c22351edcee</p></td></tr></tbody></table> <p>&nbsp;</p> <p>d. Next, we need to provide permissions to application pool account to certificate</p> <p>syntax (account to use : app pool identity - in our case it is NetworkService):<br>icacls "private key file path" /grant "Account":R</p> <table cellspacing="0" cellpadding="2" width="589" border="1"> <tbody> <tr> <td valign="top" width="587"> <p>example:<br>icacls C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\7a1fb2a3cb309c7af2d6fe47e8394f24_032abc89-fbae-4ac1-aab5-6c22351edcee /grant "NT AUTHORITY\NetworkService":R</p></td></tr></tbody></table> <p>&nbsp;</p> <p>11) Also several times i have seen that 403.7 is just masking the actual error. On the client you get a 403.7 but there might be a different error before that. For this please check the logs. One common scenario i have seen is as below. We see a 500 just before the 403.7 error and this is visible in logs as below</p> <table cellspacing="0" cellpadding="2" width="672" border="1"> <tbody> <tr> <td valign="top" width="670">2015-09-06 15:46:29 W3SVC1 - GET / – 443 – 10.10.10.100 Mozilla/5.0+(compatible;+MSIE+10.0;+Windows+NT+6.1;+WOW64;+Trident/6.0) – - chiranth.com 500 0 64 0 </td></tr></tbody></table> <p>&nbsp;</p> <p>If we take Failed request traces for the 500 we see below</p> <table cellspacing="0" cellpadding="2" width="687" border="1"> <tbody> <tr> <td valign="top" width="685"> <p>MODULE_SET_RESPONSE_ERROR_STATUS<br>Warning ModuleName="IIS Web Core", Notification="BEGIN_REQUEST", HttpStatus="500", HttpReason="Internal Server Error", HttpSubStatus="0", ErrorCode="The I/O operation has been aborted because of either a thread exit or an application request.<br> (0x800703e3)", ConfigExceptionInfo=""&nbsp; </p></td></tr></tbody></table>   <p>In this scenario normally you would have got a prompt for the certificate in IE but you end you getting 403.7 still in the end because the certificate was not read completely. Normally when we just set certificate to Require in SSL settings, the client certificate negotiation happens in later part of the request. To avoid the above error we have to enable clientcertificatenegotiation so that the negotiation happens during ssl handshake during the server hello is sent. To enable client cert negotiation you can follow the below blog</p> <p><a title="http://blogs.iis.net/rickbarber/require-client-certificates-in-iis-7-5" href="http://blogs.iis.net/rickbarber/require-client-certificates-in-iis-7-5">http://blogs.iis.net/rickbarber/require-client-certificates-in-iis-7-5</a></p> <p>The blog talks on how to enable by deleting and recreating the bindings from command prompt. There is also a hack which we can follow as below.</p> <p>For example if you have a SSL binding for IP: PORT 10.10.10.10:443 then traverse to the registry path <strong>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\HTTP\Parameters\SslBindingInfo\10.10.10.10:443</strong></p> <p>Create a DWORD called <strong>DefaultFlags</strong> and set the value to 2. The commands mentioned in the blog also does the same</p> <p>The above changes require a machine reboot to take effect.</p> <p>12) The above steps sums up the configuration part from the client and server perspective. But i have seen 403.7 error pop because of network issues as well. I have seen the issue happen If there is some intermediary device or firewall or proxy which doesn’t support client certificate authentication or negotiation. If we have set clientcertificatenegotitation as above then we will be able to see the client certificate request in the earlier stage of the handshake itself as below</p> <table cellspacing="0" cellpadding="2" width="400" border="1"> <tbody> <tr> <td valign="top" width="400"><a href="https://msdnshared.blob.core.windows.net/media/2016/07/image447.png"><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/07/image_thumb396.png" width="1045" height="395"></a></td></tr></tbody></table> <p>&nbsp;</p> <p>if we don’t have <strong>clientcertificatenegotiation</strong> then we might not be able to see the certificate request(Server Hello) in the handshake as it might happen later and it will be encrypted.</p> <p>If you have the setting enabled and you still don’t see the client certificate request and see something like below then this is a possible issue with a network device</p> <p><a href="https://msdnshared.blob.core.windows.net/media/2016/07/image458.png"><img title="image" style="border-top: 0px;border-right: 0px;border-bottom: 0px;padding-top: 0px;padding-left: 0px;border-left: 0px;padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/2016/07/image_thumb407.png" width="1041" height="298"></a></p> <p>As one more final step you can also try enabling SCHANNEL logging. Steps are in the below link</p> <p><a title="https://blogs.msdn.microsoft.com/chiranth/2014/02/18/ssl-troubleshooting-troubleshooting-steps-for-server-side-ssl-problems/" href="https://blogs.msdn.microsoft.com/chiranth/2014/02/18/ssl-troubleshooting-troubleshooting-steps-for-server-side-ssl-problems/">https://blogs.msdn.microsoft.com/chiranth/2014/02/18/ssl-troubleshooting-troubleshooting-steps-for-server-side-ssl-problems/</a></p> <table cellspacing="0" cellpadding="2" width="774" border="1"> <tbody> <tr> <td valign="top" width="772">Note: If you are enabling client certificate authentication for a WCF service then by design along with client certificate authentication you also need anonymous authentication enabled<br><a title="https://blogs.msdn.microsoft.com/dsnotes/2012/11/23/wcf-transport-layer-security-with-client-certificates/" href="https://blogs.msdn.microsoft.com/dsnotes/2012/11/23/wcf-transport-layer-security-with-client-certificates/">https://blogs.msdn.microsoft.com/dsnotes/2012/11/23/wcf-transport-layer-security-with-client-certificates/</a></td></tr></tbody></table> <p>Hope this helps <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none;border-bottom-style: none;border-right-style: none;border-left-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/2016/07/wlEmoticon-smile4.png"></p>]]></content:encoded>
    </item>
    <item>
      <title>Data Collection for aspnet_isapi.dll reported itself as unhealthy for the following reason: 'Deadlock detected'</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/data-collection-for-aspnet_isapi-dll-reported-itself-as-unhealthy-for-the-following-reason-deadlock-detected</link>
      <pubDate>Tue, 05 Apr 2016 13:31:43 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/?p=322</guid>
      <description><![CDATA[We might have come across the deadlock detected error for a IIS hosted web application. When the...]]></description>
      <content:encoded><![CDATA[<p>We might have come across the deadlock detected error for a IIS hosted web application. When the issue happens it gets automatically fixed as IIS will recycle the w3wp process once the error happens. So the data collection over here has to be automated some or the other way. Below are some of the deadlock detected entries that we might see.</p> <p>1) ISAPI 'C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'. <p>2) ISAPI’C:\Windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll’ reported itself as unhealthy for the following reason: ‘Deadlock detected’” <p>3) Description: ISAPI 'C:\Windows\system32\inetsrv\asp.dll' reported itself as unhealthy for the following reason: 'ASP unhealthy because 100% of executing requests are hung and 0% of the request queue is full.' <p>In the below blog or link i have discussed as to why we see this error and what are the steps we need to follow to automate the data collection in case we see this issue to find out the root cause. <p><a title="https://blogs.msdn.microsoft.com/webtopics/2016/04/05/data-collection-for-deadlock-detected-issue-of-a-iis-based-web-application/" href="https://blogs.msdn.microsoft.com/webtopics/2016/04/05/data-collection-for-deadlock-detected-issue-of-a-iis-based-web-application/">https://blogs.msdn.microsoft.com/webtopics/2016/04/05/data-collection-for-deadlock-detected-issue-of-a-iis-based-web-application/</a> <p>&nbsp; <p>Hope this helps <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none;border-bottom-style: none;border-right-style: none;border-left-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/2016/04/wlEmoticon-smile5.png"></p>]]></content:encoded>
    </item>
    <item>
      <title>Keyset does not exist ( exception from HRESULT : 0x8009000D) or or 0x80090016 or 0x80090005 while changing Application Pool Identity in IIS</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/keyset-does-not-exist-exception-from-hresult-0x8009000d-while-changing-application-pool-identity-in-iis</link>
      <pubDate>Mon, 29 Feb 2016 07:49:40 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2016/02/29/keyset-does-not-exist-exception-from-hresult-0x8009000d-while-changing-application-pool-identity-in-iis/</guid>
      <description><![CDATA[I have seen lots of people running into this specific issue in IIS 7+ and versions When we try to...]]></description>
      <content:encoded><![CDATA[<p><font face="Times New Roman">I have seen lots of people running into this specific issue in IIS 7+ and versions</font></p> <p><font face="Times New Roman">When we try to change the application pool identity of an application pool to a domain account we get the below error while committing the changes.</font></p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="601"> <p><font face="Consolas">There was an error while performing this operation.</font></p> <p><font face="Consolas">Details:</font></p> <p><font face="Consolas">Keyset does not exist ( exception from HRESULT : 0x8009000D)</font></p></td></tr></tbody></table> <p>&nbsp; <p>The error code might change accordingly but you will get the text as keyset does not exist while trying to update the application pool identity with a custom account or while trying to specify a connect as user in the basic settings of a site.  <p>You might also get the below error codes <p><strong><font style="background-color: #ffff00">0x80090016</font></strong>  <p><strong><font style="background-color: #ffff00">0x80090005</font></strong> <p><font face="Times New Roman"><strong><u>Why am I seeing this issue?</u></strong></font></p> <p><font face="Times New Roman">This issue happens when your IIS specific machine keys are corrupt or missing.</font></p> <p><font face="Times New Roman">Your machine keys might go corrupt if there was an improper shutdown of the machine or the machine was cloned from an existing image or if there was a system crash.</font></p> <p><font face="Times New Roman">Its always a good idea to have a backup of the machine keys.</font></p> <p><font face="Times New Roman">Before I explain in detail what goes wrong internally first lets discuss about the different machine keys required in IIS for encryption. The location of the key depends on the operating system is basically C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys from windows 2008 R2 and onwards</font></p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="601"> <p><font face="Consolas">6de9cb26d2b98c01ec4e9e8b34824aa2_GUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iisConfigurationKey</font></p> <p><font face="Consolas">d6d986f09a1ee04e24c949879fdb506c_GUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NetFrameworkConfigurationKey</font></p> <p><font face="Consolas">76944fb33636aeddb9590521c2e8815a_GUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iisWasKey</font></p></td></tr></tbody></table> <p><font face="Times New Roman">The above 3 keys are used by IIS 7 and higher versions for encryption of the configuration.</font></p> <p><font face="Times New Roman">The pertaining configuration info having information about these keys in IIS config looks something like below and will be present in C:\Windows\System32\inetsrv\config\applicationHost.config</font></p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="601"> <p><font face="Consolas">&lt;configProtectedData&gt;</font></p> <p><font face="Consolas">&lt;providers&gt;</font></p> <p><font face="Consolas">&lt;add name="IISWASOnlyRsaProvider" type="" description="Uses RsaCryptoServiceProvider to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useMachineContainer="true" useOAEP="false" /&gt;</font></p> <p><font face="Consolas">&lt;add name="AesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisConfigurationKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="value" /&gt;</font></p> <p><font face="Consolas">&lt;add name="IISWASOnlyAesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="value " /&gt;</font></p> <p><font face="Consolas">&lt;/providers&gt;</font></p> <p><font face="Consolas">&lt;/configProtectedData&gt;</font></p></td></tr></tbody></table> <p><font face="Times New Roman">IIS 6.0 uses a particular key c2319c42033a5ca7f44e731bfd3fa2b5_GUID to do the encryption. If you are seeing IIS admin service start up issue on an IIS 7 machine or IIS 6 machine, first thing we would check is if the metabase.xml is corrupted or if c2319c42033a5ca7f44e731bfd3fa2b5_GUID is corrupted.</font></p> <p><font face="Times New Roman">In IIS any sensitive data like passwords won’t be stored in plain text and will have to be encrypted before it is stored in the config and get decrypted accordingly when needed.</font></p> <p><font face="Times New Roman">So in case if the above machine keys are corrupted the configuration in IIS and the keys go out of sync and any encryption or decryption task will start failing. That is the reason you might see the above error while changing the application pool identity to a domain or custom account. If you change the application pool identity to an account like local system or network service or service accounts which doesn’t need password and hence no encryption the task won’t fail. </font></p> <p><font face="Times New Roman">To confirm that this is the issue with machine key corruption you can try changing connect-as account for any website or virtual directory in IIS to a custom account and you will see the same error.</font></p> <p><font face="Times New Roman">How to fix the issue?</font></p> <p><font face="Times New Roman">Most of the times we suggest to rebuild or reinstall IIS. But what if reinstalling IIS is not an option?</font></p> <p><font face="Times New Roman">Let’s see if there is something else we can do before we end up reinstalling IIS.</font></p> <p><font face="Times New Roman">Before you proceed with the below steps it’s better to take backup of the IIS configuration so that you need not configure everything from the scratch in case you have to reinstall IIS.</font></p> <p><font face="Times New Roman">To take backup of the IIS configuration install msdeploy from </font><a href="http://www.iis.net/downloads/microsoft/web-deploy"><font face="Times New Roman">http://www.iis.net/downloads/microsoft/web-deploy</font></a></p> <p><font face="Times New Roman">Once you install web deploy and reopen the inetmgr console you will see the option to export a server package and the root node as below.</font></p> <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1856.clip_image002_47A0FF86.jpg"><font face="Times New Roman"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3276.clip_image002_24DFC7C9.jpg"><img title="clip_image002" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1121.clip_image002_thumb_6616BAC5.jpg" width="739" height="163"></a></font></a></p> <p><font face="Times New Roman">Click on Export server package.</font></p> <p><font face="Times New Roman">You would want to encrypt the configuration with your own password. To do that Click on Advanced Settings.</font></p> <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4617.clip_image004_6D2D0D98.jpg"><font face="Times New Roman"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8407.clip_image004_5EF12559.jpg"><img title="clip_image004" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8311.clip_image004_thumb_30A31A02.jpg" width="492" height="290"></a></font></a></p> <p><font face="Times New Roman">Enter the encryption password. You would want to remember this password while importing the package.</font></p> <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8867.clip_image005_50B53D1A.png"><font face="Times New Roman"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1007.clip_image005_124F7967.png"><img title="clip_image005" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3731.clip_image005_thumb_6B20AA87.png" width="538" height="289"></a></font></a></p> <p><font face="Times New Roman">Click on Ok and Next.</font></p> <p><font face="Times New Roman">Save the package or zip file which you can use to import later if needed</font></p> <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5241.clip_image007_44B5DD97.jpg"><font face="Times New Roman"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0474.clip_image007_7ABA5CA4.jpg"><img title="clip_image007" style="border-left-width: 0px;border-right-width: 0px;border-bottom-width: 0px;padding-top: 0px;padding-left: 0px;padding-right: 0px;border-top-width: 0px" border="0" alt="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6036.clip_image007_thumb_0BCA04DE.jpg" width="521" height="394"></a></font></a></p> <p><font face="Times New Roman">To import the package you will have to follow similar steps by clicking on Import package at the root node of IIS and then entering the encryption password.</font></p> <p><font face="Times New Roman"><strong><u>How to work around the machine key corruption?</u></strong></font></p> <p><font face="Times New Roman">So enough of why and Now coming back to the main issue as to how we can fix the machine key corruption and the below errors.</font></p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="601"> <p><font face="Consolas">There was an error while performing this operation.</font></p> <p><font face="Consolas">Details:</font></p> <p><font face="Consolas">Keyset does not exist ( exception from HRESULT : 0x8009000D)</font></p></td></tr></tbody></table> <p><font face="Times New Roman">We can regenerate these machine keys without reinstalling IIS completely. To do that follow the below steps.</font></p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="601"> <p><font face="Consolas">1) Rename the below files or move it to a different location from C:\ProgramData\Microsoft\Crypto\RSA\MachineKeys\</font></p> <p><font face="Consolas">6de9cb26d2b98c01ec4e9e8b34824aa2_GUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iisConfigurationKey</font></p> <p><font face="Consolas">d6d986f09a1ee04e24c949879fdb506c_GUID&nbsp;&nbsp; NetFrameworkConfigurationKey</font></p> <p><font face="Consolas">76944fb33636aeddb9590521c2e8815a_GUID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; iisWasKey</font></p> <p><font face="Consolas">2) Backup applicationhost.config, then delete everything inside the tags below in applicationhost.config. Delete the contents within &lt;configProtectedData&gt; or &lt;providers&gt;. <br>&lt;configProtectedData&gt; <br>&lt;providers&gt; <br>... <br>&lt;/providers&gt; <br>&lt;/configProtectedData&gt;</font></p> <p><font face="Consolas">3) Open a command prompt in admin mode and run the below command</font></p> <p><font face="Consolas">"%windir%\system32\inetsrv\iissetup.exe /install SharedLibraries"</font></p></td></tr></tbody></table> <p><font face="Times New Roman">The above steps should regenerate the machine keys and also the configprotecteddata section in applicationhost.config</font></p> <p><font face="Times New Roman">If this doesn’t help I guess I think most preferable option would be to reinstall IIS to fix the corruption.</font></p> <p><font face="Times New Roman">Hope this helps J</font></p> <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:7a021c0a-f05a-43f0-910b-7bffd6d69517" class="wlWriterSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px">Technorati Tags: <a href="http://technorati.com/tags/IIS" rel="tag">IIS</a>,<a href="http://technorati.com/tags/Keyset+does+not+exist" rel="tag">Keyset does not exist</a>,<a href="http://technorati.com/tags/0x8009000D" rel="tag">0x8009000D</a>,<a href="http://technorati.com/tags/application+pool" rel="tag">application pool</a>,<a href="http://technorati.com/tags/domain+account" rel="tag">domain account</a></div>]]></content:encoded>
    </item>
    <item>
      <title>Troubleshooting Windows Azure Pack Portal issues and data collection</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/troubleshooting-windows-azure-pack-portal-issues-and-data-collection</link>
      <pubDate>Wed, 23 Dec 2015 05:17:35 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2015/12/23/troubleshooting-windows-azure-pack-portal-issues-and-data-collection/</guid>
      <description><![CDATA[&#160;  Most common issues I have seen I&#160; Windows Azure pack is the admin and tenant portal...]]></description>
      <content:encoded><![CDATA[<p>&#160;</p>  <p>Most common issues I have seen I&#160; Windows Azure pack is the admin and tenant portal errors. When we see any runtime errors in the portals. Either the error might be because of configuration within the Admin/Tenant Site or it might be because the Admin API/Tenant API is throwing an error when a call is being made to them.</p>  <p><strong><u>Things to Check:</u></strong></p>  <p> First thing we do is check the event logs to see if there any errors in Application and Services Logs-&gt;Microsoft-&gt;Windows Azure Pack and check the logs for Admin/Tenant Site and the Admin/Tenant API sites. Most of the times this gives us insight on what might be happening</p>  <p>Second thing we do is we want to identify if the issue is in API or the site itself. To isolate this normally we want to keep a track of all the calls going from the site to the API internally. To keep a track of the out going calls we can actually hook fiddler to the admin site or tenant site.</p>  <p><strong><u>Steps to capture fiddler for outgoing calls.</u></strong></p>  <p>There are two methods we can use to achieve this. but there are some steps common to both.</p>  <p><strong><u>Common Steps:</u></strong></p>  <p>1. This is the most common method used. you can download and install Fiddler from <a title="http://www.telerik.com/download/fiddler" href="http://www.telerik.com/download/fiddler">http://www.telerik.com/download/fiddler</a></p>  <p>2. Before you start capturing the requests you need to make sure that fiddler is able to decrypt the https traffic.</p>  <p>3. To be able to decrypt the https traffic in fiddler start fiddler and go to Tools-&gt;Fiddler Options and make sure highlighted check boxes are selected. When prompted to install the fiddler certificate click on Yes.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8078.image_1F95878A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8078.image_5F00_1F95878A.png"><img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1882.image_thumb_699EE954.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/1882.image_5F00_thumb_5F00_699EE954.png" width="581" height="329" /></a></p>  <p><strong><u>Method 1:</u></strong></p>  <p>1. Here you can fiddler as a proxy in the site web.config. But as we know that we cant make any changes directly to the WAP sites config as it is encrypted.</p>  <p>2. So before adding fiddler as a proxy, you need to decrypt the config by running below commands in the WAP PowerShell command let as below.</p>  <p>To decrypt the configuration of Admin Site</p>  <table cellspacing="0" cellpadding="2" width="400" border="0"><tbody>     <tr>       <td valign="top" width="400"><font face="Courier New">Unprotect-MgmtSvcConfiguration -Namespace &quot;AdminSite&quot;</font></td>     </tr>   </tbody></table>  <p>To decrypt the configuration of Tenant Site</p>  <table cellspacing="0" cellpadding="2" width="400" border="0"><tbody>     <tr>       <td valign="top" width="400"><font face="Courier New">Unprotect-MgmtSvcConfiguration -Namespace &quot;TenantSite&quot;</font></td>     </tr>   </tbody></table>    <p>Reference: <a title="https://technet.microsoft.com/en-us/library/dn520996%28v=sc.20%29.aspx?f=255&amp;MSPPError=-2147217396" href="https://technet.microsoft.com/en-us/library/dn520996%28v=sc.20%29.aspx?f=255&amp;MSPPError=-2147217396">https://technet.microsoft.com/en-us/library/dn520996%28v=sc.20%29.aspx?f=255&amp;MSPPError=-2147217396</a></p>  <p>3. Take a backup of your original web.config before proceeding with any changes. Once you are done decrypting the web.config file, you can add the below entries in your web.config and make sure fiddler is running.</p>  <table cellspacing="0" cellpadding="2" width="400" border="0"><tbody>     <tr>       <td valign="top" width="400">         <p><font face="Courier New">&lt;system.net&gt;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;defaultProxy&gt;              <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;proxy proxyaddress=&quot;</font><a href="http://localhost:8888&quot;"><font face="Courier New">http://localhost:8888&quot;</font></a><font face="Courier New"> /&gt;             <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160; &lt;/defaultProxy&gt;              <br />&#160;&#160;&#160; &lt;/system.net&gt;              <br />&lt;/configuration&gt;</font></p>       </td>     </tr>   </tbody></table>  <p>4. Now fiddler will start listening to traffic going outside of Admin Site/Tenant Site</p>  <p>5. After you are done capturing the data, revert the changes and encrypt the web.config again by running the below PowerShell command lets.</p>  <p>To encrypt the configuration of Admin Site</p>  <table cellspacing="0" cellpadding="2" width="400" border="0"><tbody>     <tr>       <td valign="top" width="400"><font face="Courier New">Protect-MgmtSvcConfiguration -Namespace &quot;AdminSite&quot;</font></td>     </tr>   </tbody></table>  <p>To encrypt the configuration of Tenant Site</p>  <table cellspacing="0" cellpadding="2" width="400" border="0"><tbody>     <tr>       <td valign="top" width="400"><font face="Courier New">Protect-MgmtSvcConfiguration -Namespace &quot;TenantSite&quot;</font></td>     </tr>   </tbody></table>  <p>I personally prefer method 2 as method 1 is a little tedious.</p>  <p><strong><u>Method 2:</u></strong></p>  <p>1. Create a file named setproxy.aspx page within admin site/ tenant site physical folder location depending for which site you want to capture the traffic.</p>  <p>2. Copy the below snippet to your setproxy.aspx page</p>  <table cellspacing="0" cellpadding="2" width="400" border="0"><tbody>     <tr>       <td valign="top" width="400">         <p><font face="Courier New">&lt;%@ Import Namespace=&quot;System.IO&quot; %&gt;             <br />&lt;%@ Import Namespace=&quot;System.Text&quot; %&gt;              <br />&lt;%@ Import Namespace=&quot;System&quot; %&gt;              <br />&lt;%@ Import Namespace=&quot;System.Net&quot; %&gt;</font></p>          <p><font face="Courier New">&lt;script language=&quot;C#&quot; runat=server&gt;             <br />public void Page_Load(Object sender, EventArgs E)              <br />{              <br /> //sample that makes httpwebrequest call to a URL.              <br /> //it then returns the data to the client and uses the same content-type header.              <br /> //You can change the URL to test different sites</font></p>          <p><font face="Courier New">&#160;&#160;&#160; System.Net.WebRequest.DefaultWebProxy = new WebProxy(&quot;</font><a href="http://127.0.0.1:8888&quot;"><font face="Courier New">http://127.0.0.1:8888&quot;</font></a><font face="Courier New">, false);             <br /> Response.Write(&quot;Set Proxy already&quot;);              <br />}              <br />&lt;/script&gt;</font> </p>       </td>     </tr>   </tbody></table>  <p>3. Make sure fiddler is running and now browse the setproxy.aspx page. Now fiddler will be automatically attached to your process and will keep listening to the outgoing requests.</p>  <p>4. To revert the changes and stop fiddler from listening to your requests is very simple, you just need to recycle the application pool for the site and to enable it again just browse the page.</p>  <p>Hope this helps <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-bottom-style: none; border-right-style: none; border-left-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6874.wlEmoticon-smile_3B9D5CD0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/6874.wlEmoticon_2D00_smile_5F00_3B9D5CD0.png" /></p>  <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dcd2a83f-ad43-45f9-8e53-b60d72337e36" class="wlWriterEditableSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">Technorati Tags: <a href="http://technorati.com/tags/Windows+Azure+pack" rel="tag">Windows Azure pack</a>,<a href="http://technorati.com/tags/Admin+Site" rel="tag">Admin Site</a>,<a href="http://technorati.com/tags/tenant+Site" rel="tag">tenant Site</a>,<a href="http://technorati.com/tags/Fiddler" rel="tag">Fiddler</a>,<a href="http://technorati.com/tags/Portal+Error" rel="tag">Portal Error</a></div>]]></content:encoded>
    </item>
    <item>
      <title>Slow Response Automated Data Collection using FREB and debug diag</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/slow-response-automated-data-collection-using-freb-and-debug-diag</link>
      <pubDate>Tue, 22 Dec 2015 02:12:39 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2015/12/22/slow-response-automated-data-collection-using-freb-and-debug-diag/</guid>
      <description><![CDATA[Recently I have come across many situations where we observe slowness and it is a challenge to...]]></description>
      <content:encoded><![CDATA[<p>Recently I have come across many situations where we observe slowness and it is a challenge to collect the right data at the right time either because no one is available when the issue is happening to collect the data or issue is very intermittent.</p> <p>The normal way we actually follow is as below.</p> <p>1. Open the Debug Diagnostic tool.</p> <p>2. Go to the Processes tab, right-click the worker process corresponding to the right application pool and select “Create Full Userdump”.</p> <p>3. Repeat Step 2. Three times with a gap of 5-10 seconds in between and collect 3 sets of dumps for us.</p> <p>But the above plan always doesn’t work if the issue is very intermittent and resolves on its own.</p> <p>Another way to automate the collection as specified in the below blog.</p> <p><a href="http://blogs.msdn.com/b/benjaminperkins/archive/2013/12/02/using-procdump-and-failed-request-tracing-to-capture-a-memory-dump.aspx">http://blogs.msdn.com/b/benjaminperkins/archive/2013/12/02/using-procdump-and-failed-request-tracing-to-capture-a-memory-dump.aspx</a></p> <p><a href="http://blogs.msdn.com/b/webtopics/archive/2009/08/04/iis7-and-above-using-freb-to-capture-dumps-for-a-long-running-request.aspx">http://blogs.msdn.com/b/webtopics/archive/2009/08/04/iis7-and-above-using-freb-to-capture-dumps-for-a-long-running-request.aspx</a></p> <p>Over here I will be discussing how we can automate this collection to capture multiple dumps in a different way.</p> <p><b><u>Note</u></b>: Test all the below rules in your QA and testing server before porting the changes to your production box.</p> <p><b><u>Create Freb rule:</u></b></p> <p>1. Go to intemgr.exe, click on the site or application for which you are experiencing slowness or hang and go to Failed Request Tracing rules.</p> <p>2. Click on Add rule and follow the below steps.</p> <p>a. Select “All content” and click next. If we know that this is for a specific page, we can mention the page name as well by selecting Custom.</p> <p>b. Select Time-Taken in seconds option and specify the time (if the page is taking around 30 seconds, you can specify 10 or 15 so that we start capturing the freb and dumps 15 seconds past execution till the end). Click Next</p> <p>c. Click Finish</p> <p>3. On the right hand pane at the site level under Configure go to Failed Request Tracing and enable it. You can configure it to the required location or leave it to the default.</p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="601"> <p><b><u>Note</u></b>: Please make sure that we only have the Slowness rule in Failed Request tracing for the specific application or web site or application pool for which we are going to configure Debug Diag rule.(Having multiple rules might make debug diag capture irrelevant data)</p></td></tr></tbody></table> <p><b><u>Steps to Create Debug Diag Rule:</u></b></p> <p>1. We will use Debug Diagnostic 2.0 update 2 version to troubleshoot this issue further. Please install the Debug Diagnostic 2.0 update 2 tool from <a href="https://www.microsoft.com/en-us/download/details.aspx?id=49924">https://www.microsoft.com/en-us/download/details.aspx?id=49924</a> (Please un-install all other versions of Debug Diagnostic tool before installing the latest version)</p> <p>2. Before proceeding with the rule creation we need to download the symbols needed for the automated rule creation. Take the below steps to download the symbols for your w3wp process.</p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="697"> <p>a. Download <b>PDBDownloader.exe </b>from <a href="https://github.com/rajkumar-rangaraj/PDB-Downloader/releases">https://github.com/rajkumar-rangaraj/PDB-Downloader/releases</a></p> <p>b. Run the PDBDownloader.exe and click on open files</p> <p>c. If this is a 64 bit application/process then navigate to the path <b>C:\Windows\System32\inetsrv\</b> and select<b> iisfreb.dll</b>. Click on Start</p> <p>d. If this is a 32 bit application/process then navigate to the path <b>C:\Windows\SysWow64\inetsrv\</b> and select <b>iisfreb.dll</b>. Click on Start</p> <p>e. The tool will download the public symbols of iisfreb.dll and copy this to <b>C:\Symbols</b> folder and we are good to proceed with the rule creation</p></td></tr></tbody></table> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="697"> <p><strong><u>Note:</u></strong> Debug Diag 2.0 Update 2 uses the symbol folder as C:\Symbols. Debug Diag 1.2 or Debug Diag 2.0 Update 1 uses the symbol folder as C:\symcache. If you have <b>Debug </b><b>Diag 1.2 </b>or <b>Debug Diag 2.0 Update 1</b> then change the file location in PDBDownloader.exe to <b>C:\symcache</b>. If folder does not exist please create it.</p></td></tr></tbody></table> <table cellspacing="0" cellpadding="2" width="606" border="1"> <tbody> <tr> <td valign="top" width="604"><b><u>Note</u></b>: The executable requires internet connection to download the symbols. If you don’t have internet connection on the server, then copy the <b>C:\Windows\System32\inetsrv\iisfreb.dll</b> to the machine which has internet connection and run the tool over there. Once you have the symbols downloaded, copy PDB file to the server’s symbol folder. In case of Debug Diag 1.2 or Debug Diag 2.0 Update 1<b> </b>copy it to <b>C:\Symcache</b>, else use <b>C:\Symbols</b></td></tr></tbody></table> <p>3. Create a Crash Rule in Debug Diagnostic 2.0 with the following steps:</p> <p>v Open Debug Diag (Start -&gt; Programs -&gt; Debug Diagnostic Tool 1.2)</p> <p>v Select "Crash" and click Next</p> <p>v Choose the option “A specific IIS application pool” and click next and choose the application pool that is crashing from the list and click next. (Note: The Application pool list may be empty if the IIS 6 Metabase Compatibility is not installed. In such a case you can always type the name of the application pool and click Next)</p> <p>v Click Next in Advanced Configuration (Optional), click on Breakpoints and then click on Add Breakpoint</p> <p>v Add <strong>iisfreb!FREB_LOG_FILE_MANAGER::WriteLogFile</strong> and change the Action Type to Custom and add the below script in the script window and click on Ok.</p> <p>&nbsp;</p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="567"> <p>Dim StartTimer</p> <p>&nbsp;</p> <p>CONST interval=2</p> <p>&nbsp;</p> <p>CONST DumpCount=5</p> <p>For i=1 to DumpCount Step 1</p> <p>CreateDump Breakpoint.OffsetExpression, false</p> <p>DbgState("BP_iisfreb!FREB_LOG_FILE_MANAGER::WriteLogFile_ACTION_COUNT") = DbgState("BP_iisfreb!FREB_LOG_FILE_MANAGER::WriteLogFile_ACTION_COUNT") + 1</p> <p>If DbgState("BP_iisfreb!FREB_LOG_FILE_MANAGER::WriteLogFile_ACTION_COUNT") &gt;= 5 Then</p> <p>WriteToLog "Action limit of 5 reached for breakpoint iisfreb!FREB_LOG_FILE_MANAGER::WriteLogFile."</p> <p>End If</p> <p>StartTimer=Timer</p> <p>Do While Timer-StartTimer &lt; interval+0.1</p> <p>Loop</p> <p>Next</p> <p>Exit Sub</p></td></tr></tbody></table> <p>v Set Action Limit to 5 and click on Ok.</p> <p>v Click on Save and Close</p> <p>v Click Next. Here you can set your "Rule Name" and also the "User dump Location" can be changed here.</p> <p>v Select "Activate the rule now" and click Finish</p> <p>v Notice the Status is Active. The User dump Count will increase each time a dump file is created.</p> <p>v Wait for the issue to happen.</p> <table cellspacing="0" cellpadding="2" width="573" border="1"> <tbody> <tr> <td valign="top" width="571"> <p>Note: In the above script</p> <p>'Enter the time interval gap you want the dumps to be generated between in seconds</p> <p>CONST interval=2</p> <p>'Number of Dumps you want to get within the specified interval</p> <p>CONST DumpCount=5</p></td></tr></tbody></table> <p><b><u>Once the issue occurs</u></b></p> <p>1. The user dump count field in the Crash Rule will increment whenever the tool generates a dump. The dump will be generated in the User Dump Path</p> <p>2. You can also analyze the Dump by selecting the Debug Diag Analysis tool and clicking Add Data Files. When the .dmp is added, select the Crash/Hang Analyzers script and click Start Analysis. When finished, a report (.mht) will be created in <i>C:\Program Files\DebugDiag\Reports</i> and displayed in Internet Explorer with the results and recommendations. If using custom DLL’s, the Symbol path (Tools menu -&gt; Options and Settings -&gt; Symbol Search Path) to the custom PDB files can be added.</p>]]></content:encoded>
    </item>
    <item>
      <title>Session Loss due to Application Domain Recycle-Advanced</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/session-loss-due-to-application-domain-recycle-advanced</link>
      <pubDate>Mon, 14 Dec 2015 06:33:06 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2015/12/14/session-loss-due-to-application-domain-recycle-advanced/</guid>
      <description><![CDATA[In the previous blog we were discussing about the basics of app domain recycling and the steps we...]]></description>
      <content:encoded><![CDATA[<p>In the previous blog we were discussing about the basics of app domain recycling and the steps we can take to confirm if app domain recycling is happening. We might come across a situation where from the steps explained previously we will come to know that app domain recycling is happening but we are not sure what triggered the app domain recycling. In this blogs we will discuss about the advanced debugging techniques to identify that.</p>  <p>Below are some of the data that we need to collect.</p>  <p><b><u>Steps to collect Procmon:</u></b></p>  <p>1. Download process monitor from <a href="https://technet.microsoft.com/en-us/library/bb896645.aspx">https://technet.microsoft.com/en-us/library/bb896645.aspx</a></p>  <p>2. Run procmon.exe </p>  <p>3. Wait till the issue reoccurs and after the issue reoccurrence please stop the trace.    <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p><b><u>Note</u></b>: Process monitor collects all the system level events and a lot of data. Even though this is a very good trace, if the issue you are facing is very intermittent avoid going for procmon data collection as this might consume more space and cause disk space issues.</p>         </td>       </tr>     </tbody></table> </p>  <p><b><u>Steps to Create Debug Diag Rule:</u></b></p>  <p>1. We will use Debug Diagnostic 2.0 update 2 version to troubleshoot this issue further. Please install the<b> Debug Diagnostic 2.0 update 2 tool </b>from<b> </b><a href="https://www.microsoft.com/en-us/download/details.aspx?id=49924">https://www.microsoft.com/en-us/download/details.aspx?id=49924</a> <b>(Please un-install all other versions of Debug Diagnostic tool before installing the latest version)</b></p>  <p>2. Before proceeding with the rule creation we need to download the symbols needed for the automated rule creation. Take the below steps to download the symbols for your w3wp process.    <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p>a. Download <b>PDBDownloader.exe </b>from <a href="https://github.com/rajkumar-rangaraj/PDB-Downloader/releases">https://github.com/rajkumar-rangaraj/PDB-Downloader/releases</a></p>            <p>b. Run the <b>PDBDownloader.exe</b> and click on open files</p>            <p>c. If the application we are creating the rule for is a .Net 2.0 <b>64 bit</b> app, Navigate to the path <b>C:\Windows\Microsoft.NET\Framework64\v2.0.50727\</b> and select <b>mscorwks.dll</b>. Click on Start</p>            <p>d. If the application we are creating the rule for is a .Net 2.0 <b>32 bit</b> app, Navigate to the path <b>C:\Windows\Microsoft.NET\Framework\v2.0.50727\</b> and select <b>mscorwks.dll</b>. Click on Start</p>            <p>e. If the application we are creating the rule for is a .Net 4.0 <b>64 bit</b> app, Navigate to the path <b>C:\Windows\Microsoft.NET\Framework64\v4.0.30319\</b> and select <b>clr.dll</b>. Click on Start</p>            <p>f. If the application we are creating the rule for is a .Net 4.0 <b>32 bit</b> app, Navigate to the path <b>C:\Windows\Microsoft.NET\Framework\v4.0.30319\</b> and select <b>clr.dll</b>. Click on Start</p>            <p>g. The tool will download the public symbols of mscorwks.dll or clr.dll to <b>C:\Symbols</b> folder and we are good to proceed with the rule creation</p>         </td>       </tr>     </tbody></table>    <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p><b><u>Note</u></b>: The executable requires internet connection to download the symbols. If you don’t have internet connection on the server, then copy the dll specific to your framework and bitness<b>&#160;</b>to the machine which has internet connection and run the tool over there. Once you have the symbols downloaded, copy PDB file to the server’s symbol folder. In case of Debug Diag 1.2 or Debug Diag 2.0 Update 1<b> </b>copy it to <b>C:\Symcache</b>, else use <b>C:\Symbols</b></p>         </td>       </tr>     </tbody></table> </p>  <table cellspacing="0" cellpadding="2" width="606" border="1"><tbody>     <tr>       <td valign="top" width="604">Debug Diag 2.0 Update 2 uses the symbol folder as C:\Symbols. Debug Diag 1.2 or Debug Diag 2.0 Update 1 uses the symbol folder as C:\symcache. If you have <b>Debug </b><b>Diag 1.2 </b>or <b>Debug Diag 2.0 Update 1</b> then change the file location in PDBDownloader.exe to <b>C:\symcache</b>. If folder does not exist please create it.</td>     </tr>   </tbody></table>  <p>3. <b>Create a Crash Rule in Debug Diagnostic 2.0</b> with the following steps: </p>  <p>a. Open DebugDiag (Start -&gt; Programs -&gt; Debug Diagnostic Tool 2.0 Collection) </p>  <p>b. Select &quot;Crash&quot; and click Next </p>  <p>c. Choose the option <b>A specific IIS application pool</b> and click <b>Next</b> and choose the application pool that is crashing from the list and click <b>Next. </b>(Note: The Application pool list may be empty if the <u>IIS 6 Metabase Compatibility</u> is not installed. In such a case you can always type the name of the application pool and click Next) </p>  <p>e. Click Next in <b>Advanced Configuration (Optional), </b>click on Breakpoints and then click on <b>Add Breakpoint</b></p>  <p>f. If it is a .net 4.0/4.5 app then Add <b>clr!AppDomainNative::Unload</b> and change the <b>Action Type</b> to <b>Full User Dump </b>and <b>Action Limit</b> to 5 and click on Ok. If it is a .net 2.0/3.5 app then Add <b>mscorwks!AppDomain::UnloadWait </b>and change the <b>Action Type</b> to <b>Full User Dump </b>and <b>Action Limit</b> to 5 and click on Ok. </p>  <p>g. Select Action Type as Full User Dump. </p>  <p>h. Click on <b>Save and Close</b></p>  <p>i. Click Next for &quot;Rule Name&quot;. The &quot;User dump Location&quot; can be changed here. </p>  <p>j. Select &quot;Activate the rule now&quot; and click Finish </p>  <p>3. Notice the Status is Active. The User dump Count will increase each time a dump file is created. </p>  <p>4. Wait for the issue to happen.</p>  <p>If everything goes well you will process monitor trace and the process dump at the time of the issue.</p>  <p><b>How to analyse process monitor trace?</b></p>  <p><b></b></p>  <p>As we had discussed earlier we know that application domain recycles whenever there is some change to either the framework directory or to your application directory. So we will be interested to look what exactly is getting changed at the time of the issue and who is the culprit doing it.</p>  <p>I will show you some of the shortcuts that you can use to analyse this trace.</p>  <p>As I said most likely we will be interested in the writes to any directory.</p>  <p>Step 1: Go to Tools-&gt;Count Occurrences-&gt;Select Operation and then click on Count.</p>  <p>Step 2: We will be interested in WriteFile as below. Click on Filter. Click on close.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1586.clip_image001_07BDF0CB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/1586.clip_5F00_image001_5F00_07BDF0CB.png"><img title="clip_image001" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5635.clip_image001_thumb_7AC410B9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/5635.clip_5F00_image001_5F00_thumb_5F00_7AC410B9.png" width="395" height="287" /></a></p>  <p>Step 3: Next we are interested in changes to either the framework directory or application directory. Go to Filter-&gt;Filter.    <table cellspacing="0" cellpadding="0"><tbody>       <tr>         <td width="15">&#160;</td>       </tr>        <tr>         <td>&#160;</td>          <td><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0572.clip_image003_0FB3027C.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0572.clip_5F00_image003_5F00_0FB3027C.jpg"><img title="clip_image003" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3056.clip_image003_thumb_52231401.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/3056.clip_5F00_image003_5F00_thumb_5F00_52231401.jpg" width="396" height="220" /></a></td>       </tr>     </tbody></table>    <br />Step 4: In the first drop down select Path and in second drop down select contains and in the 3 text box, type in your application directory. For example in my case it would be C:\inetpub\wwwroot\TestUserIdentity452. Click on Add</p>  <p>Step 5: You will get a list of write file attempts as below.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7230.image_1E5B1DB0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/7230.image_5F00_1E5B1DB0.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7180.image_thumb_43564D78.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/7180.image_5F00_thumb_5F00_43564D78.png" width="819" height="510" /></a></p>  <p>Now you can double click on any one of the above by matching the time stamp of the app domain recycle in the event log. Here you will see which process is trying to write the file and the account used by the process.    <table cellspacing="0" cellpadding="0"><tbody>       <tr>         <td width="38">&#160;</td>       </tr>        <tr>         <td>&#160;</td>          <td><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0116.image_317728FA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0116.image_5F00_317728FA.png"><img title="image" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3617.image_thumb_6B63DB35.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/3617.image_5F00_thumb_5F00_6B63DB35.png" width="533" height="662" /></a></td>       </tr>     </tbody></table>    <br />Repeat from step 4 and try the above steps for the path contains “Framework” and see if there are any writes happening.</p>  <p><b>How to analyse the dumps captured using debug diag?</b></p>  <p><b></b></p>  <p>Sometimes I have seen that just running debug diag analysis will give you information on the app domain unload exception. If not I will discuss some tricks as to how we can debug this using windbg.</p>  <p><b>WinDBG basic setup instructions:</b></p>  <p>If you don’t have windbg you can go ahead and install windbg from <a href="https://msdn.microsoft.com/en-us/windows/hardware/hh852365.aspx">https://msdn.microsoft.com/en-us/windows/hardware/hh852365.aspx</a></p>  <p>Select and download Standalone debugging tools for windows specific to your operating systems.</p>  <p>You can setup the symbols for your debugger or windbg by opening windbg and going to File-&gt;Symbol File Path and entering the below path    <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p><b>SRV*C:\symcache* http://msdl.microsoft.com/download/symbols</b><b></b></p>         </td>       </tr>     </tbody></table> </p>  <p><b>Prerequisites:</b></p>  <p>Download the netext.dll from <a href="http://netext.codeplex.com/">http://netext.codeplex.com/</a> which will be using for analysis.</p>  <p>Copy the appropriate version dll’s inside your debugger installation folder.</p>  <p><b>How to analyse the dumps?</b></p>  <p>Open the dump in debugger.</p>  <p>Load the netext.dll in the debugger by typing in the below command.    <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p>.load netext</p>         </td>       </tr>     </tbody></table> </p>  <p>Before you can run any commands you need to run indexing for the dumps you have.    <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p>!windex</p>         </td>       </tr>     </tbody></table> </p>  <p>I have worked on 3 of the scenarios which might cause application domain recycles and below are the commands and the outputs you might get</p>  <p><b>Scenario 1: configuration change</b>     <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p>0:035&gt; !wfrom -type System.Web.FileMonitor where ($enumname(_lastAction) == &quot;Modified&quot;) $a(&quot;==================\nPath&quot;,DirectoryMonitor.Directory+&quot;\\&quot;+_fileNameLong),$a(&quot;Change Time:&quot;,$tickstodatetime(_utcLastCompletion.dateData))</p>            <p>==================</p>            <p><font style="background-color: #ffff00">Path: C:\inetpub\wwwroot\web.config</font></p>            <p>Change Time:: 06-10-2015 20:20:39</p>            <p>1 Object(s) listed</p>            <p>14 Object(s) skipped by filter</p>         </td>       </tr>     </tbody></table> </p>  <p><b></b></p>  <p><b>Scenario 2: Bin directory change</b>     <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p>0:036&gt; !wruntime</p>            <p>Runtime Settings per Application Pool</p>            <p>=========================================================================</p>            <p>Address&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : 000000F585279150</p>            <p>First Request&#160;&#160; : 07-10-2015 01:25:51</p>            <p>App Pool User&#160;&#160; : IIS APPPOOL\DefaultAppPool</p>            <p>Trust Level&#160;&#160;&#160;&#160; : Full</p>            <p>App Domnain Id&#160; : /LM/W3SVC/1/ROOT/TestUserIdentity452-1-130886547510004207</p>            <p>Debug Enabled&#160;&#160; : False</p>            <p>Active Requests : 0n0</p>            <p>Path&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; : C:\inetpub\wwwroot\TestUserIdentity452\ (local disk)</p>            <p>Temp Folder&#160;&#160;&#160;&#160; : C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files</p>            <p>Compiling Folder: C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\testuseridentity452\cd5dfb1f\82daaaa9</p>            <p><font style="background-color: #ffff00">Shutdown Reason : BinDirChangeOrDirectoryRename at 07-10-2015 01:26:49</font></p>            <p><font style="background-color: #ffff00">Change Notification for critical directories.</font></p>            <p><font style="background-color: #ffff00">bin dir change or directory rename</font></p>            <p><font style="background-color: #ffff00">HostingEnvironment initiated shutdown</font></p>            <p><font style="background-color: #ffff00">Change Notification for critical directories.</font></p>            <p><font style="background-color: #ffff00">bin dir change or directory rename</font></p>            <p><font style="background-color: #ffff00">Change Notification for critical directories.</font></p>            <p><font style="background-color: #ffff00">bin dir change or directory rename</font></p>            <p>HostingEnvironment caused shutdownn&#160;&#160; at System.Environment.GetStackTrace(Exception e, Boolean needFileInfo)</p>            <p>&#160;&#160; at System.Environment.get_StackTrace()</p>            <p>&#160;&#160; at System.Web.Hosting.HostingEnvironment.InitiateShutdownInternal()</p>            <p>&#160;&#160; at System.Web.HttpRuntime.ShutdownAppDomain(String stackTrace)</p>            <p>&#160;&#160; at System.Web.HttpRuntime.OnCriticalDirectoryChange(Object sender, FileChangeEvent e)</p>            <p>&#160;&#160; at System.Web.FileChangesMonitor.OnCriticaldirChange(Object sender, FileChangeEvent e)</p>            <p>&#160;&#160; at System.Web.DirectoryMonitor.FireNotifications()</p>            <p>&#160;&#160; at System.Web.Util.WorkItem.CallCallbackWithAssert(WorkItemCallback callback)</p>            <p>&#160;&#160; at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)</p>            <p>&#160;&#160; at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)</p>            <p>&#160;&#160; at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()</p>            <p>&#160;&#160; at System.Threading.ThreadPoolWorkQueue.Dispatch()</p>         </td>       </tr>     </tbody></table> </p>  <p><b>Scenario 3: Page change</b>     <table cellspacing="0" cellpadding="0" border="1"><tbody>       <tr>         <td valign="top" width="697">           <p>0:033&gt; !wfrom -type System.Web.FileMonitor where ($enumname(_lastAction) == &quot;Modified&quot;) $a(&quot;==================\nPath&quot;,DirectoryMonitor.Directory+&quot;\\&quot;+_fileNameLong),$a(&quot;Change Time:&quot;,$tickstodatetime(_utcLastCompletion.dateData))</p>            <p>==================</p>            <p><font style="background-color: #ffff00">Path: C:\inetpub\wwwroot\TestUserIdentity452\Default.aspx</font></p>            <p><font style="background-color: #ffff00">Change Time:: 09-10-2015 00:11:40</font></p>            <p><font style="background-color: #ffff00">==================</font></p>            <p><font style="background-color: #ffff00">Path: C:\inetpub\wwwroot\TestUserIdentity452\Default.aspx</font></p>            <p><font style="background-color: #ffff00">Change Time:: 09-10-2015 00:11:17</font></p>            <p><font style="background-color: #ffff00">==================</font></p>            <p><font style="background-color: #ffff00">Path: C:\inetpub\wwwroot\TestUserIdentity452\Default.aspx</font></p>            <p><font style="background-color: #ffff00">Change Time:: 09-10-2015 00:11:34</font></p>            <p>3 Object(s) listed</p>            <p>15 Object(s) skipped by filter</p>         </td>       </tr>     </tbody></table> </p>  <p>Reference: <a href="http://netext.codeplex.com/#wfrom">http://netext.codeplex.com/#wfrom</a></p>  <p>Hope this helps J</p>]]></content:encoded>
    </item>
    <item>
      <title>Session Loss due to Application Domain recycle- Basics</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/session-loss-due-to-application-domain-recycle-basics</link>
      <pubDate>Mon, 14 Dec 2015 06:30:41 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2015/12/14/session-loss-due-to-application-domain-recycle-basics/</guid>
      <description><![CDATA[This is one of the most common issues that I see a lot and thought will blog about one of the...]]></description>
      <content:encoded><![CDATA[<p>This is one of the most common issues that I see a lot and thought will blog about one of the reasons responsible for session loss.</p> <p>You might have observed sometimes that the application seems to be working fine and you observe one of the below 2 outcomes.</p> <table cellspacing="0" cellpadding="2" width="583" border="0"> <tbody> <tr> <td valign="top" width="581"> <p>1) Intermittently one of the requests takes a lot of time and it recovers on its own for the next request and so</p> <p>2) Session loss issues intermittently. The objects you store in the session are lost intermittently and sometimes you might receive null reference exception.</p></td></tr></tbody></table> <p>Ideally the first request for an asp.net application takes more time compared to the upcoming requests as I need to create an application domain within the process. Application domain is a processing environment within the process where your code is loaded and request is processed. This domain is the same place where your process specific objects are also stored. If you are using in-proc mode for session state, then those session objects also reside in this part of the process. So in case even your process is intact and just application domain within the process recycles or goes down, you might observe session loss as mentioned above</p> <p><b></b></p> <p><b>How to detect if the application domain/app domain is getting recycled? </b></p> <p>You can follow one of the below steps</p> <p><b><u>Step 1: </u></b></p> <p>Enable health monitoring using the below steps.</p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="697"> <p>Go to C:\WINDOWS\Microsoft.NET\Framework'x'\vy\CONFIG directory and add the following to the &lt;healthMonitoring&gt;&lt;rules&gt; section</p> <p>&lt;add name="Application Lifetime Events Default" eventName="Application Lifetime Events"</p> <p>provider="EventLogProvider" profile="Default" minInstances="1"</p> <p>maxLimit="Infinite" minInterval="00:01:00" custom="" /&gt;</p></td></tr></tbody></table> <p><b><u>Note:</u></b> x is ‘32’ if 32 bit app and '64' if 64 bit app and y is ‘4.0.30319’ if .net 4.0 app and ‘2.0.50727’ if it is .net 2.0 app</p> <p><b><u>Reference:</u></b></p> <p><b><u><a href="http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx">http://blogs.msdn.com/b/tess/archive/2006/08/02/asp-net-case-study-lost-session-variables-and-appdomain-recycles.aspx</a></u></b></p> <p><strong><u></u></strong></p> <p><strong><u>Step 2:</u></strong></p> <p>Also you can enable the event logging on app domain recycling in code as suggested the below blog</p> <p><a href="http://weblogs.asp.net/scottgu/433194">http://weblogs.asp.net/scottgu/433194</a></p> <p><b><u>Step 3: </u></b></p> <p>You can add a Perfmon counter and monitor your server as below <br>1) Click Windows Start button -&gt; Run. Type Perfmon and click Ok. <br>2) Expand Performance Logs and Alerts. <br>3) Right click Counter Logs and select New Log settings. <br>4) Type a name and click Ok. <br>5) Click on Add Counters button. <br>6) From the Performance object select ASP.NET v.1.1.4322 or the ASP.NET version of your application. <br>7) Choose Select counters from list and select Application Restarts. <br>8) Click Add, Close, and Ok. <br>9) You will notice that the Perfmon will start logging data into this log file.</p> <p>Once the issue happens you would observe the counter increasing.</p> <p><b><u></u></b></p> <p><b><u>Most common reasons for App domain recycling:</u></b></p> <p><b><u></u></b></p> <p>1) Antivirus Scans: You can get rid by excluding your framework, Application directories from scanning</p> <p>More info on the directories to be excluded from antivirus scan can be found in the below blog</p> <p><a href="http://blogs.msdn.com/b/amol/archive/2015/12/10/asp-net-anti-virus-exclusion-list.aspx">http://blogs.msdn.com/b/amol/archive/2015/12/10/asp-net-anti-virus-exclusion-list.aspx</a> <br>2) Group policies changing or modifying framework folders or application folders either the permissions or the folder contents <br>3) Machine.Config, Web.Config or Global.asax are modified <br>4) The bin directory or its contents is modified <br>5) Exceeding the number of recompilation.</p> <table cellspacing="0" cellpadding="0" border="1"> <tbody> <tr> <td valign="top" width="697"> <p>Usually by default the number is 15 and you can check this under numRecompilesBeforeAppRestart tag in machine.config or web.config: numRecompilesBeforeAppRestart property Gets or sets the number of dynamic recompiles of resources that can occur before the application restarts.</p></td></tr></tbody></table> <p>6) The physical path of the virtual directory is modified <br>7) The CAS policy is modified. <br>8) The web service is restarted. <br>9) Application Sub-Directories are deleted.</p> <p>10) Writing files within web application or website directory.</p> <p>These are some of the basic checks we can do to identify if the issue we are facing is because of Application Domain Recycling.</p> <p>In the next series of blogs I am going discuss how to collect much more advanced data and how to look into these data to identify the root cause.</p> <p>Hope this helps <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none;border-bottom-style: none;border-right-style: none;border-left-style: none" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6253.wlEmoticon-smile_7A405530.png"></p> <p>&nbsp;</p> <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:757c9c42-b18d-4ede-ade9-26890968f833" class="wlWriterSmartContent" style="float: none;padding-bottom: 0px;padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px">Technorati Tags: <a href="http://technorati.com/tags/app+domain+recycling" rel="tag">app domain recycling</a>,<a href="http://technorati.com/tags/session+loss" rel="tag">session loss</a>,<a href="http://technorati.com/tags/slowness" rel="tag">slowness</a>,<a href="http://technorati.com/tags/IIS" rel="tag">IIS</a>,<a href="http://technorati.com/tags/w3wp" rel="tag">w3wp</a></div>]]></content:encoded>
    </item>
    <item>
      <title>Error while running/starting a Website under IISExpress in Visual Studio</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/error-while-runningstarting-a-website-under-iisexpress-in-visual-studio</link>
      <pubDate>Wed, 01 Apr 2015 17:31:21 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2015/04/01/error-while-runningstarting-a-website-under-iisexpress-in-visual-studio/</guid>
      <description><![CDATA[Recently I have come across several issues and have seen variosu queries in connect.microsoft.com...]]></description>
      <content:encoded><![CDATA[<p>Recently I have come across several issues and have seen variosu queries in connect.microsoft.com and stakcoverflow where developers are unable to start or load their website in IISExpress all of a sudden and this remain unanswered.</p>  <p>The issue may surface and we may receive different errors. Below are some of such errors</p>  <p>1.</p>  <table border="1" cellspacing="0" cellpadding="2" width="740"><tbody>     <tr>       <td valign="top" width="738">         <p><strong><font style="background-color: #ffff00">C:\Users\chiranth\Source\Workspaces\xxxxxxx\xxx\xxxxxxx\xxxl.WebUI.csproj : error&#160; : Creation of the virtual directory </font></strong><a href="http://localhost:52124/"><strong><font style="background-color: #ffff00">http://localhost:52124/</font></strong></a><strong><font style="background-color: #ffff00"> failed with the error: Filename: </font></strong><a href="file://\\?\UNC\xxxxx-host\Shared"><strong><font style="background-color: #ffff00">\\?\UNC\xxxxx-host\Shared</font></strong></a><strong><font style="background-color: #ffff00"> Folders\Documents\IISExpress\config\applicationHost.config</font></strong></p>          <p><strong><font style="background-color: #ffff00">Error: Cannot write configuration file due to insufficient permissions</font></strong></p>       </td>     </tr>   </tbody></table>  <p>2.</p>  <table border="1" cellspacing="0" cellpadding="2" width="747"><tbody>     <tr>       <td valign="top" width="745">         <p><strong><font style="background-color: #ffff00">Unable to launch IISexpress Webserver&#160; Start url specified&#160; is not valid. HTTP//localhost:60081&quot; on running asp.net web application</font></strong></p>       </td>     </tr>   </tbody></table>  <p>In one of the cases it complains about permissions and in the other it complains about the start url.</p>  <p>in both the cases I observed that the configuration file(applicationhost.config) was being read from a network share.</p>  <p>On further investigation I found out that we had the My Documents folder point to a shared drive or network share.</p>  <p>in 2 out of 3 instances I have seen this issue appear when the network share being pointed to is a MAC share.</p>  <p>Also when we have this in a network share I also observered that in one of the machine the applicationhost.config was going into corrupt state every time as there were “NUL NUL” being inserted into the applicationhost.config file.</p>  <p>I suspect the issue either because how the data is written over network for different operating systems. And in other scenarios it was because of the network share going down.</p>  <p>So the million dollar question is “How to change the custom user home directory for IISExpress?”.</p>  <p>If you research over internet on how to change the custom user home directory for IISExpress you will see in various references that you can change it by following the below steps.</p>  <table border="1" cellspacing="0" cellpadding="2" width="776"><tbody>     <tr>       <td valign="top" width="774"><u><b>Changing the User Home Directory</b></u>           <ul>           <li>IIS 8.0 Express supports changing the user's home directory, which is mapped to the %IIS_USER_HOME% variable in configuration. By default this path is located at <strong>%UserProfile%\Documents\IISExpress</strong>, but users can change this by setting a <strong>CustomUserHome</strong> registry property in <strong>HKCU\Software\Microsoft\IISExpress</strong>, or by specifying the <strong>&quot;/userhome&quot;</strong> parameter when launching iisexpress.exe</li>         </ul>       </td>     </tr>   </tbody></table>  <p>But what if you don’t find the key being set at all <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0028.wlEmoticon-smile_4D3C6FF4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0028.wlEmoticon_2D00_smile_5F00_4D3C6FF4.png" />, which was the same case which happened with me.</p>  <p>So after lot of research I identified the below registries where the location of My documents will be changed and we need to revert these back.</p>  <p>We need to change the default path of the My Documents directory from network share to the local or you can try pointing to a different network share if you don’t want to choose the local option. There are options in the UI to achieve this but it didn’t work for me.</p>  <p>So fail proof method is to modify the below registries which will be pointing to the network share. Take a backup of the registry keys before modifying it <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0028.wlEmoticon-smile_4D3C6FF4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0028.wlEmoticon_2D00_smile_5F00_4D3C6FF4.png" /></p>  <table border="1" cellspacing="0" cellpadding="2" width="591"><tbody>     <tr>       <td valign="top" width="589">         <p>I. <strong><font style="background-color: #ffff00">Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders\Personal</font> </strong></p>          <p>II.&#160; <font style="background-color: #ffff00"><strong>Computer\HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Personal</strong></font></p>       </td>     </tr>   </tbody></table>  <p>These will have the value of my docs in network share. Change this to local</p>  <p>For eg:</p>  <p>Old value: <a href="file://\\chiranth8r2\c$\Users\chiranth\Documents">\\chiranth8r2\c$\Users\chiranth\Documents</a></p>  <p>New value: C:\Users\chiranth\Documents</p>  <p>&#160;</p>  <p>Hope this helps <img style="border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0028.wlEmoticon-smile_4D3C6FF4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0028.wlEmoticon_2D00_smile_5F00_4D3C6FF4.png" /></p>  <p>&#160;</p>  <p>References:</p>  <p><a title="http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme" href="http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme">http://www.iis.net/learn/extensions/introduction-to-iis-express/iis-80-express-readme</a></p>  <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c433a662-3b5f-4215-bc76-56264ac25741" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/IISExpress" rel="tag">IISExpress</a>,<a href="http://technorati.com/tags/Visual+Studio+2012" rel="tag">Visual Studio 2012</a>,<a href="http://technorati.com/tags/Unable+to+start+IISExpress" rel="tag">Unable to start IISExpress</a>,<a href="http://technorati.com/tags/Cannot+write+configuration+file+due+to+insufficient+permissions" rel="tag">Cannot write configuration file due to insufficient permissions</a></div>]]></content:encoded>
    </item>
    <item>
      <title>Application Request Routing – Part 2(Reverse Proxy and Troubleshooting ARR, URLRewrite Issues)</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/application-request-routing-part-2reverse-proxy-and-troubleshooting-arr-urlrewrite-issues</link>
      <pubDate>Sun, 03 Aug 2014 03:09:15 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2014/08/03/application-request-routing-part-2reverse-proxy-and-troubleshooting-arr-urlrewrite-issues/</guid>
      <description><![CDATA[In the last blog we had discussed how we can leverage ARR as a load balancer. Over here in this blog...]]></description>
      <content:encoded><![CDATA[In the last blog we had discussed how we can leverage ARR as a load balancer. Over here in this blog we will see how we can use ARR as a reverse proxy when the content server is not exposed to the outside world. We will also discuss how we can go on about troubleshooting errors and issues like 502.3 which is the most common error while using ARR. You can use even server farms to configure as reverse proxy by adding a single server to the server farm.

Before we go on about how we can configure ARR as reverse proxy Lets check some of the options available in ARR Reverse proxy.

Go to <b>inetmgr</b> UI and click on the server name and you will find the option ‘<b>Application Request Routing Cache’.</b> Below is how the UI looks.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3312.clip_image002_08B46D5A.jpg"><img title="clip_image002" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5417.clip_image002_thumb_568D1D0F.jpg" width="841" height="464" /></a>

Below are the options and its intended purpose.

<b>1) </b><b><span style="text-decoration: underline">Cache Configuration:</span></b>

This option lets you configure proxy cache settings for your ARR server.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5707.clip_image004_68F56DC4.jpg"><img title="clip_image004" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1070.clip_image004_thumb_1F831909.jpg" width="795" height="561" /></a>

<b>Cache clean-up interval</b>: By default it is 5 minutes. This setting specifies the time in interval in minutes, at which the cache will check for files or invalidate the cache files and delete it if requires.

<b>Disk usage high threshold</b>: This setting specifies the maximum percentage of configured disk space for cache content to be used before the cached files are deleted to make up more space.

<b>Disk usage low threshold</b>: This setting specifies percentage of configured disk space that will be reached once files are deleted.

<b>Byte range segment size</b>: This is similar to chunking. This setting specifies the maximum size of the chunks that be created by segmenting a single request. Default is 256kb.

<b>Compression</b>: This is used to compress responses into a format that the servers are capable of handling such as gzip.

<b>2) </b><b><span style="text-decoration: underline">Cache control rules:</span></b>

This section lets you configure rules to manage the cache control behavior.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8206.clip_image006_55A49158.jpg"><img title="clip_image006" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image006" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6505.clip_image006_thumb_5387928F.jpg" width="797" height="116" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7043.clip_image008_1F72F33C.jpg"><img title="clip_image008" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7848.clip_image008_thumb_03EDF139.jpg" width="653" height="553" /></a>

You can create rules to be executed when either cache control directive is not present in the headers of the response sent by server or the requests or you can have the rule execute always independent of the cache control header by selecting the item in the drop down

<b>Do not cache</b>: you can select this if you don’t want specific contents to be cached based on the rule.

<b>Cache</b>: select this option to cache based on the condition.

<b>Host name</b>: this specifies for which host name the content should be either cached or not.

<b>URL</b>: this is a very good option where you can specify a frequently accessed content which can be cached.

<b>For eg</b>: you can choose to cache images i.e., */images/*.jpg all the image contents which is definitely a good rule to improve performance.

<b>3) </b><b><span style="text-decoration: underline">Add Drive and Add secondary drive:</span></b>

Using this setting you can change your disk cache location to a required custom drive may be D:\ and also limit the amount of space you can use.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8880.clip_image009_530B39CD.png"><img title="clip_image009" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0726.clip_image009_thumb_7EDB8DBC.png" width="854" height="337" /></a>

<b>4) </b><b><span style="text-decoration: underline">Server Proxy Settings:</span></b>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3288.clip_image010_3926DDD1.png"><img title="clip_image010" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image010" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/2538.clip_image010_thumb_1BF10FFA.png" width="594" height="695" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4075.clip_image011_22E09CB2.png"><img title="clip_image011" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/2744.clip_image011_thumb_791D21BE.png" width="656" height="553" /></a>

<strong>Reverse rewrite host in response headers: </strong>This option might not be of much value over here but it’s a very important setting while having reverse proxy. Imagine the internet exposed URL is <a href="http://contoso.com">http://contoso.com</a> and you have the backend servers’ contoso1 and contoso2. Consider an example where you have a redirect status set and in the response location tag is set to <a href="http://contoso1/redirectedpage.aspx">http://contoso1/redirectedpage.aspx</a> in web server in respect to the request forwarded from ARR server and this has to be notified to the end client. The client doesn't know who contoso1 is. So before sending the complete response to the client, the ARR server rewrites the host name in the location tag as <a href="http://contoso.com/redirectedpage.aspx">http://contoso.com/redirectedpage.aspx</a>

<b><span style="text-decoration: underline">Setting up ARR as a reverse proxy</span></b>

<b><span style="text-decoration: underline">Scenario: </span></b>

Imagine you have a site with external URL <a href="http://contoso.com">http://contoso.com</a> and the actual content is hosted on IIS server which is not exposed to the internet world and internal/ intranet URL is <a href="http://contososerver/.*">http://contososerver/.*</a>

So over here we will forward the requests to the ARR server and inturn internally route it to the backend server. Below is how the configuration will look like.

At the server level go to Application Request Routing Cache-&gt;Server proxy settings

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4784.clip_image013_5C5386DC.jpg"><img title="clip_image013" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image013" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1425.clip_image013_thumb_607D5EA1.jpg" width="849" height="138" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4048.clip_image015_254982D6.jpg"><img title="clip_image015" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image015" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5670.clip_image015_thumb_0DCECEA5.jpg" width="808" height="399" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/2311.clip_image017_001C129D.jpg"><img title="clip_image017" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image017" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8032.clip_image017_thumb_44E836D1.jpg" width="787" height="239" /></a>

When you specify the server you want to reroute the requests ARR will automatically create inbound rules for you as below in the URLRewrite module at server level as below.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6303.clip_image018_54A7CBD5.png"><img title="clip_image018" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image018" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8814.clip_image018_thumb_66A3E995.png" width="590" height="632" /></a>
<table cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td valign="top" width="779">&lt;rewrite&gt;&lt;globalRules&gt;

&lt;rule name="ARR_server_proxy" enabled="true" patternSyntax="Wildcard" stopProcessing="true"&gt;

&lt;match url="*" /&gt;

&lt;action type="Rewrite" url="http://contososerver/{R:0}" /&gt;

&lt;/rule&gt;

&lt;/globalRules&gt;

&lt;/rewrite&gt;</td>
</tr>
</tbody>
</table>
You can modify the rules on the go based on the requirement. Also you can add multiple inbound rules to reverse proxy the requests to different backend servers based on different conditions such as Hostnames.

<b><span style="background-color: #ffff00"></span></b>
<table cellspacing="0" cellpadding="2" width="794" border="1">
<tbody>
<tr>
<td valign="top" width="792"><strong><u>Note:</u></strong> It is not mandatory to mention the reverse proxy in the server proxy settings. If you want to use ARR as a reverse proxy you just need to make sure that in server proxy settings ‘enable proxy’ is checked and then you can create your own custom url rewrite inbound rule either at the server level or at site level in IIS</td>
</tr>
</tbody>
</table>
<b><span style="text-decoration: underline"></span></b>

<b><span style="text-decoration: underline">Troubleshooting errors and issues with ARR</span></b>

The most common error you run into when using ARR is the 502.3 error.

The best tools that you can use to troubleshoot ARR and 502.3 errors are below.

1) FREB tracing(Failed request tracing)

2) Fiddler tracing (you can install fiddler from <a href="http://www.telerik.com/fiddler">http://www.telerik.com/fiddler</a>)

3) Winhttp tracing and netmon traces

<b>FREB tracing:</b>

This is one of the beautiful tool inbuilt in IIS which will get you more info on why you are getting 502.3 errors. You can configure failed request tracing at the default web site which is running on port 80 at the site level as below.

Go to Failed request tracing at site level-&gt;Edit site tracing-&gt;Enable

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6646.clip_image020_63AE84E2.jpg"><img title="clip_image020" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image020" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0247.clip_image020_thumb_054AADB4.jpg" width="549" height="306" /></a>

Again Failed request tracing at site level-&gt;Add

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1373.clip_image021_37CE0B26.png"><img title="clip_image021" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image021" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4237.clip_image021_thumb_1595FFA0.png" width="756" height="568" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7824.clip_image022_2B30383D.png"><img title="clip_image022" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image022" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5483.clip_image022_thumb_420F09B9.png" width="651" height="489" /></a>

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4370.clip_image023_3F19A506.png"><img title="clip_image023" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image023" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5228.clip_image023_thumb_2328700E.png" width="696" height="520" /></a>

Try and reproduce the issue. When you encounter a 502.3 error next time you will have the freb xml files in C:\inetpub\logs\FailedReqLogFiles\W3SVC1. Open the xml file in internet explorer. If you are unable to open it in IE, make sure you go to and check internet options-&gt;security-&gt;internet-&gt;scripting is enabled.

Below is one of the scenarios when you get a 502.3 error and what you see in FREB

<b>502.3</b> “The connection with the server was terminated abnormally”

– This happens if a request is in progress to a content server and the application pool serving that request terminates suddenly (for example due to a web application on the content server throwing an unhandled exception on a non-request thread).

You can investigate this further to check if there were any issues on the content server and investigate why the connection was terminated. You can even collect netmon traces.

<b><span style="text-decoration: underline">Fiddler tracing</span></b>

If you want to see how the requests are routed to the backend server from ARR and to see what the exact headers are forwarded to the content server and if you are getting any errors in HTTP status codes then Fiddler tracing would be a good bet. You can attach Fiddler to ARR server and get the requests going out of ARR and the responses coming to the ARR server from the backend server.

To attach fiddler to the ARR server to record requests follow the below steps.

1) Install fiddler on the ARR server.

2) Fiddler runs on port 8888, so you need to attach ARR to route the requests to backend server through port 8888 so that fiddler can record the requests and responses. To do that go Application Request Routing Cache at the server level -&gt;Server Proxy settings and add proxy server value as localhost:8888 as below.

&nbsp;

<a href="https://msdnshared.blob.core.windows.net/media/2014/08/Capture.jpg"><img class="alignnone wp-image-301" alt="Capture" src="https://msdnshared.blob.core.windows.net/media/2014/08/Capture-300x89.jpg" width="586" height="174" /></a>

Consider you are getting a 404 error from the backend server to ARR server, this is how the fiddler trace will look like. You can see the successful and failure requests and responses obtained from the backend server as below.

<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4034.clip_image027_535F1EF7.jpg"><img title="clip_image027" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image027" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5875.clip_image027_thumb_65C76FAC.jpg" width="643" height="169" /></a>

<b><span style="text-decoration: underline">WinHttp tracing:</span></b>

Once the ARR server routes the request and gets the response back from the backend server, ARR then repackages the response to send it back to the client. For this purpose of repackaging ARR uses WinHTTP interface. If you don’t see much info in the FREB traces or fiddler traces then there might be a possibility that request is failing at WinHTTP level. To find out exactly if it is failing at WinHTTP level and where exactly it is failing, you can enable WinHTTP traces. Collecting WinHTTP traces and the way to run the trace differs on the platform and the version of the operating system we are using on the ARR server. You can refer Richard Marr’s blog <a href="http://blogs.iis.net/richma/archive/2012/08/24/winhttp-tracing-options-for-troubleshooting-with-application-request-routing.aspx">http://blogs.iis.net/richma/archive/2012/08/24/winhttp-tracing-options-for-troubleshooting-with-application-request-routing.aspx</a> where he gives a very good description on how to collect these traces. Below are the steps how we can collect winhttp traces from Richard Marr’s blog.
<table cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td valign="top" width="779">Windows 20081. Start the Tracing. From a command prompt run the following command:

<b>netsh winhttp set tracing trace-file-prefix="C:\TEMP\WinHttpLog" level=verbose format=hex state=enabled max-trace-file-size=1048576000</b>

2. Recycle the IIS Application Pool.

3. Reproduce the issue.

4. Stop the Tracing. From a command prompt run the following command:<b></b>

<b>netsh winhttp set tracing state=disabled</b>

5. Review the trace with Notepad or any Text editor.

<b>NOTE</b>: The Identity of the IIS application pool will require write access to the  log location  c:\Temp in this example:

This type of tracing is process bitness specific, so if you are looking at a 32 bit process running from 64 bit OS, you need to use: c:\windows\syswow64\cmd.exe, rather than using the regular 64 bit cmd.exe (start a run a cmd.exe)

<span style="text-decoration: underline">Windows 2008 R2</span>

<span style="text-decoration: underline">Method 1</span>

This method will output the Winhttp API calls , but not raw data for network communication. From a command prompt run the following command:

1. Start the tracing

<b>netsh winhttp set tracing trace-file-prefix="C:\Temp\Test3" level=verbose format=hex</b>

<b>netsh winhttp set tracing output=file max-trace-file-size=512000 state=enabled</b>

2. Recycle the IIS Application Pool.

3. Reproduce the issue.

4. Stop the Tracing. From a command prompt run the following command:

<b>netsh winhttp set tracing state=disabled</b>

5. Review the trace with Notepad or any Text editor.

<b>NOTE</b>: The Identity of the IIS application pool will require write access to the log location c:\Temp in this example:

This type of tracing is process bitness specific, so if you are looking at a 32 bit process running from 64 bit OS, you need to use: c:\windows\syswow64\cmd.exe, rather than using the regular 64 bit cmd.exe (start a run a cmd.exe)

<b><span style="text-decoration: underline">Method 2</span></b>

To get the raw data communication at network layer and the Winhttp  Api calls.

1. Start the tracing: From a command prompt run the following command:

<b>netsh trace start scenario=InternetClient capture=yes report=yes</b>

Note the etl file location for example:

<b>  Trace File:         C:\Users\&lt;your user name&gt;\AppData\Local\Temp\NetTraces\NetTrace.etl</b>

2.Recycle the IIS Application Pool.

3. Reproduce the issue.

4. Stop the tracing: From a command prompt run the following command:

<b>netsh trace stop</b>

5. Read the Trace by opening it in Netmon 3.4.

<b><span style="text-decoration: underline">Method 3</span></b>

The ETW format for winhttp API is available on windows 2008 R2 and win7 via the Event Viewer

1.  Open event viewer. Go to “View” menu --&gt; make sure “Show Analytic and debug logs” is checked.

2. Open “Applications and Services logs” -- &gt; Open “Microsoft” -- &gt; Open “Windows –&gt; Winhttp –&gt; Diagnostic.

<a href="http://blogs.iis.net/blogs/richma/clip_image002_50AD7A2B.jpg"><img title="clip_image029" style="padding-top: 0px;padding-left: 0px;padding-right: 0px;border-width: 0px" border="0" alt="clip_image029" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7870.clip_image029_63AA70E3.jpg" width="664" height="265" /></a>

3. Highlight “Diagnostic” under Winhttp tree and right click mouse, then click “enable log”.

4.  Reproduce the issue then you can review the logs.</td>
</tr>
</tbody>
</table>
Below is one of the sample winhttp output which shows an error 502.3 which is happening because of timeout at ARR level. The ARR server is waiting for the data from the backend server and timing out as below.
<table cellspacing="0" cellpadding="0" border="1">
<tbody>
<tr>
<td valign="top" width="779">
<pre>15:57:26.662 ::Completing WinHttpReadData() with error ERROR_WINHTTP_TIMEOUT (12002); Request</pre>
&nbsp;
<pre>Handle = 1C8457F0, Context = 1C5F0E70</pre>
&nbsp;
<pre>15:57:26.662 ::sys-recver processing WebReceiveHttpResponseEntity completion</pre>
&nbsp;
<pre>(error-cdoe = ? (0x5b4), #bytes = 0, overlapped = 1B775260)</pre>
&nbsp;
<pre>15:57:26.662 ::sys-recver failed to read data; error = ? (1460)</pre>
&nbsp;
<pre><span style="background-color: #ffff00">15:57:26.662 ::ERROR_WINHTTP_FROM_WIN32 mapped (?) 1460 to (ERROR_WINHTTP_TIMEOUT) 12002</span></pre>
&nbsp;
<pre><span style="background-color: #ffff00">15:57:26.662 ::sys-req completing a read-data call(error = ERROR_WINHTTP_TIMEOUT(12002),cbRead =0)</span></pre>
&nbsp;
<pre><span style="background-color: #ffff00">15:57:26.662 ::usr-req 1C9B4F80 received OnReadData() callback; error = ERROR_WINHTTP_TIMEOUT </span></pre>
&nbsp;
<pre><span style="background-color: #ffff00">(12002), ulNumberOfBytesTransferred = 0, dwptrContext = 1C380160</span></pre>
</td>
</tr>
</tbody>
</table>
Netmon traces will further help you to get the exact timeout. As a workaround for this issue you can increase the timeout value for ARR at the server proxy settings or investigate why it is taking a long time in the backend server.
<p align="center"><b>Hope this one helps <img class="wlEmoticon wlEmoticon-smile" alt="Smile" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8510.wlEmoticon-smile_3333EC6D.png" /></b></p>
<p align="left"><strong>References:</strong></p>
<p align="left"><a href="http://blogs.iis.net/richma/archive/2012/08/24/winhttp-tracing-options-for-troubleshooting-with-application-request-routing.aspx">http://blogs.iis.net/richma/archive/2012/08/24/winhttp-tracing-options-for-troubleshooting-with-application-request-routing.aspx</a></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/library/ee683908(WS.10).aspx" title="http://technet.microsoft.com/en-us/library/ee683908(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee683908(WS.10).aspx</a></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/library/ee683951(WS.10).aspx" title="http://technet.microsoft.com/en-us/library/ee683951(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee683951(WS.10).aspx</a></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/library/ee683923(WS.10).aspx" title="http://technet.microsoft.com/en-us/library/ee683923(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee683923(WS.10).aspx</a></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/library/ee683943(WS.10).aspx" title="http://technet.microsoft.com/en-us/library/ee683943(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee683943(WS.10).aspx</a></p>
<p align="left"><a href="http://technet.microsoft.com/en-us/library/dd443533.aspx" title="http://technet.microsoft.com/en-us/library/dd443533.aspx">http://technet.microsoft.com/en-us/library/dd443533.aspx</a></p>

<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a2786a2e-4d0c-4728-9af9-32cb8ed9e3bf" class="wlWriterSmartContent" style="float: none;margin: 0px;padding: 0px">Technorati Tags: <a href="http://technorati.com/tags/ARR" rel="tag">ARR</a>,<a href="http://technorati.com/tags/ARR+reverse+proxy" rel="tag">ARR reverse proxy</a>,<a href="http://technorati.com/tags/502.3" rel="tag">502.3</a>,<a href="http://technorati.com/tags/winhttp" rel="tag">winhttp</a>,<a href="http://technorati.com/tags/fiddler" rel="tag">fiddler</a>,<a href="http://technorati.com/tags/freb+502.3" rel="tag">freb 502.3</a>,<a href="http://technorati.com/tags/inbound+rules" rel="tag">inbound rules</a></div>]]></content:encoded>
    </item>
    <item>
      <title>Application Request Routing and URL Rewrite – PART 1(Server Farms)</title>
      <link>https://docs.microsoft.com/archive/blogs/chiranth/application-request-routing-and-url-rewrite-part-1server-farms</link>
      <pubDate>Mon, 21 Jul 2014 01:54:07 GMT</pubDate>
      <dc:creator><![CDATA[Chiranth Ramaswamy]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/chiranth/2014/07/21/application-request-routing-and-url-rewrite-part-1server-farms/</guid>
      <description><![CDATA[In my previous blogs I had mentioned how we can use URL rewrite without ARR in picture. In the next...]]></description>
      <content:encoded><![CDATA[<p>In my previous blogs I had mentioned how we can use URL rewrite without ARR in picture. In the next series of upcoming blogs I will be discussing how we can leverage ARR and URL rewrite with ARR.</p>  <p>ARR is an out of band module available for IIS 7.x and onwards.</p>  <p>ARR can be used for below purposes.</p>  <p>1) As a load balancer when you want to load balance requests between multiple servers.</p>  <p>2) As a reverse proxy where your web servers are hidden from the internet world.</p>  <p>3) It can also be used for platform provisioning and application provisioning(by this I mean keeping configuration and features installed on top of IIS in sync between multiple servers) with the help of web deploy(which is famously know as web farm framework WFF). WFF is not tested completely from IIS 8 and onwards.</p>  <p>In this series we will discuss 1) and 2). First we will concentrate on how we can use ARR as a load balancer.</p>  <p><b><u>ARR as a load balancer</u></b></p>  <p>Before going ahead and using ARR as a load balancer. Let’s get familiarized with the options present in the ARR server farms UI which will help us during our discussion.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7180.clip_image001_2A411F8C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/7180.clip_5F00_image001_5F00_2A411F8C.png"><img title="clip_image001" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/2086.clip_image001_thumb_71D2F8B3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/2086.clip_5F00_image001_5F00_thumb_5F00_71D2F8B3.png" width="854" height="216" /></a></p>  <p>Below are the important options which we need to familiarize ourselves with when we want to use server farms or ARR as a load balancer.</p>  <p>1) Caching</p>  <p>2) Health Test</p>  <p>3) Load Balance</p>  <p>4) Monitoring and Management</p>  <p>5) Proxy</p>  <p>6) Routing rules</p>  <p>7) Server Affinity</p>  <p><b><u>Caching:</u></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5518.clip_image003_1CCAE6B9.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/5518.clip_5F00_image003_5F00_1CCAE6B9.jpg"><img title="clip_image003" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1460.clip_image003_thumb_482F07B3.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/1460.clip_5F00_image003_5F00_thumb_5F00_482F07B3.jpg" width="855" height="426" /></a></p>  <p>This is similar to your IIS caching where you have the above mentioned options. This option will help you in caching content received from the backend server when the content has not been changed.</p>  <table cellspacing="0" cellpadding="0" border="1"><tbody>     <tr>       <td valign="top" width="779">         <table cellspacing="3" cellpadding="0" border="0"><tbody>             <tr>               <td>                 <p><b>Element Name </b></p>               </td>                <td>                 <p><b>Description </b></p>               </td>             </tr>              <tr>               <td>                 <p><b>Memory cache duration (seconds)</b></p>               </td>                <td>                 <p>Enter the length of time, in seconds, that you want cached content to be stored. The default value is 60 seconds.</p>               </td>             </tr>              <tr>               <td>                 <p><b>Enable disk cache</b></p>               </td>                <td>                 <p>Select this check box to use your configured disk cache locations. By default, ARR caches content to the primary disk cache after it is configured.</p>               </td>             </tr>              <tr>               <td>                 <p><b>Enable request consolidation</b></p>               </td>                <td>                 <p>Select this check box to configure the request consolidation feature. Enabling request consolidation reduces the number of requests when streaming live content. By default, this feature is disabled.</p>               </td>             </tr>              <tr>               <td>                 <p><b>Query string support</b></p>               </td>                <td>                 <p>Select how you want to handle query string values from the following options:</p>                  <ul>                   <li><b>Ignore Query String</b> </li>                    <li><b>Do Not Cache</b> </li>                    <li><b>Include Query String</b> </li>                 </ul>               </td>             </tr>           </tbody></table>       </td>     </tr>   </tbody></table>  <p><a href="http://technet.microsoft.com/en-us/library/ee731895(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee731895(WS.10).aspx</a></p>  <p><b><u>Load Balance:</u></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1346.clip_image005_45A5D5F5.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/1346.clip_5F00_image005_5F00_45A5D5F5.jpg"><img title="clip_image005" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0636.clip_image005_thumb_4A3BE0AF.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0636.clip_5F00_image005_5F00_thumb_5F00_4A3BE0AF.jpg" width="840" height="349" /></a><b></b></p>  <p>Over here you can specify the algorithm you want to use to perform load balancing and based on what criteria the incoming requests should be split between your web servers. The options present are all standard algorithms and you can find info about these algorithms over internet about how they work. Below are the available algorithm options about load balancing and a brief introduction about them.</p>  <ul>   <li><b>Weighted round robin</b> – Distributes traffic based on the number of incoming requests and their normalized weight. Each server can receive the same distribution of requests or a custom distribution. </li>    <li><b>Weighted total traffic</b> – Distributes traffic based on the size of the requests and responses in bytes. Requests are routed so that the amount of data is load balanced. In an even distribution, the server with the least amount of data will receive the next request. </li>    <li><b>Least current request</b> – Distributes traffic based on the current number of HTTP requests between ARR and each of the application servers. Requests are routed to the server with the least number of current HTTP requests. </li>    <li><b>Least response time</b> – Distributes traffic based on the fastest response time from the servers, which enables the server to respond most quickly. </li>    <li><b>Server variable hash</b> – Distributes traffic based on a hashed value of a server variable. </li>    <li><b>Query string hash</b> – Distributes traffic based on the hashed value of the query string value. When more than one query string name is specified, the concatenated string of the corresponding query string value is used for the hash. </li> </ul>  <p>· <b>Request hash</b> – Distributes traffic based on the hashed value of the configured server variable or URL. For example, if the server variable is QUERY_STRING, the hashed value is based on the names in the request query string.</p>  <p><b><u>Proxy:</u></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3036.image_114367A3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/3036.image_5F00_114367A3.png"><img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4034.image_thumb_39783166.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/4034.image_5F00_thumb_5F00_39783166.png" width="534" height="477" /></a> </p>  <p>I forgot to include explanation for Reverse rewrite host in response headers in the image while creating it.</p>  <p><strong>Reverse rewrite host in response headers: </strong>This option might not be of much value over here but its a very important setting while having reverse proxy. Imagine the internet exposed url is <a href="http://contoso.com">http://contoso.com</a> and you have the backend servers contoso1 and contoso2. consider an example where you have a redirect status set and in the response location tag is set to <a href="http://contoso1/redirectedpage.aspx">http://contoso1/redirectedpage.aspx</a> in web server in respect to the request forwarded from ARR server and this has to be notified to the end client. the client doesn't know who contoso1 is. so before sending the complete response to the client, the ARR server rewrites the host name in the location tag as <a href="http://contoso.com/redirectedpage.aspx">http://contoso.com/redirectedpage.aspx</a></p>  <p><b><u>Routing Rules:</u></b></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8182.clip_image009_03EB4E0F.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8182.clip_5F00_image009_5F00_03EB4E0F.jpg"><img title="clip_image009" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8463.clip_image009_thumb_412C02D6.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8463.clip_5F00_image009_5F00_thumb_5F00_412C02D6.jpg" width="833" height="356" /></a></p>  <p>This is pretty much self-explanatory and you will select “<strong>Use URL Rewrite to inspect incoming requests</strong>” option to use URL rewrite rules to evaluate requests that come through your server.</p>  <p>Another important option over here is <strong>Enable SSL offloading- </strong><strong>if you select this option even though the requests from client to ARR server will be over https but while forwarding the requests to backend servers this will happen over http.</strong></p>  <p><strong>Requests with the following extensions are not forwarded: </strong>This is a very rarely used but a very good feature which helps you in improving performance. if you specify *.jpg, then it means that any request for .jpg image file will not be sent to the backend server. you can keep the static content like images on ARR server itself. This will add a condition in your rule. you can add this condition manually in your inbound rule as well. the condition will look like below.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4477.image_05D255B9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/4477.image_5F00_05D255B9.png"><img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5700.image_thumb_714F96EB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/5700.image_5F00_thumb_5F00_714F96EB.png" width="580" height="383" /></a> </p>  <p><strong>Requests with the following patterns are not forwarded: </strong>This one is similar to the one mentioned above. when you have contents like templates, images or static content which wont change often then you can keep the copy of it in ARR server itself and then choose not to forward these request and process these request locally on ARR server. I can choose to ignore all the requests containing images in the path from being forwarded. you can manually add such a condition in your inbound rule as well and it will look like below.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7571.image_150B4F37.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/7571.image_5F00_150B4F37.png"><img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6886.image_thumb_2B60F47C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/6886.image_5F00_thumb_5F00_2B60F47C.png" width="637" height="421" /></a> </p>  <p><strong><u>Server Affinity:</u></strong></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/2134.image_1605CFC5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/2134.image_5F00_1605CFC5.png"><img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8712.image_thumb_5083604A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8712.image_5F00_thumb_5F00_5083604A.png" width="686" height="357" /></a> </p>  <p><strong>Client affinity</strong>: People might be familiar with the name “sticky sessions” available in most of the hardware load balancers. This option provides the same feature in IIS. When you want the requests to be load balanced to the same server where the first request from the client was routed to for the whole session, you can use the client affinity feature over here.</p>  <p>This feature is advantageous where in your session state is ‘in-proc’ and not available outside the worker process.</p>  <p><strong>Host Name affinity:</strong> imagine you have multiple hostnames for a site. based on the hostname used you can decide the affinity. Also if you have 4 servers for load balancing you can control the number of servers the requests can be routed if it comes with a specific hostname.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3312.image_1D49B792.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/3312.image_5F00_1D49B792.png"><img title="image" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8561.image_thumb_03781214.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8561.image_5F00_thumb_5F00_03781214.png" width="700" height="424" /></a> </p>  <p><strong><u>Monitoring and Management:</u></strong></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6558.clip_image013_072C9A1D.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/6558.clip_5F00_image013_5F00_072C9A1D.jpg"><img title="clip_image013" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image013" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0654.clip_image013_thumb_56B615A6.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0654.clip_5F00_image013_5F00_thumb_5F00_56B615A6.jpg" width="803" height="497" /></a></p>  <p>This will be your load balancer dashboard where you can monitor the health status and the request statistics, also how the load balancing is happening.</p>  <p><b><u>Creating sample to demonstrate load balancing by creating server farm in ARR</u></b><b><u></u></b></p>  <p><b><u>Scenario</u></b>: Let’s consider the scenario where in we have two backend web servers’ contoso1.chiranth.com and contoso2.chiranth.com and one ARR server where we want to load balance the requests for the site “contoso.com” between the two servers.</p>  <p>To achieve the above requirement we have two follow two simple steps.</p>  <p>1) Creating a server farm which will be a container for these two servers</p>  <p>2) Creating URL rewrite rules to monitor the incoming requests and route it accordingly</p>  <p><b><u>Creating a server farm:</u></b></p>  <p>Creating a server farm is a two-step simple procedure as below.</p>  <p>1) Right click on server farms-&gt; Create new server farm</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/5556.clip_image014_542CE3E8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/5556.clip_5F00_image014_5F00_542CE3E8.png"><img title="clip_image014" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image014" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/0131.clip_image014_thumb_2F2F236F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/0131.clip_5F00_image014_5F00_thumb_5F00_2F2F236F.png" width="161" height="23" /></a></p>  <p>2) Enter a friendly farm name</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1565.clip_image015_18F9081D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/1565.clip_5F00_image015_5F00_18F9081D.png"><img title="clip_image015" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image015" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/3187.clip_image015_thumb_6FA1C01E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/3187.clip_5F00_image015_5F00_thumb_5F00_6FA1C01E.png" width="421" height="318" /></a></p>  <p>3) Add the server which you want to include for load balancing. Over here in our scenario we have 2 servers contoso1 and contoso2</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8322.clip_image016_1452D796.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8322.clip_5F00_image016_5F00_1452D796.png"><img title="clip_image016" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image016" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6165.clip_image016_thumb_1235D8CD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/6165.clip_5F00_image016_5F00_thumb_5F00_1235D8CD.png" width="463" height="350" /></a></p>  <p><b><u>Creating URL rewrite rules for your farm:</u></b></p>  <p>After creating the farm 50% of the task is done. Now we will have to configure URL rewrite rules to monitor the requests and route it accordingly. When you create a server farm ARR will prompt you asking if it should create a URL rewrite rule for you. Let’s click on No for that. I will take you through the manual steps for creating the rule.</p>  <p>1) Make sure under routing rules at the server farm level you have the “USE URL REWRITE to inspect incoming requests” option checked.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6038.clip_image017_76B0D6C9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/6038.clip_5F00_image017_5F00_76B0D6C9.png"><img title="clip_image017" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image017" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4762.clip_image017_thumb_61DEDE49.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/4762.clip_5F00_image017_5F00_thumb_5F00_61DEDE49.png" width="663" height="246" /></a></p>  <p>2) When you are using ARR for either Load balancing or as reverse proxy the URL rewrite rules should be created at the server level. Go to URL Rewrite at the server level.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4111.clip_image019_316859D3.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/4111.clip_5F00_image019_5F00_316859D3.jpg"><img title="clip_image019" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image019" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8787.clip_image019_thumb_7B36BBB6.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8787.clip_5F00_image019_5F00_thumb_5F00_7B36BBB6.jpg" width="817" height="380" /></a></p>  <p>3) Add rule-&gt; Inbound rules -&gt;Blank rule.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/8171.clip_image020_634FD490.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/8171.clip_5F00_image020_5F00_634FD490.png"><img title="clip_image020" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image020" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/1256.clip_image020_thumb_0F202880.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/1256.clip_5F00_image020_5F00_thumb_5F00_0F202880.png" width="547" height="359" /></a></p>  <p>4) I have already explained about the sections in inbound rules and regular expressions in my previous blog. So over here pattern would be ‘<b>.*</b>’ i.e, anything and a condition stating that this rule should be executed only when the hostname or HTTP_HOST is contoso.com, action would be “Route to server farm” and under action properties select the appropriate server farm and specify the REQUEST_URI which we have stored as {R:0} from the pattern section in the URL.</p>  <p>The rule will look like below.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/4101.clip_image021_58162479.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/4101.clip_5F00_image021_5F00_58162479.png"><img title="clip_image021" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image021" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/7635.clip_image021_thumb_27336D0E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/7635.clip_5F00_image021_5F00_thumb_5F00_27336D0E.png" width="537" height="575" /></a></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/2235.clip_image022_6ABAF863.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/2235.clip_5F00_image022_5F00_6ABAF863.png"><img title="clip_image022" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="clip_image022" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/61/50/metablogapi/6013.clip_image022_thumb_6F51031D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-61-50-metablogapi/6013.clip_5F00_image022_5F00_thumb_5F00_6F51031D.png" width="577" height="553" /></a></p>  <p>5) Click on Apply and you are good to go for testing.</p>  <p>Hope this helps. In next part of my upcoming blog I will discuss how we can use ARR as reverse proxy and how we can go through the troubleshooting if we are facing any issues and the tools that we can make use of.</p>  <p><strong><u>References</u></strong>:</p>  <p><a title="http://technet.microsoft.com/en-us/library/ee731895(WS.10).aspx" href="http://technet.microsoft.com/en-us/library/ee731895(WS.10).aspx">http://technet.microsoft.com/en-us/library/ee731895(WS.10).aspx</a></p>  <p><a title="http://technet.microsoft.com/en-us/library/dd443524.aspx" href="http://technet.microsoft.com/en-us/library/dd443524.aspx">http://technet.microsoft.com/en-us/library/dd443524.aspx</a></p>  <p><a title="http://technet.microsoft.com/en-us/library/dd443526.aspx" href="http://technet.microsoft.com/en-us/library/dd443526.aspx">http://technet.microsoft.com/en-us/library/dd443526.aspx</a></p>  <p><a title="http://technet.microsoft.com/en-us/library/dd443532.aspx" href="http://technet.microsoft.com/en-us/library/dd443532.aspx">http://technet.microsoft.com/en-us/library/dd443532.aspx</a></p>  <p><a title="http://technet.microsoft.com/en-us/library/dd443543.aspx" href="http://technet.microsoft.com/en-us/library/dd443543.aspx">http://technet.microsoft.com/en-us/library/dd443543.aspx</a></p>  <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c429ad6e-ec59-4d13-b0b1-0e5ff2f68999" class="wlWriterSmartContent" style="float: none; padding-bottom: 0px; padding-top: 0px; padding-left: 0px; margin: 0px; display: inline; padding-right: 0px">Technorati Tags: <a href="http://technorati.com/tags/ARR" rel="tag">ARR</a>,<a href="http://technorati.com/tags/application+request+routing" rel="tag">application request routing</a>,<a href="http://technorati.com/tags/urlrewrite" rel="tag">urlrewrite</a>,<a href="http://technorati.com/tags/server+farms" rel="tag">server farms</a>,<a href="http://technorati.com/tags/reverse+proxy" rel="tag">reverse proxy</a>,<a href="http://technorati.com/tags/caching" rel="tag">caching</a>,<a href="http://technorati.com/tags/load+balance" rel="tag">load balance</a>,<a href="http://technorati.com/tags/iis" rel="tag">iis</a>,<a href="http://technorati.com/tags/proxy" rel="tag">proxy</a></div>]]></content:encoded>
    </item>
  </channel>
</rss>