<?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>Tales from the field</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/ricardo/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/ricardo/feed.xml</link>
    <description />
    <lastBuildDate>Tue, 16 Apr 2019 05:25:27 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Load Testing with Agents running on Windows Azure – part 3</title>
      <link>https://docs.microsoft.com/archive/blogs/ricardo/load-testing-with-agents-running-on-windows-azure-part-3</link>
      <pubDate>Fri, 08 Apr 2011 01:03:00 GMT</pubDate>
      <dc:creator><![CDATA[rlfh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ricardo/2011/04/08/load-testing-with-agents-running-on-windows-azure-part-3/</guid>
      <description><![CDATA[** Important note&nbsp;&ndash; Please read before reading further **
The content in this post was...]]></description>
      <content:encoded><![CDATA[<hr />
<p><strong><span style="color: #ff0000;">** Important note&nbsp;&ndash; Please read before reading further **</span></strong></p>
<p>The content in this post was first&nbsp;written in 2011, exploring the earlier versions of Windows Azure. Since then, Windows Azure has evolved quite a lot, as well as other services in the Microsoft portfolio.</p>
<p>We now have an official solution to run load tests on Azure - load testing is part of Team Foundation Service and a preview is available. If you haven't tried it already, I'd encourage you to try it.</p>
<p>Find out more at <a href="https://aka.ms/loadtfs">https://aka.ms/loadtfs</a>.</p>
<p>&nbsp;</p>
<hr />
<p>If you&rsquo;ve read the last 2 posts, you already know we&rsquo;re building a proof-of-concept test rig using Visual Studio Test Agents hosted on Windows Azure. For the final part of this post, we&rsquo;ll look at the deployment procedure.</p>
<p>I usually start by deploying just 1 instance from Visual Studio. There&rsquo;s no point in jumping to the deployment of the full rig because currently there&rsquo;s no option to setup Windows Azure Connect other than using the Management Portal and doing it manually. Let&rsquo;s go by it step-by-step.</p>
<p>To deploy the first instance, the number of instances of my Worker Role in the Service Configuration file should be set to 1.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/2308.AzureLoadTesting4_378527AF.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/2308.AzureLoadTesting4_5F00_378527AF.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting4" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/6014.AzureLoadTesting4_thumb_3DBBD870.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/6014.AzureLoadTesting4_5F00_thumb_5F00_3DBBD870.jpg" alt="AzureLoadTesting4" width="488" height="204" border="0" /></a></p>
<p>You can then Publish by right-clicking on the Cloud project and choosing Publish. Configure your target Hosted Service and environment and click OK to start deploying. At this point, Visual Studio will compile and generate your service package and then start uploading it to Windows Azure. Afterwards, it will trigger the deployment of the configured instance for your role. The whole process might take a while (around 15 minutes).</p>
<p>During this time, you should navigate to the Management Portal and take a look at what&rsquo;s going on from the Hosted Services screen. The Hosted Services screen will allow you to track the deployment process.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/4786.AzureLoadTesting5_05B9E48D.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/4786.AzureLoadTesting5_5F00_05B9E48D.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting5" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/2804.AzureLoadTesting5_thumb_5F0B583F.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/2804.AzureLoadTesting5_5F00_thumb_5F00_5F0B583F.jpg" alt="AzureLoadTesting5" width="542" height="197" border="0" /></a></p>
<p>The other screen you should be looking at periodically is the Virtual Network screen. When the instances are deployed, because they are enabled for Connect, they will show up here on the section &ldquo;Activated Endpoints&rdquo;. This section will contain a reference to your Controller machine, since you installed the Connect agent there.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/0247.AzureLoadTesting6_3CD34CB9.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/0247.AzureLoadTesting6_5F00_3CD34CB9.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting6" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/3806.AzureLoadTesting6_thumb_45DFD83A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/3806.AzureLoadTesting6_5F00_thumb_5F00_45DFD83A.jpg" alt="AzureLoadTesting6" width="534" height="145" border="0" /></a></p>
<p>Once it shows your new instance (a new entry named RD-something), you&rsquo;ll be able to navigate to the &ldquo;Groups and Roles&rdquo; section, create a Group and create a Role Connection between your service and the Endpoint Group you just created.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/5852.image_442F0C66.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/5852.image_5F00_442F0C66.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/6038.image_thumb_1AD7C468.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/6038.image_5F00_thumb_5F00_1AD7C468.png" alt="image" width="492" height="335" border="0" /></a></p>
<p>It will look something like this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/2337.AzureLoadTesting8_57AC463A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/2337.AzureLoadTesting8_5F00_57AC463A.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting8" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/2843.AzureLoadTesting8_thumb_74D1EE44.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/2843.AzureLoadTesting8_5F00_thumb_5F00_74D1EE44.jpg" alt="AzureLoadTesting8" width="541" height="133" border="0" /></a></p>
<p>Once you&rsquo;ve done this, you can sit and wait for this first instance to install. You&rsquo;ll notice that, on the Controller machine, once the instance is set as ready, you&rsquo;ll be able to get an IPv6 for it and the Connect agent icon changes to show the connection is active.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/8117.image_3A0A456E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/8117.image_5F00_3A0A456E.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/7043.image_thumb_313A3D22.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/7043.image_5F00_thumb_5F00_313A3D22.png" alt="image" width="514" height="255" border="0" /></a></p>
<p>If you feel the deployment is hung, a good tip is to reimage the instance.</p>
<p>Once this instance is Active, you can just change the configuration to add some instances. You can use the Management Portal to do so, choosing the Deployment and clicking &ldquo;Configure&rdquo; on the ribbon. Try changing the number of instances to 5, for example.</p>
<p>&nbsp;<a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/1106.image_0A1F7DE0.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/1106.image_5F00_0A1F7DE0.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/3757.image_thumb_5289BCF1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/3757.image_5F00_thumb_5F00_5289BCF1.png" alt="image" width="568" height="380" border="0" /></a></p>
<p>You&rsquo;ll notice that every new instance you create will register with your local test Controller and become an Agent itself.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/4010.AzureLoadTesting10_0217B5B1.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/4010.AzureLoadTesting10_5F00_0217B5B1.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting10" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/8055.AzureLoadTesting10_thumb_459F4106.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/8055.AzureLoadTesting10_5F00_thumb_5F00_459F4106.jpg" alt="AzureLoadTesting10" width="449" height="392" border="0" /></a></p>
<p>The only thing left is to reimage your first image so that it too registers with the Controller and your rig is now done! You should now be able to run Test Projects using this rig and collect the results.</p>
<p>You can download a sample project <a href="http://ptadm.blob.core.windows.net/vsagent/testagent_project.zip">here</a>. This sample project, the scripts and the code are provided as-is, without responsibility for support, and is the result of my curiosity and very limited testing. Remember that you need to change some settings on the configuration and the scripts, such as the download URL for the VS Agent software and the usernames and passwords which are created or used in the schedule task, as well as the name of your Controller Machine on the VS Agent setup command line.</p>]]></content:encoded>
    </item>
    <item>
      <title>Load Testing with Agents running on Windows Azure – part 2</title>
      <link>https://docs.microsoft.com/archive/blogs/ricardo/load-testing-with-agents-running-on-windows-azure-part-2</link>
      <pubDate>Fri, 08 Apr 2011 01:02:00 GMT</pubDate>
      <dc:creator><![CDATA[rlfh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ricardo/2011/04/08/load-testing-with-agents-running-on-windows-azure-part-2/</guid>
      <description><![CDATA[** Important note&nbsp;&ndash; Please read before reading further **
The content in this post was...]]></description>
      <content:encoded><![CDATA[<hr />
<p><strong><span style="color: #ff0000;">** Important note&nbsp;&ndash; Please read before reading further **</span></strong></p>
<p>The content in this post was first&nbsp;written in 2011, exploring the earlier versions of Windows Azure. Since then, Windows Azure has evolved quite a lot, as well as other services in the Microsoft portfolio.</p>
<p>We now have an official solution to run load tests on Azure - load testing is part of Team Foundation Service and a preview is available. If you haven't tried it already, I'd encourage you to try it.</p>
<p>Find out more at <a href="https://aka.ms/loadtfs">https://aka.ms/loadtfs</a>.</p>
<p>&nbsp;</p>
<hr />
<p>If you&rsquo;ve read the last post, you know by now that we&rsquo;re building a Load Test rig hosted on Windows Azure using Visual Studio 2010. Let&rsquo;s take a look at our 2 different components.</p>
<h1>Controller</h1>
<p>For the Controller machine, you need Visual Studio 2010 and the Visual Studio 2010 agents, so that you can install the Controller agent.</p>
<p>You should create a user account vstestagent that has the same password as the vstestagent user created in the setup.cmd on the Agent machines. This is required because the machines are not domain-joined but must authenticate with each other.</p>
<p>You must also install the Endpoint software for Windows Azure connect. You can do this from the Management Portal by clicking &ldquo;Install Local Endpoint&rdquo; on the ribbon.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/1234.AzureLoadTesting9_44C85781.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/1234.AzureLoadTesting9_5F00_44C85781.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting9" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/5037.AzureLoadTesting9_thumb_6332986A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/5037.AzureLoadTesting9_5F00_thumb_5F00_6332986A.jpg" alt="AzureLoadTesting9" width="400" height="200" border="0" /></a></p>
<h1>&nbsp;</h1>
<p>There&rsquo;s really not more you need to do or install on this machine.</p>
<h1>Agent</h1>
<p>My immediate idea was to build a custom VM for this role, but a colleague pointed me to right direction and suggested using worker roles and some startup tasks to deploy the needed software.</p>
<p>I started by creating a Cloud project in Visual Studio and adding a Worker Role. The code for the worker role is rather basic: in fact, the worker role does absolutely nothing because all of the work is done in the startup tasks.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">using</span> System;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> <span style="color: #0000ff;">using</span> System.Collections.Generic;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span> <span style="color: #0000ff;">using</span> System.Diagnostics;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span> <span style="color: #0000ff;">using</span> System.Linq;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span> <span style="color: #0000ff;">using</span> System.Net;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span> <span style="color: #0000ff;">using</span> System.Threading;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span> <span style="color: #0000ff;">using</span> Microsoft.WindowsAzure;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span> <span style="color: #0000ff;">using</span> Microsoft.WindowsAzure.Diagnostics;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span> <span style="color: #0000ff;">using</span> Microsoft.WindowsAzure.ServiceRuntime;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span> <span style="color: #0000ff;">using</span> Microsoft.WindowsAzure.StorageClient;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span> <span style="color: #0000ff;">namespace</span> WorkerRole1</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span> {</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span>     <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">class</span> WorkerRole : RoleEntryPoint</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span>     {</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;"> 16:</span>         <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">override</span> <span style="color: #0000ff;">void</span> Run()</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060;"> 17:</span>         {</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum18" style="color: #606060;"> 18:</span>             <span style="color: #008000;">// This is a sample worker implementation. Replace with your logic.</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum19" style="color: #606060;"> 19:</span>             Trace.WriteLine(<span style="color: #006080;">"WorkerRole1 entry point called"</span>, <span style="color: #006080;">"Information"</span>);</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum20" style="color: #606060;"> 20:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum21" style="color: #606060;"> 21:</span>             <span style="color: #0000ff;">while</span> (<span style="color: #0000ff;">true</span>)</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum22" style="color: #606060;"> 22:</span>             {</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum23" style="color: #606060;"> 23:</span>                 Thread.Sleep(10000);</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum24" style="color: #606060;"> 24:</span>                 Trace.WriteLine(<span style="color: #006080;">"Working"</span>, <span style="color: #006080;">"Information"</span>);</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum25" style="color: #606060;"> 25:</span>             }</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum26" style="color: #606060;"> 26:</span>         }</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum27" style="color: #606060;"> 27:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum28" style="color: #606060;"> 28:</span>         <span style="color: #0000ff;">public</span> <span style="color: #0000ff;">override</span> <span style="color: #0000ff;">bool</span> OnStart()</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum29" style="color: #606060;"> 29:</span>         {</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum30" style="color: #606060;"> 30:</span>             <span style="color: #008000;">// Set the maximum number of concurrent connections </span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum31" style="color: #606060;"> 31:</span>             ServicePointManager.DefaultConnectionLimit = 12;</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum32" style="color: #606060;"> 32:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum33" style="color: #606060;"> 33:</span>             <span style="color: #008000;">// For information on handling configuration changes</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum34" style="color: #606060;"> 34:</span>             <span style="color: #008000;">// see the MSDN topic at http://go.microsoft.com/fwlink/?LinkId=166357.</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum35" style="color: #606060;"> 35:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum36" style="color: #606060;"> 36:</span>             <span style="color: #0000ff;">return</span> <span style="color: #0000ff;">base</span>.OnStart();</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum37" style="color: #606060;"> 37:</span>         }</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum38" style="color: #606060;"> 38:</span>     }</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum39" style="color: #606060;"> 39:</span> }</pre>
<!--CRLF--></div>
</div>
<p>The service definition includes the Worker Role, loads required modules, including Connect, and defines the startup tasks that must run during startup.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> <span style="color: #0000ff;">&lt;?</span><span style="color: #800000;">xml</span> <span style="color: #ff0000;">version</span><span style="color: #0000ff;">="1.0"</span> <span style="color: #ff0000;">encoding</span><span style="color: #0000ff;">="utf-8"</span>?<span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">ServiceDefinition</span> <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="TestAgent"</span> <span style="color: #ff0000;">xmlns</span><span style="color: #0000ff;">="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition"</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>   <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">WorkerRole</span> <span style="color: #ff0000;">name</span><span style="color: #0000ff;">="WorkerRole1"</span> <span style="color: #ff0000;">vmsize</span><span style="color: #0000ff;">="Medium"</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span>     <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Imports</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Import</span> <span style="color: #ff0000;">moduleName</span><span style="color: #0000ff;">="Diagnostics"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Import</span> <span style="color: #ff0000;">moduleName</span><span style="color: #0000ff;">="Connect"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Import</span> <span style="color: #ff0000;">moduleName</span><span style="color: #0000ff;">="RemoteAccess"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Import</span> <span style="color: #ff0000;">moduleName</span><span style="color: #0000ff;">="RemoteForwarder"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span>     <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">Imports</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span>     <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Startup</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Task</span> <span style="color: #ff0000;">commandLine</span><span style="color: #0000ff;">="setup.cmd"</span> <span style="color: #ff0000;">executionContext</span><span style="color: #0000ff;">="elevated"</span> <span style="color: #ff0000;">taskType</span><span style="color: #0000ff;">="simple"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span>       <span style="color: #0000ff;">&lt;</span><span style="color: #800000;">Task</span> <span style="color: #ff0000;">commandLine</span><span style="color: #0000ff;">="setupfw.cmd"</span> <span style="color: #ff0000;">executionContext</span><span style="color: #0000ff;">="elevated"</span> <span style="color: #ff0000;">taskType</span><span style="color: #0000ff;">="simple"</span> <span style="color: #0000ff;">/&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span>     <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">Startup</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span>   <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">WorkerRole</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span> <span style="color: #0000ff;">&lt;/</span><span style="color: #800000;">ServiceDefinition</span><span style="color: #0000ff;">&gt;</span></pre>
<!--CRLF--></div>
</div>
<p>The 2 tasks declared will be responsible for: 1) configuring the software and 2) configure the firewall rules required for the Controller-Agent connection.</p>
<p>To configure an Agent, the following tasks will have to performed:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/6012.AzureLoadTesting2_thumb1_168E5BC7.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/6012.AzureLoadTesting2_5F00_thumb1_5F00_168E5BC7.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting2_thumb1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/3463.AzureLoadTesting2_thumb1_thumb_1BFCCC6B.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/3463.AzureLoadTesting2_5F00_thumb1_5F00_thumb_5F00_1BFCCC6B.jpg" alt="AzureLoadTesting2_thumb1" width="413" height="224" border="0" /></a></p>
<p>So, what do the scripts look like? Let&rsquo;s start by looking at setup.cmd, which is more or less self explaining:</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> powershell -command <span style="color: #006080;">"set-executionpolicy Unrestricted"</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> powershell -command <span style="color: #006080;">".\setup.ps1"</span> -NonInteractive &gt;<span style="color: #008000;">; out.txt</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span> unzip -q -o <span style="color: #006080;">"c:\Resources\temp\VSAgent\VSAgent.zip"</span> -d <span style="color: #006080;">"c:\Resources\temp\vsagentsetup"</span></pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span> c:\Resources\temp\vsagentsetup\testagent\setup.exe /q /f /norestart /unattendfile e:\approot\setupagent.ini</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span> net user vstestagent yourpasswordgoeshere /add</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span> net localgroup Administrators vstestagent /add</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span> REM Create a task that will run <span style="color: #0000ff;">with</span> full network privileges.</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span> net start Schedule</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span> schtasks /CREATE /TN <span style="color: #006080;">"Configure Test Agent Service"</span> /SC ONCE /SD 01/01/2020 /ST 00:00:00 /RL HIGHEST /RU admin /RP youradminpasswordgoeshere /TR e:\approot\configagent.cmd /F</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span> schtasks /RUN /TN <span style="color: #006080;">"Configure Test Agent Service"</span></pre>
<!--CRLF--></div>
</div>
<p>The only tricky bit in the script above is the fact that you need to configure a scheduled task that runs immediately to actually run a command line using credentials other than the system account.</p>
<p>The setupfw.cmd script is nothing more than a set of commands to open the common RPC/WMI/etc ports, plus the Agent Service default port on port 6901. Note that I tested this configuration only and I was not concerned about creating a least privilege or closed setup. This may need some tuning to be more secure.</p>
<div id="codeSnippetWrapper" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; width: 97.5%; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; cursor: text; border: silver 1px solid; padding: 4px;">
<div id="codeSnippet" style="text-align: left; line-height: 12pt; background-color: #f4f4f4; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;">
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum1" style="color: #606060;"> 1:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"RPC"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=rpc protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum2" style="color: #606060;"> 2:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"RPC-EP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=rpc-epmap protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum3" style="color: #606060;"> 3:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum4" style="color: #606060;"> 4:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 135 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=135 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum5" style="color: #606060;"> 5:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 135 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=135 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum6" style="color: #606060;"> 6:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 136 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=136 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum7" style="color: #606060;"> 7:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 136 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=136 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum8" style="color: #606060;"> 8:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 137 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=137 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum9" style="color: #606060;"> 9:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 137 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=137 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum10" style="color: #606060;"> 10:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 138 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=138 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum11" style="color: #606060;"> 11:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 138 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=138 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum12" style="color: #606060;"> 12:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 139 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=139 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum13" style="color: #606060;"> 13:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 139 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=139 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum14" style="color: #606060;"> 14:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum15" style="color: #606060;"> 15:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 445 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=445 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum16" style="color: #606060;"> 16:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 445 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=445 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum17" style="color: #606060;"> 17:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum18" style="color: #606060;"> 18:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 6901 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=6901 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum19" style="color: #606060;"> 19:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 6901 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=6901 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum20" style="color: #606060;"> 20:</span>  </pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum21" style="color: #606060;"> 21:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 6910 TCP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=6910 protocol=tcp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: #f4f4f4; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum22" style="color: #606060;"> 22:</span> netsh advfirewall firewall add rule name=<span style="color: #006080;">"Port 6910 UDP"</span> dir=<span style="color: #0000ff;">in</span> action=allow service=any enable=yes profile=any localport=6910 protocol=udp</pre>
<!--CRLF-->
<pre style="text-align: left; line-height: 12pt; background-color: white; margin: 0em; width: 100%; font-family: 'Courier New', courier, monospace; direction: ltr; color: black; font-size: 8pt; overflow: visible; border-style: none; padding: 0px;"><span id="lnum23" style="color: #606060;"> 23:</span>  </pre>
<!--CRLF--></div>
</div>
<p>Now that the scripts are ready, how is this deployed to Windows Azure? Let&rsquo;s talk about that in the next part of the post.</p>]]></content:encoded>
    </item>
    <item>
      <title>Load Testing with Agents running on Windows Azure – part 1</title>
      <link>https://docs.microsoft.com/archive/blogs/ricardo/load-testing-with-agents-running-on-windows-azure-part-1</link>
      <pubDate>Fri, 08 Apr 2011 01:00:00 GMT</pubDate>
      <dc:creator><![CDATA[rlfh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ricardo/2011/04/08/load-testing-with-agents-running-on-windows-azure-part-1/</guid>
      <description><![CDATA[** Important note&nbsp;&ndash; Please read before reading further **
The content in this post was...]]></description>
      <content:encoded><![CDATA[<hr />
<p><strong><span style="color: #ff0000;">** Important note&nbsp;&ndash; Please read before reading further **</span></strong></p>
<p>The content in this post was first&nbsp;written in 2011, exploring the earlier versions of Windows Azure. Since then, Windows Azure has evolved quite a lot, as well as other services in the Microsoft portfolio.</p>
<p>We now have an official solution to run load tests on Azure - load testing is part of Team Foundation Service and a preview is available. If you haven't tried it already, I'd encourage you to try it.</p>
<p>Find out more at <a href="https://aka.ms/loadtfs">https://aka.ms/loadtfs</a>.</p>
<p>&nbsp;</p>
<hr />
<p>I&rsquo;ve been following the cloud computing scene with some interest as I find cloud computing to be quite an interesting approach to IT for some/many companies. There are a few characteristics of cloud computing that I find very useful (and why not, exciting!), in particular the concepts around elasticity, when you scale to meet demand without worrying about hardware constraints, and the pay-as-you-go model, so that you are only charged when you actually deploy and use the system.</p>
<p>Of course a big part of getting value from cloud computing is identifying the most adequate workloads to take to the cloud, so after some thinking (and based on some needs from a customer) I&rsquo;ve decided to try to make a Load Testing rig where the Agents are running on Windows Azure. This scenario has some aspects that make it &ldquo;cloudable&rdquo;:</p>
<ul>
<li>Running the Agents as Windows Azure instances allows me to quickly create more of them and, thus, generate as much load as I can;</li>
<li>A load test rig is not something which is used 24x7, so it&rsquo;d be nice to just destroy the rig and not having it around if not needed.</li>
</ul>
<p>So, my first step was to decide how to design this and where to place each component (cloud or on-premises) to test a more or less typical application. Based on some decisions I&rsquo;ll explain later in the post, I came up with this design:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/0363.AzureLoadTesting1_60D2F049.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/0363.AzureLoadTesting1_5F00_60D2F049.jpg"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: block; float: none; margin-left: auto; margin-right: auto; padding-top: 0px; border-width: 0px;" title="AzureLoadTesting1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/8308.AzureLoadTesting1_thumb_454DEE46.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/8308.AzureLoadTesting1_5F00_thumb_5F00_454DEE46.jpg" alt="AzureLoadTesting1" width="449" height="256" border="0" /></a></p>
<p>The major components are:</p>
<ul>
<li><strong>Agents</strong> &ndash; As intended, they should be running on Windows Azure so I could make the most of the cloud&rsquo;s elasticity;</li>
<li><strong>Controller</strong> &ndash; I took some time deciding on where the controller should be located: cloud or on-premises. The Controller plays an important part in the testing process as it must communicate with both the agents, to send them work to do and collect their performance data, and the system being tested, to collect performance data. Because of this, some sort of cloud/on-premises communication would be needed. I decided to keep the controller on-premises mostly because the other option would imply having to either open the firewalls to allow connection between a Controller on the Cloud and, for example, a Database server or to deploy the Windows Azure Connect plugin to the database server itself. For the customer, I was thinking of this was not feasible.</li>
<li><strong>Windows Azure Connect</strong> &ndash; The Windows Azure Connect endpoint software must be active on all Azure instances and on the Controller machine as well. This allows IP connectivity between them and, given that the firewall is properly configured, allows the Controller to send work loads to the agents. In parallel, and using the LAN, the Controller will collect the performance data on the stressed systems, using the traditional WMI mechanisms.</li>
</ul>
<p>Once I knew what I wanted to design, my next step was to start working hands-on on the scripts that would enable this to be built. My ultimate goal was to have something fully automated, I wanted as less manual work as possible. I also knew I had to make a decision about the type of role to be used for the Agent instances: web, worker or VM.</p>
<p>I&rsquo;ll explore these topics in the next parts of this post.</p>]]></content:encoded>
    </item>
    <item>
      <title>Documentation fine print #1 – ViewFormPagesLockdown</title>
      <link>https://docs.microsoft.com/archive/blogs/ricardo/documentation-fine-print-1-viewformpageslockdown</link>
      <pubDate>Wed, 07 Jul 2010 06:05:35 GMT</pubDate>
      <dc:creator><![CDATA[rlfh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ricardo/2010/07/07/documentation-fine-print-1-viewformpageslockdown/</guid>
      <description><![CDATA[(this is the first of a series of posts to document and discuss problems that come up from not...]]></description>
      <content:encoded><![CDATA[<p>(this is the first of a series of posts to document and discuss problems that come up from not noticing a detail in the documentation)</p>  <p>One of my customers was trying to use the ViewFormPagesLock   <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:98fa1750-6878-409b-9606-47d504f1bb2b" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/sharepoint+documentation+configuration+planning+architecture" rel="tag">sharepoint documentation configuration planning architecture</a></div> down feature in SharePoint 2007 to restrict access from anonymous users to the form pages which can be used to list items or view them individually.</p>  <p>This is often a good practice for external anonymous access and is a technique described in the “<a href="http://technet.microsoft.com/en-us/library/cc263468(office.12).aspx" target="_blank">Plan security for an external anonymous access environment</a>” chapter from the <a href="http://technet.microsoft.com/en-us/library/cc261834(office.12).aspx" target="_blank">Planning and Architecture for Office SharePoint 2007</a> technical library on TechNet.</p>  <p>The customer had activated the feature as described in the <a href="http://blogs.msdn.com/b/ecm/archive/2007/05/12/anonymous-users-forms-pages-and-the-lockdown-feature.aspx" target="_blank">procedure published on the ECM team blog</a>, but things were not working as expected as the anonymous users still had access to pages like /Forms/AllItems.aspx.</p>  <p>Re-reading the post, I noticed a small detail right after the command. It read:</p>  <blockquote>   <p>This will enable the lockdown feature on your site collection. If you already had anonymous access enabled, you'll need to go disable it, then enable it again.</p> </blockquote>  <p>Because this was placed after the command, I figured that the customer may have missed so I suggested they’d give a try and voilá! </p>  <p>Lesson learned: the anonymous access to a site collection needs to be reset (disabled and enabled) after the ViewFormPagesLockdown feature is enabled.</p>]]></content:encoded>
    </item>
    <item>
      <title>Reflections on troubleshooting</title>
      <link>https://docs.microsoft.com/archive/blogs/ricardo/reflections-on-troubleshooting</link>
      <pubDate>Thu, 24 Jun 2010 05:43:02 GMT</pubDate>
      <dc:creator><![CDATA[rlfh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ricardo/2010/06/24/reflections-on-troubleshooting/</guid>
      <description><![CDATA[I spend most of my work time troubleshooting or managing the process of troubleshooting technical...]]></description>
      <content:encoded><![CDATA[<p>I spend most of my work time troubleshooting or managing the process of troubleshooting technical issues onsite, with the customer teams and with Microsoft’s support people. Doing that so often, I’m found wondering on what knowledge can I take from each problem to the next and how can that be organized and used to improve how efficiently my approach to the problem is.</p>  <p>Don’t get me wrong, I’m not talking only about technical knowledge. My goal for this post is to reflect on how is the troubleshooting process usually done, the different approaches and the pros and cons of each, and also the different steps in each approach.</p>  <p>I’m not really following any methodology or have read any literature about this topic, I’m just venting and putting out some of the experiences I’ve had in the past. </p>  <h1>“Houston, we have a problem.”</h1>  <p>Something similar to this is frequently heard at 9am or 5pm. I’m not sure if there is a statistical correlation between time of the day and problem occurrence, but I do know that the person carrying the message will most likely:</p>  <p>a) not have any information about the problem, except for the fact that he/she has one;</p>  <p>b) not tell you the correct information about the problem;</p>  <p>c) include several problems in one;</p>  <p>d) be very, very nervous or under pressure.</p>  <p>Points a), b) and c) all relate to the way the problem is characterized and scoped, in the next section. Point d) will need some management skills to keep the information flowing and prevent everyone involved from panic. Let’s think about each one of these topics in detail.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/5635.tshooting_64DAC1AC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/5635.tshooting_5F00_64DAC1AC.png"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" class="wlDisabledImage" title="tshooting" border="0" alt="tshooting" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/7360.tshooting_thumb_598187A2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/7360.tshooting_5F00_thumb_5F00_598187A2.png" width="840" height="95" /></a></p>  <h1>Detailing the issue</h1>  <p>Gathering and organizing the information is one of the most critical steps in the whole process. Your very first step is to find out what is, in fact, the issue. Some crucial question arise here such as:</p>  <p>- What is the impact of issue?</p>  <p>- Does it affect every user?</p>  <p>- What symptoms are you seeing?</p>  <p>- Is it happening all the time?</p>  <p>- Is it happening now?</p>  <p>- Has it happened before? How did we fix it back then? (a good knowledge base is helpful here)</p>  <p>- Was there some change to the system lately? (a good change management process is helpful here)</p>  <p>- What actions have you already taken?</p>  <p>- Is your goal a root-cause analysis or just restoring the service? (setting the expectations with this question is important and may save you from some political problems later)</p>  <p>I find myself faced with systems I don’t know anything about, so identifying the architecture pieces and the way the problematic feature works with each is relevant. This will give you an idea of the machines, products, technologies and dependencies involved and may even give you some hints on the cause of the problem. You don’t need to go into the details of every machine, but typical information such as OS, patch level and the way the information flows between systems (identifying who is the client and server and the protocols involved) should be included.</p>  <p>If the problem is affecting just some of the different components of the system, breaking it down and defining the dependencies will allow you to choose which area to check first.</p>  <p>If you’re handling a really critical situation, then point d) above comes into play and you should worry about communication. Try to keep everyone aligned for example by drawing the picture of the system and listing the symptoms on a board. This is probably not the best time to stop and write an e-mail unless you have someone who can help you with that.</p>  <h1>Defining an action plan</h1>  <p>Assuming that you’ve got the information above and you trust it to be true, you should have a clearer picture of what are the users experiencing which is not the normal behavior of the system. Your next step, then, is to set up an action plan to start attacking the problem.</p>  <p>The action plan must start with a clear goal, i.e, what are you trying to gather, prove or fix, and then include the steps that will be taken to achieve that goal. Remember the communication concerns we mentioned before? Well, if you keep everyone up-to-date and aligned in terms of the actions that will be performed and the goals that we want to achieve, it will probably help reduce the tension and make everyone work together. Note that there may not be a single possible action plan nor will your first goal be &quot;solve the issue”. After all, if you knew the cause of the problem, it would be easy to fix it, right?</p>  <p>If your plan has the goal of solving the issue, for example through some configuration change, how can you measure if the issue was solved? What are you metrics? Hard and factual data is relevant here, because it will prove the issue is gone.</p>  <p>There are different approaches to investigating a problem. If you’re really comfortable about the technology or system and you suspect some part of it to be the root cause, you could take a <strong>bottom-up approach </strong>and start by going really deep on one or only a few components. If your gut feeling is right, then this will be a fast path to success, but if it’s wrong it could prove to be a waste of time. Being able to do this takes some experience with the technology and a good set of similar problems in your luggage.</p>  <p>The opposite approach is obviously the <strong>top-down approach</strong>. It starts by taking a look at indicators and monitoring from the systems at a very high level and try to dig deeper when you find something strange. If you don’t know where to start, this might be a good way to organize the work, but it may take you some time to actually get to the core of things and be able to find out interesting information.</p>  <p>Another possible way to plan your work is something I find quite similar to <a href="http://en.wikipedia.org/wiki/Binary_search" target="_blank">binary searching</a>. Like in the algorithm, try to divide the system in half (or at least in large enough parts) and work top-down on each one. If you find that a certain part of the system is working correctly then you can rule them out completely and focus on the other side. If you can isolate some components, then it’s easier to choose to ones you want to dig into. I try using this pattern when I’m troubleshooting because I feel it’s usually more effective. It requires a good knowledge of the way different components interface and communicate, especially transport and data protocols, and which monitoring and logging data is associated with the interface mechanisms. </p>  <p>Regardless of your chosen approach, follow your action plan, gather the information you needed and proceed to the next step.</p>  <h1>Evaluate your last move</h1>  <p>Once you’ve achieved the goal established for the action plan, it’s time to evaluate what was done and the information that was collected. Here, you need to recall the goals you established for your action plan. Were they accomplished? </p>  <p>If your plans were to gather more information, then what does that information show? Does it point to a suspect or is everything looking normal? If you were planning to change some setting and fix the problem, did it work? </p>  <h1>Start over or celebrate!</h1>  <p>Troubleshooting, much like the scientific method, is an iterative task and it may require you to go through the last 2 steps several times before you understand what’s going on.</p>  <p>If your action plan did not work or if only showed the need for further actions, plan them the same way you did before and set the wheels in motion. If your problem is gone, then your work is done.</p>  <p>At this point, it may be a good idea to debrief and discuss what happened and to work proactively on how the problem can be prevented or at least predicted. This way, you’ll learn something from the situation that can potentially save time, money and the day later on.</p>  <p>These were my thoughts on managing troubleshooting processes based on my personal experience. Feel free to comment and share yours.</p>]]></content:encoded>
    </item>
    <item>
      <title>How to use fiddler and HTTP replay to have an offline copy of your site</title>
      <link>https://docs.microsoft.com/archive/blogs/ricardo/how-to-use-fiddler-and-http-replay-to-have-an-offline-copy-of-your-site</link>
      <pubDate>Tue, 22 Jun 2010 03:37:00 GMT</pubDate>
      <dc:creator><![CDATA[rlfh]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/ricardo/2010/06/22/how-to-use-fiddler-and-http-replay-to-have-an-offline-copy-of-your-site/</guid>
      <description><![CDATA[Very often, I&rsquo;m asked to troubleshoot some client-side issue regarding web applications....]]></description>
      <content:encoded><![CDATA[<p>Very often, I&rsquo;m asked to troubleshoot some client-side issue regarding web applications. Because, most of those times, I&rsquo;m not onsite at the customer experiencing the issue, or because often this issue occurs on some remote site or branch office, it can sometimes be tough to replicate the problem or to gather enough and relevant information to troubleshoot or to try some real-time debugging techniques.</p>
<p>A very interesting way to achieve this is by using a combination of a very well-known tool, Fiddler, and a somewhat unknown tool called Http Replay. With these tools, we&rsquo;ll work on creating an offline mirror of the browsing experience of a site, that can easily be packaged and sent to a developer for a more detailed look.</p>
<p>We&rsquo;ll start by downloading and installing the tools. Just go <a href="http://www.fiddlertool.com">here</a> and <a href="http://www.microsoft.com/downloads/details.aspx?familyid=d25ba362-c17b-4d80-a677-1faff862e629&amp;displaylang=en&amp;tm">here</a> and get the bits to your machine. Then, execute both installers to setup the applications.</p>
<p>Our next step is to gather a Fiddler trace. This is something most web application developers are used to, so it should be familiar to you. Just fire up Fiddler and navigate to your desired web site.</p>
<p>The goal here is to visit every page and resource that you want to make available offline, so be sure to clear your browser cache before start collecting data so that all images and javascript files, which are normally cached are actually loaded and, therefore, show up on the Fiddler trace.</p>
<p>Here&rsquo;s a sample of Fiddler after tracing <a href="http://www.microsoft.com">www.microsoft.com</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/06/42/metablogapi/6558.clip_image002_208AE60A.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/6558.clip_5F00_image002_5F00_208AE60A.jpg"><img height="167" width="244" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/6165.clip_image002_thumb_488D6F5C.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/6165.clip_5F00_image002_5F00_thumb_5F00_488D6F5C.jpg" alt="clip_image002" border="0" title="clip_image002" style="border-bottom: 0px; border-left: 0px; margin: 0px; display: inline; border-top: 0px; border-right: 0px" /></a></p>
<p>Now, create a trace file, going to File, Save All Sessions and storing the saz file somewhere on your hard drive. This file holds all the necessary information for HTTP Replay to mimic <a href="http://www.microsoft.com">www.microsoft.com</a> offline, which is what we&rsquo;ll do next.</p>
<p>HTTP Replay works as an HTTP proxy that either returns the stored response for an HTTP request it knows (because it&rsquo;s stored on some trace file) or forwards the request to the actual server, if available.</p>
<p>To replay from a Fiddler log, you&rsquo;ll need to:</p>
<p>- rename the "SAZ" file to "ZIP" </p>
<p>- extract the "raw" directory </p>
<p>- run HTTPREPLAY.CMD passing the "raw" directory as the logfilename</p>
<p>To start HTTP Replay, open a command prompt and cd to C:\Program Files\HTTPREPLAY or C:\Program Files (x86)\HTTPREPLAY on an x64 system. Next, execute a command similar to HTTPREPLAY.CMD &lt;logfilename&gt;, for example, HTTPREPLAY.CMD C:\temp\raw.</p>
<p>This is will fire up a browser that shows the requests contained in the trace file provided. It should be similar to this:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/3487.clip_image004_5FD873CD.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/3487.clip_5F00_image004_5F00_5FD873CD.jpg"><img height="129" width="244" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/06/42/metablogapi/1665.clip_image004_thumb_71685E98.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/CommunityServer-Blogs-Components-WeblogFiles/00-00-01-06-42-metablogapi/1665.clip_5F00_image004_5F00_thumb_5F00_71685E98.jpg" alt="clip_image004" border="0" title="clip_image004" style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" /></a></p>
<p>Note that these are the same requests that the Fiddler trace contained and that the screenshot above showed.</p>
<p>Now, just follow the instructions on the page: clear your browser cache, change the proxy to localhost:81 and click on the first link. For each request, the command prompt running HTTP Replay will show some output like this:</p>
<p>23:30:39:040 #0 - New connection accepted (127.0.0.1:64308)</p>
<p>23:30:39:083 #0 - 127.0.0.1:64308 -&gt; :81 (2691 bytes / total : 2691 bytes)</p>
<p>23:30:39:084 #0 - GET http://www.microsoft.com/ [FOUND]</p>
<p>Each time a request is FOUND, it is returned from the trace file which is disconnected from the server. With this tool and the above steps, you can now replicate your site&rsquo;s behavior and troubleshoot client-side easily. </p>
<p>As a last note, there are some interesting settings that you can use for HTTP Replay, the most interesting of which is the RESPECTTIMINGS option which makes HTTP Replay take as much time as the original request took to serve the response. However, for this you can&rsquo;t use a Fiddler trace and you must use another tool called <a href="http://www.microsoft.com/downloads/details.aspx?familyid=F5EC767F-27F2-4FB3-90A5-4BF0D5F4810A&amp;displaylang=en">STRACE</a>.</p>]]></content:encoded>
    </item>
  </channel>
</rss>