<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>suhasaraos</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/suhasaraos/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/suhasaraos/feed.xml</link>
    <description />
    <lastBuildDate>Wed, 17 Apr 2019 03:27:21 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure Event Grid - Making the Cloud Reactive</title>
      <link>https://docs.microsoft.com/archive/blogs/suhasaraos/azure-event-grid-reactive-cloud</link>
      <pubDate>Sun, 22 Oct 2017 15:56:50 GMT</pubDate>
      <dc:creator><![CDATA[SuhasRao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/suhasaraos/?p=115</guid>
      <description><![CDATA[With serverless computing becoming more pervasive, the older models for communication based on long...]]></description>
      <content:encoded><![CDATA[With serverless computing becoming more pervasive, the older models for communication based on long polling or hammer polling doesn't really gel well in a serverless application architecture. What we need is a service that will enable event-based reactive programming on the cloud. A service that can react to events and then execute the necessary programming logic. This is where Event Grid comes in.
<h3>What is Event Grid?</h3>
According to the online documentation - Azure Event Grid is a <strong>fully-managed</strong> <strong>intelligent</strong> event routing service that allows for uniform event consumption using a publish-subscribe model.

I have bolded the two important words in the above definition.
<ul>
 	<li>Azure Event Grid is a<strong> fully-managed</strong> event routing service which greatly simplifies the development of event-based applications and simplifies the creation of serverless workflows. Using a single service, Azure Event Grid manages all routing of events from any source, to any destination, for any application.</li>
 	<li>Azure Event Grid, is also <strong>intelligent</strong>, i.e. it enables direct event filtering using event type, prefix or suffix, so your application will only need to receive the events you care about. Whether you want to handle built-in Azure events, like a file being added to storage, or you want to produce your own custom events and event handlers, Event Grid enables this through the same underlying model. Thus, no matter the service or the use case, the intelligent routing and filtering capabilities apply to every event scenario and ensure that your apps can focus on the core business logic instead of worrying about routing events.</li>
</ul>
<img src="https://azurecomcdn.azureedge.net/mediahandler/acomblog/media/Default/blog/ff3644c9-58ab-4729-8939-66a83ab0605d.png" width="685" height="318" class="" />

As shown above, Blob Storage, Resource Groups, Azure Subscriptions, Event Hubs, Custom Topics (custom apps) are a few event Publishers and Azure Functions, Logic Apps, Azure Automation, Webhooks are a few event Subscribers supported by Event Grid as of writing this blog. But with even more event sources and destinations expected later this year, including Azure Active Directory, API Management, IoT Hub, Service Bus, Azure Data Lake Store, Azure Cosmos DB, Azure Data Factory, and Storage Queues, it will be a formidable service to watch out for.
<h3>Wait.. Isn't this identical to Azure Service Bus ?</h3>
It can be confusing when there are multiple <span>identical </span>technologies doing similar stuff. Specifically, Event Grid's resemblance to Azure Service Bus Topics is hard to ignore, <span>but there are significant differences and a reason for each of their existence. </span>

Service Bus is really an <strong>enterprise messaging</strong> product. If you're moving money or material you probably want transactions, dead-lettering, duplicate detection, sessions and other capabilities that Service Bus provides you. Event Grid is <strong>really about eventing</strong>, not enterprise messaging.  Service Bus is better for financial transactions and workflows, Event Grid is for reactive programming in the cloud.

Another significant difference lies in the fact that events are<strong> pushed to 'subscribers'</strong> in the Event Grid unlike Service Bus where the ‘subscribers’ have to poll the queue, get the message and process it. There are also differences in parameters like throughput and message/event sizes. Event Grid promises 10 million events per second, per region, which is far more than what Azure Service Bus can handle.
<h3>What about Azure Event Hubs?</h3>
There is no such thing as Event Hub vs Event Grid, rather, they complement each other. Azure Event Hub is used more for the telemetry scenarios. A great example is Azure Application Insight which under the hood uses Azure Event Hub to capture the telemetry information.

This excellent sample demonstrates how Event Hub and Event Grid complement each other - <a href="https://github.com/Azure/azure-event-hubs/tree/master/samples/e2e/EventHubsCaptureEventGridDemo">https://github.com/Azure/azure-event-hubs/tree/master/samples/e2e/EventHubsCaptureEventGridDemo</a>
<h3>So is this like AWS Simple Notification Service?</h3>
Again, similar, but here the difference lies in the the way its integrated with core cloud services. In AWS, developers need to explicitly connect SNS infrastructure to services like S3 to receive bucket and object related notifications. Azure In Event Grid, developers can quickly consume the events generated by these services without any explicit configuration. Another minor difference lies in the way data is filtered. While SNS dumps every event at the consumer, Event Grid subscribers can choose a subset of events through filters.
<h3>What else do we get?</h3>
<ul>
 	<li>Near-real-time event delivery</li>
 	<li>Fan-out - Subscribe multiple endpoints to the same event to send copies of the event to as many places as needed.</li>
 	<li><span>Massive scale - Supports high-volume workloads with support for millions of events per second.</span><span> </span></li>
 	<li>Reliable Delivery - Event Grid will perform an exponential back off for all deliveries. Ex: If your WebHook does not return a HTTP 2xx, the retry begins immediately. When the back off interval reaches one hour, retries will be performed every hour. After 24 hours, the service will stop attempting to deliver events</li>
</ul>
<h3>What can we do with Event Grid?</h3>
<p class="lf-text-block lf-block">Azure Event Grid provides several capabilities that vastly improve serverless, ops automation, and integration work:<span class="lf-thread-btn"></span></p>

<h4 id="serverless-application-architectures"><strong>Serverless application architectures</strong></h4>
<p class="lf-text-block lf-block"><img src="https://docs.microsoft.com/en-us/azure/event-grid/media/overview/serverless_web_app.png" alt="Serverless application" class="alignnone" width="443" height="131" /><span class="lf-thread-btn"></span></p>
<p class="lf-text-block lf-block">To connect various cloud services so as to react to changes. For example, use Event Grid to instantly trigger a serverless function to run image analysis each time a new photo is added to a blob storage container. Another example could be that of an ad-serving app built on Azure publishes millions of events to an application topic that has several event subscriptions connected to it. All events are pushed to SQL Data Warehouse <strong>and are also</strong> sent to one of several custom Node.js apps for processing, <strong>based on the origin</strong> of the event.</p>

<h4 id="ops-automation"><strong>Ops Automation</strong></h4>
<p class="lf-text-block lf-block"><img src="https://docs.microsoft.com/en-us/azure/event-grid/media/overview/ops_automation.png" alt="Ops automation" class="alignnone" width="387" height="134" /><span class="lf-thread-btn"></span></p>
<p class="lf-text-block lf-block">Event Grid also allows to speed up automation and simplify policy enforcement. For example, Event Grid can notify Azure Automation when a virtual machine is created, or a SQL Database is spun up. These events can then be used to check that service configurations are compliant, tag virtual machines, or file work items, etc.</p>

<h4 id="application-integration"><strong>Custom Application integration</strong></h4>
<p class="lf-text-block lf-block"><img src="https://docs.microsoft.com/en-us/azure/event-grid/media/overview/app_integration.png" alt="Application integration" class="alignnone" width="225" height="131" /></p>
<p class="lf-text-block lf-block">Event Grid connects can also connect a custom app with other services. For example, we can create a custom topic to send your app's event data to Event Grid, and take advantage of its reliable delivery, advanced routing, and direct integration with Azure and use it in an Azure Function that is created with Webhook Trigger.</p>
<strong>In summary, </strong>Azure Event Hub is a great new addition to the big basket of Azure offerings which makes the services reactive  and also apps integration easier. It is huge step forward in the serverless model. Event Grid is in preview currently and uses a pay-per-event pricing model, costing $0.30 per million operations during preview ($0.60 after GA) and the first 100,000 operation per month are free.

<em>Images sourced from original documentation: <a href="https://docs.microsoft.com/en-us/azure/event-grid/">https://docs.microsoft.com/en-us/azure/event-grid/</a></em>]]></content:encoded>
    </item>
    <item>
      <title>How I cleared my 70-534 Exam – All the shortcuts you need to know!</title>
      <link>https://docs.microsoft.com/archive/blogs/suhasaraos/how-i-cleared-my-70-534-exam-all-the-shortcuts-you-need-to-know</link>
      <pubDate>Mon, 10 Jul 2017 12:09:02 GMT</pubDate>
      <dc:creator><![CDATA[SuhasRao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/suhasaraos/?p=76</guid>
      <description><![CDATA[This is Part -2 (and the final one) of the 70-534: Architecting Microsoft Azure Solutions...]]></description>
      <content:encoded><![CDATA[This is Part -2 (and the final one) of the <a href="https://www.microsoft.com/en-us/learning/exam-70-534.aspx">70-534: Architecting Microsoft Azure Solutions Exam</a> Series. Click <a href="https://blogs.msdn.microsoft.com/suhasaraos/2017/06/25/exam-preparation-guide-70-534-architecting-microsoft-azure-solutions/">here </a>to Access Part -1.

Well, sorry if the title misguided you - there is no real shortcut, however with some sincere effort and some logical thinking it’s very easy to pass this exam with flying colors.

Who is this exam for? This is for both IT Pros and developers who are aspiring to become Cloud Solutions Architect, or for those who just want to understand and appreciate the breadth of Azure.

Let me take my case as an example – I have worked on very specific Azure Services over last 2 years or so – Web Apps, Mobile Apps, Service Fabric, IoT. So how much of this is covered in the exam – 5-10% (take a look at the exam objective - Design Azure Web and Mobile Apps), and the rest 90% - I had to prepare. The score to pass the exam is 700 out of 1000 and I scored 865 in my first attempt.

Look at my previous blog for some challenges in consolidated study material for this exam.

My consolidated documentation has a few <strong>Hands-on Labs</strong>, I did these simple hand-on lab exercises (shortcuts below), 19 of them, and each shouldn’t take more than half hour.
<ol>
 	<li><a href="https://docs.microsoft.com/en-us/powershell/azure/get-started-azureps?view=azurermps-4.1.0">Getting started with Azure PowerShell</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-create-first-template">Create your first Azure Resource Manager template</a>.</li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/virtual-network/virtual-networks-create-nsg-arm-pportal">Create network security groups</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/active-directory/active-directory-identityprotection-graph-getting-started">Azure Active Directory and Microsoft Graph</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/active-directory/connect/active-directory-aadconnect-azure-adfs">Deploying Active Directory Federation Services in Azure</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/storage/storage-encrypt-decrypt-blobs-key-vault">Encrypt and decrypt blobs in Microsoft Azure Storage using Azure Key Vault</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/active-directory-b2c/active-directory-b2c-setup-msa-app">Azure AD B2C</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/sql/relational-databases/security/encryption/transparent-data-encryption-with-azure-sql-database">Transparent Data Encryption with Azure SQL Database</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/active-directory/role-based-access-control-custom-roles">Custom Roles for Azure RBAC</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/aspnet/web-api/overview/hosting-aspnet-web-api/host-aspnet-web-api-in-an-azure-worker-role">Web API 2 in an Azure Worker Role</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-create-web-jobs">Run Background tasks with WebJobs</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-staged-publishing">Set up staging environments in Azure App Service</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/app-service-mobile/app-service-mobile-how-to-configure-active-directory-authentication">Configuring App Service application to use Azure Active Directory login</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-dotnet-how-to-use-topics-subscriptions">Service Bus Topics</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/scheduler/scheduler-get-started-portal">Azure Scheduler</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-create-experiment">Azure Machine Learning</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/app-service-web/web-sites-integrate-with-vnet">Integrate and App with a Virtual Network</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/backup/backup-try-azure-backup-in-10-mins">Back up files and folders in Resource Manager deployment</a></li>
 	<li><a href="https://docs.microsoft.com/en-us/azure/automation/automation-first-runbook-textual">Powershell Workflow Runbook</a></li>
</ol>
<strong>Here is how to prepare in three easy steps:</strong>
<ol>
 	<li>Read the <a href="https://blogs.msdn.microsoft.com/suhasaraos/?attachment_id=55">Azure documentation</a> (as in my previous blog) and make short notes. Like my notes <a href="https://msdnshared.blob.core.windows.net/media/2017/07/70-534-MyNotes.pdf">here</a>.</li>
 	<li>Do the hands-on lab exercises (Listed above).</li>
 	<li>Go through <a href="https://mva.microsoft.com/en-US/training-courses/certification-exam-overview-70534-architecting-microsoft-azure-solutions-17406">these videos and tips from Mark Grimes</a> just the day before your exam and co-relate them to your notes.</li>
</ol>
Just <strong>two important tips</strong> to keep in mind during the exam:
<ol>
 	<li>Time management:
<ol>
 	<li>Always keep an eye on the timer – if you don’t know an answer, click on the ‘Review Later’ checkbox and move on.</li>
 	<li>Case studies take up a lot of time, so be prepared:
<ol>
 	<li>Case studies are usually about Apps; they are net new for Azure or need to be migrated to Azure.</li>
 	<li>Write down some short notes in your erasable notepad about each App in the case study by quickly going through the business requirements and the technical requirements. This is important – For questions following the case study you will need to know the context when attempting to answer. Ex: You are asked to choose between Storage Queue and Service Bus Queue, now unless you got to know from the requirement, which told you that the application must store over 80 GB of messages in a queue, you wouldn’t know the right answer.</li>
 	<li>While quickly skimming through to get some context is important, don’t spend too much time (no more than 10mins on each case study), you just need to know where to find info when you see a related question.</li>
</ol>
</li>
</ol>
</li>
</ol>
<ol start="2">
 	<li>Elimination: For several questions, use logic and try to eliminate some of the wrong answers. Some answers are far from truth making your life easier.</li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>Exam Preparation Guide: 70-534 Architecting Microsoft Azure Solutions</title>
      <link>https://docs.microsoft.com/archive/blogs/suhasaraos/exam-preparation-guide-70-534-architecting-microsoft-azure-solutions</link>
      <pubDate>Sun, 25 Jun 2017 15:28:21 GMT</pubDate>
      <dc:creator><![CDATA[SuhasRao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/suhasaraos/?p=45</guid>
      <description><![CDATA[This is Part -1 of the 70-534: Architecting Microsoft Azure Solutions Exam Series. Click here to...]]></description>
      <content:encoded><![CDATA[<span>This is Part -1 of the </span><a href="https://www.microsoft.com/en-us/learning/exam-70-534.aspx">70-534: Architecting Microsoft Azure Solutions Exam</a><span> Series. Click </span><a href="https://blogs.msdn.microsoft.com/suhasaraos/2017/07/10/how-i-cleared-my-70-534-exam-all-the-shortcuts-you-need-to-know/">here<span> </span></a><span>to Access Part -2.</span>

For those of you preparing to take up the <a href="https://www.microsoft.com/en-us/learning/exam-70-534.aspx">70-534 exam </a>in next few months, here is some news  - the exam was revised on 22 Nov 2016 and the official Exam Ref book though useful, now has a lot of outdated content. A quick look at Amazon suggests that this is book is being revised and is likely to be available by Sep 2017.

There are also plenty of prep resources and courses out there, from Pluralsight, Udemy etc.

For my preparation, however, I decided to go based on the exam objectives as per the <a href="https://www.microsoft.com/en-us/learning/exam-70-534.aspx">official exam page </a>and referred to the <a href="https://docs.microsoft.com/en-us/azure/">Azure documentation </a>and this worked like a charm for me. One of my colleagues had already linked up all the exam resources as per the exam objectives and I found it invaluable in my preparation, please <a href="https://blogs.msdn.microsoft.com/make_it_better/2017/05/06/exam-prep-for-architecting-microsoft-azure-solutions-70-534/">visit his post</a> for all the links.

I usually like to read on my eReader while travelling to work, etc and found it easier to collate all the documentation and merge them into a PDF.

Here is the<strong> DOWNLOAD LINK</strong> to the PDF - <a href="https://blogs.msdn.microsoft.com/suhasaraos/?attachment_id=55">70-534 Prep Guide PDF</a> (<strong>Note</strong>: This content is just a collection of <a href="https://azure.microsoft.com/en-us/">Azure </a>Documentation based on exam objectives, merged into a PDF file, for the latest updates, please refer to the official <a href="https://docs.microsoft.com/en-us/azure/">Azure documentation site</a>, all credits goes to original authors)]]></content:encoded>
    </item>
    <item>
      <title>Test Drive the New TFS 2015 Build System</title>
      <link>https://docs.microsoft.com/archive/blogs/suhasaraos/test-drive-the-new-tfs-2015-build-system</link>
      <pubDate>Sat, 16 Jan 2016 17:44:00 GMT</pubDate>
      <dc:creator><![CDATA[SuhasRao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/suhasaraos/2016/01/16/test-drive-the-new-tfs-2015-build-system/</guid>
      <description><![CDATA[With TFS 2015, we have shipped a brand new build system, which replaces the Workflow/XAML-based...]]></description>
      <content:encoded><![CDATA[<p>With TFS 2015, we have shipped a brand new build system, which replaces the Workflow/XAML-based build engine that was part of previous editions. The new build&nbsp;system has a host of new capabilities such as:</p>
<ul>
<li><strong>Easy customization:</strong> &nbsp;No need to ramp up on XAML workflow to customize the build. Edit in the web and&nbsp;leverage existing knowledge of popular script languages.</li>
<li><strong>Cross-platform support:</strong> The build agents can now run not only on Windows, but also on Linux and Mac OSX.</li>
<li><strong>No more controllers:</strong> Agents can now span team project collections. Side-by-side installs and remote agents are xcopy (download from the web UI). And no need to install TFS on your build machines anymore.</li>
</ul>
<p><em>Read more</em>: <a href="https://msdn.microsoft.com/Library/vs/alm/Build/feature-overview">https://msdn.microsoft.com/Library/vs/alm/Build/feature-overview</a></p>
<p>In this blog, I'd like to&nbsp;describe and walk you through to show how easy it is to build a windows build agent and create a new build definition.</p>
<p>Before we begin, lets us make sure the build agent machine is set up with:</p>
<ul>
<li>An operating system that is supported by Visual Studio 2013 or newer</li>
<li>Visual Studio 2013 or Visual Studio 2015</li>
<li>PowerShell 3 or newer</li>
</ul>
<p><strong>Note:</strong> If you are not the Team Services account owner or an on-premises server team project collection administrator, make sure you have been added as an agent pool administrator.</p>
<p>Let&rsquo;s get started, login to the box you want to configure as the Build agent, navigate to the TFS Web URL home page, and click on Settings at top-right corner of the page.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/7848.image001.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/7848.image001.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/7848.image001.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/7848.image001.png" alt="" border="0" /></a></p>
<p>From the Control panel &gt; select the tab &lsquo;Agent Pools&rsquo;</p>
<p>Since this is the first agent we are configuring we will see the message &ndash; &lsquo;No agents are registered or you do not have permission to view the agents&rsquo; as shown 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/58/95/0003.image003.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/0003.image003.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/0003.image003.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/0003.image003.png" alt="" border="0" /></a>&nbsp;</p>
<p>Now click on the &lsquo;Download Agent&rsquo; option, download and extract the zip file to any location on the machine you want to configure as the build agent.</p>
<p>In case the zip file or any of its files are is &lsquo;blocked&rsquo;, &lsquo;unblock&rsquo; them.</p>
<p>Run the &lsquo;ConfigureAgent.cmd&rsquo; as administrator.</p>
<p>Few questions may be asked during this configuration step:</p>
<ol>
<li>Enter the name for this agent (default is Agent-SUTESIVS2013U4)</li>
<li>Enter the URL for the Team Foundation Server (default is ) https://sutestvs2013u4:8080/tfs/</li>
<li>Configure this agent against which agent pool? (default pool name is 'default')</li>
<li>Enter the path of the work folder for this agent (default is 'C:\TFS2015NewAgent\agent\_work')</li>
<li>Would you like to install the agent as a Windows Service (Y/N) (default is N)</li>
<li>Enter the name of the user account to use for the service (default is NT AUTHORITY\LOCAL SERVICE)</li>
</ol>
<p>Most questions are self-descriptive and we can choose to configure it as&nbsp;a Windows service, if desired. &nbsp;We can also create additional pools in which to run other instances of agents if required. For example, you might want to configure different security settings<br />for individual agents. For now, we will stick with the&nbsp;Default pool. Once run, we&nbsp;should see the following success message:</p>
<p>Installing service vsoagent.sutestvs2013u4.Agent-SUTESTVS2013U4...<br />Service vsoagent.sutestvs2013u4.Agent-SUTESTVS2013U4 has been successfully installed.<br />Creating EventLog source vsoagent.sutestvs2013u4.Agent-SUTESTVS2013U4 in log Application...&nbsp;&nbsp;</p>
<p>Refresh the TFS Portal page&nbsp;and Voila! we should&nbsp;now be able to see the new build agent and its capabilities.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/4118.image005.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/4118.image005.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/4118.image005.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/4118.image005.png" alt="" border="0" /></a></p>
<p>Next, let us&nbsp;create a simple new build definition.</p>
<p>First navigate back to Home page &gt; Select Team project and click on &lsquo;Build&rsquo; Menu. Here we can see the older XAML build definitions as well as the new Web-based Build Definitions. We can add a new build definition by clicking on the big &lsquo;+&rsquo; icon, which brings up the below dialog:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/4111.image007.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/4111.image007.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/4111.image007.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/4111.image007.png" alt="" border="0" /></a></p>
<p>The Definition Templates dialog helps us choose from either existing templates or start with an empty definition. Let us choose the empty definition and then add build steps by selecting the &lsquo;Add Build Step&rsquo; option. Clicking on &lsquo;Add Build Step&rsquo; brings us the following dialog.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/8267.image009.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/8267.image009.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/8267.image009.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/8267.image009.png" alt="" border="0" /></a>&nbsp;</p>
<p>Here, add the option &lsquo;Visual Studio Build&rsquo; and close the dialog. We can now select the solution location and save the definition with a name of our choice. &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/58/95/5001.image011.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/5001.image011.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/5001.image011.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/5001.image011.png" alt="" border="0" /></a>&nbsp;</p>
<p><strong>There are multiple other properties (variables, triggers, etc.) we can set and we can also add multiple build steps depending upon what we want to achieve </strong>&ndash; but that&rsquo;s for another day!</p>
<p>Once the build definition is saved, let us perform a quick test of our new build definition by queuing a new build &ndash; This should give us the sweet &lsquo;<strong>Build Succeeded&rsquo;</strong> message.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/1524.image013.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/1524.image013.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/1524.image013.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/1524.image013.png" alt="" border="0" /></a></p>
<p>We can also create a&nbsp;Custom Build Template that can be used as a starter for other build definitions. Or set a build definition as a team favorite for others to follow when creating their build definitions by right clicking on a build definition and selecting the required option as shown here:</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/58/95/0245.image015.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/0245.image015.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/0245.image015.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/266x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/0245.image015.png" alt="" border="0" /></a></p>
<p><em>Related article to build ClickOnce&nbsp;apps:</em> <a href="https://blogs.msdn.com/b/tfssetup/archive/2015/10/15/building-clickonce-apps-using-build-vnext.aspx">https://blogs.msdn.com/b/tfssetup/archive/2015/10/15/building-clickonce-apps-using-build-vnext.aspx</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>WebActivator – Under the hood</title>
      <link>https://docs.microsoft.com/archive/blogs/suhasaraos/webactivator-under-the-hood</link>
      <pubDate>Wed, 13 Aug 2014 16:43:00 GMT</pubDate>
      <dc:creator><![CDATA[SuhasRao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/suhasaraos/2014/08/13/webactivator-under-the-hood/</guid>
      <description><![CDATA[I have been seeing this little library being more increasingly used in recent packages. More...]]></description>
      <content:encoded><![CDATA[<p>I have been seeing this little library being more increasingly used in recent packages. More recently I see this used in Unity BootStrapper for MVC.</p>
<p>For those unfamiliar with WebActivator it&rsquo;s an incredibly useful tool to have if you are a packager or a framework developer. Read more: <a href="https://blogs.msdn.com/b/davidebb/archive/2010/10/11/light-up-your-nupacks-with-startup-code-and-webactivator.aspx">https://blogs.msdn.com/b/davidebb/archive/2010/10/11/light-up-your-nupacks-with-startup-code-and-webactivator.aspx</a></p>
<p>It basically provides three methods &ndash; PreStart(), PostStart and ShutDown() to which we can hook any custom code. What&rsquo;s the big deal, we can do this in Global.asax? Well, this becomes incredibly useful when one is making their own package and would like to perform certain actions when application starts or shuts down but don&rsquo;t want the package consumer to do these actions manually!</p>
<p>This little library really intrigued me on how it is possible to achieve it without hooking into the consuming code &ndash; so decided to perform a little bit of investigation to understand how it works and here is what I found.</p>
<p><strong>Step One: Long time - no see! Global Attributes.</strong></p>
<p>Global attributes have been in .NET for a very long time, but I have not seen them used much except for defining the usual title, description, version, etc AssemblyInfo.cs as shown in below example:</p>
<pre class="scroll"><code class="csharp">[assembly: AssemblyTitle("WindowsApplication1")]</code></pre>
<p class="scroll">More: <a href="https://msdn.microsoft.com/en-us/library/284c1c4s(v=vs.90).aspx">https://msdn.microsoft.com/en-us/library/284c1c4s(v=vs.90).aspx</a></p>
<p>This is what we find in WebActivator assembly:</p>
<pre class="scroll"><code class="csharp">[assembly: System.Web.<strong>PreApplicationStartMethod</strong>(typeof(ActivationManager), "Run")]</code>&nbsp;</pre>
<p><strong>Step Two: What is PreApplicationStartMethod?</strong></p>
<p>Turns out that this attribute in System.Web namespace was added in .NET 4.0 and is the key to functioning of WebActivator. The PreApplicationStartMethodAttribute constructor takes two parameters. First parameter is the Type of the class required to be called before an application starts and the second parameter is a string that represents the static method within the type to be called.</p>
<p>More: <a href="https://msdn.microsoft.com/en-us/library/system.web.preapplicationstartmethodattribute(v=vs.110).aspx">https://msdn.microsoft.com/en-us/library/system.web.preapplicationstartmethodattribute(v=vs.110).aspx</a></p>
<p>So we head to ActivationManager &gt; Run method.</p>
<p><strong>Step Three: Unravelling the mystery.</strong></p>
<p>As I slowly understand the code written in ActivationManager&rsquo;s static Run method, things become a little clearer.</p>
<p><strong>public</strong>&nbsp;static&nbsp;void&nbsp;<strong>Run</strong>()<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>if</strong>&nbsp;(!ActivationManager._hasInited)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>bool</strong>&nbsp;flag = Type.<strong>GetType</strong>("Mono.Runtime")&nbsp;!=&nbsp;<strong>null</strong>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>if</strong>&nbsp;(flag)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActivationManager.<strong>RunPreStartMethods</strong>(<strong>false</strong>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>else</strong><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActivationManager.<span style="background-color: #ffff00;"><strong>RunPreStartMethods</strong></span>(ActivationManager.<strong>IsInClientBuildManager</strong>());<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>if</strong>&nbsp;(HostingEnvironment.IsHosted)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Type typeFromHandle =&nbsp;<strong>typeof</strong>(ActivationManager.StartMethodCallingModule);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>if</strong>&nbsp;(flag)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;HttpModuleActionCollection modules =&nbsp;(WebConfigurationManager.<strong>GetWebApplicationSection</strong>("system.web/httpModules")&nbsp;<strong>as</strong>&nbsp;HttpModulesSection).Modules;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;modules.<strong>Add</strong>(<strong>new</strong>&nbsp;<strong>HttpModuleAction</strong>(typeFromHandle.FullName,&nbsp;typeFromHandle.AssemblyQualifiedName));<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>else</strong><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DynamicModuleUtility.<strong>RegisterModule</strong>(typeFromHandle);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>else</strong><br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActivationManager.<strong>RunPostStartMethods</strong>();<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActivationManager._hasInited =&nbsp;<strong>true</strong>;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>&nbsp;</p>
<p>Ok so there is a checkfor Mono.Runtime. Then the PreStartMethods are called. Obvious takeaway is hosting on mono is different and hence the flag. &nbsp;</p>
<pre class="scroll"><code class="csharp">RunPreStartMethods calls ActivationManager.RunActivationMethods&lt;PreApplicationStartMethodAttribute&gt;(designerMode);</code>&nbsp;</pre>
<p class="scroll">As shown below this code scans all the assemblies for all custom PreApplicationStartMethod attributes, orders them and invokes the methods. The same scheme of method invocation is true for PostApplicationStartMethodAttribute and ApplicationShutdownMethodAttribute, the difference is only when they are called.&nbsp;</p>
<p><strong>private</strong>&nbsp;static&nbsp;void&nbsp;RunActivationMethods&lt;T&gt;(<strong>bool</strong>&nbsp;designerMode =&nbsp;<strong>false</strong>)&nbsp;where&nbsp;T : BaseActivationMethodAttribute<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;IOrderedEnumerable&lt;T&gt;&nbsp;orderedEnumerable =&nbsp;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;att&nbsp;<strong>in</strong>&nbsp;ActivationManager.Assemblies.<strong>Concat</strong>(ActivationManager.AppCodeAssemblies).<strong>SelectMany</strong>((Assembly assembly)&nbsp;=&gt;&nbsp;assembly.GetActivationAttributes&lt;T&gt;())<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;orderby&nbsp;att.Order<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;select&nbsp;att;<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreach</strong>&nbsp;(T current&nbsp;<strong>in</strong>&nbsp;orderedEnumerable)<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>if</strong>&nbsp;(!designerMode&nbsp;||&nbsp;current.<strong>ShouldRunInDesignerMode</strong>())<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="background-color: #ffff00;">current.<strong>InvokeMethod</strong>(</span>);<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br /> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</p>
<p>That kind of solves the puzzle of how PreStartMethod is works.</p>
<p><strong>Step four: Post Start Method and let&rsquo;s shutdown! </strong></p>
<p>The PostApplicationStartMethodAttribute attribute allows to execute code after Application_Start method in Global.asax. But how is it determined. If we look back at the code in static Run method of ActivationManager class we will notice StartMethodCallingModule being registered. This is custom Http Module implementing IHttpModule interface with two methods - Init() and Dispose().</p>
<p>Inside Init() method RunPostStartMethods() is called. Also interesting to note here is that if the application is not hosted on IIS, activation method in this attribute will be invoked immediately after PreApplicationStartMethod.</p>
<p>Since HTTPModules may call Init() method more than once, there is a counter _initializedModuleCount inside a lock statement to ensure its called only once.</p>
<p>And now for the last attribute, ApplicationShutdownMethodAttribute, it&rsquo;s called in Custom HTTPModule&rsquo;s Dispose() method and the counter now runs in reverse and the shutdown methods will be invoked on dispose of the last module.</p>
<p><strong>private</strong>&nbsp;class&nbsp;StartMethodCallingModule : IHttpModule<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;<strong>private</strong>&nbsp;static&nbsp;object&nbsp;_lock =&nbsp;<strong>new</strong>&nbsp;object();<br />&nbsp;&nbsp;&nbsp;&nbsp;<strong>private</strong>&nbsp;static&nbsp;<strong>int</strong>&nbsp;_initializedModuleCount;<br />&nbsp;&nbsp;&nbsp;&nbsp;<strong>public</strong>&nbsp;void&nbsp;<strong>Init</strong>(HttpApplication context)<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>lock</strong>&nbsp;(ActivationManager.StartMethodCallingModule._lock)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>if</strong>&nbsp;(ActivationManager.StartMethodCallingModule._initializedModuleCount++&nbsp;==&nbsp;0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActivationManager.<span style="background-color: #ffff00;"><strong>RunPostStartMethods</strong></span>();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;<strong>public</strong>&nbsp;void&nbsp;<strong>Dispose</strong>()<br />&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>lock</strong>&nbsp;(ActivationManager.StartMethodCallingModule._lock)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>if</strong>&nbsp;(--ActivationManager.StartMethodCallingModule._initializedModuleCount ==&nbsp;0)<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ActivationManager.<span style="background-color: #ffff00;"><strong>RunShutdownMethods</strong></span>();<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}</p>
<p>If you are a custom package developer, this tool will come really handy. It can be downloaded from Nuget. The source is available at <a href="https://github.com/davidebbo/WebActivator">https://github.com/davidebbo/WebActivator</a></p>]]></content:encoded>
    </item>
    <item>
      <title>Installing SharePoint 2013 on a Single Server without a Domain Controller and using SQL Server Express</title>
      <link>https://docs.microsoft.com/archive/blogs/suhasaraos/installing-sharepoint-2013-on-a-single-server-without-a-domain-controller-and-using-sql-server-express</link>
      <pubDate>Sat, 06 Apr 2013 10:06:18 GMT</pubDate>
      <dc:creator><![CDATA[SuhasRao]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/suhasaraos/2013/04/06/installing-sharepoint-2013-on-a-single-server-without-a-domain-controller-and-using-sql-server-express/</guid>
      <description><![CDATA[As most of you may already be aware of, there is an option for a Stand-alone installation of...]]></description>
      <content:encoded><![CDATA[<p>As most of you may already be aware of, there is an option for a <em>Stand-alone</em> installation of SharePoint 2013 which uses a&nbsp;SQL Server Express instance as DB. As a developer wanting to try a few things out, I tried this installation first, however I was a little&nbsp;disappointed because of the multiple issues I ran into in this mode of installation, it was multiple uninstall - reinstall cycles with no luck! So I wanted to give the regular <em>Complete</em> installation a shot, but&nbsp;on a single virtual&nbsp;machine with a single core and 4GB of RAM running Windowa&nbsp;Server 2008 R2, it did not sound easy! But it turned out otherwise, fairly simple with a few workarounds though!</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/0804.SP2013_Ins_ServerTypeSel.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/0804.SP2013_5F00_Ins_5F00_ServerTypeSel.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/0804.SP2013_Ins_ServerTypeSel.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/0804.SP2013_5F00_Ins_5F00_ServerTypeSel.png" alt="" border="0" /></a></p>
<p>This blog describes the steps I took to install SharePoint 2013 in the <em>Complete</em> installation mode.</p>
<p>The installation of SharePoint 2013 in the <em>Complete</em> mode is fairly simple with a few clicks and some patience. It took about 15-20 mins for this to complete. Next is the SharePoint Products&nbsp;Configurations Wizard.&nbsp; On the screen shown below, the wizard doesn't allow to proceed without selecting the right version of SQL Server and specifying a domain account.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/2570.SP2013_Ins_SpecifyConfigDB.jpg" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/2570.SP2013_5F00_Ins_5F00_SpecifyConfigDB.jpg"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/2570.SP2013_Ins_SpecifyConfigDB.jpg" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/2570.SP2013_5F00_Ins_5F00_SpecifyConfigDB.jpg" alt="" border="0" /></a></p>
<p>I could have setup an Active Directory&nbsp;on the same box, but it is not recommended to install SharePoint on a Domain Controller. The other option was to setup a second virtual machine as AD-Controller and third as SQL Server. But then, I would have to manage three servers! So I closed the wizard window.</p>
<p><em><strong>Please note that following steps are good only for a development setup.</strong> </em></p>
<p>Next I installed&nbsp; SQL Server SQL Server 2008 R2 Expression Edition on the default instance and not the named instance.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/8712.SP2013_Ins_SQLExpress%20Instance.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/8712.SP2013_5F00_Ins_5F00_SQLExpress-Instance.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/8712.SP2013_Ins_SQLExpress%20Instance.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/8712.SP2013_5F00_Ins_5F00_SQLExpress-Instance.png" alt="" border="0" /></a>&nbsp;</p>
<p><strong><em>Note</em></strong> that SharePoint 2013 only supports SQL Server 2008 R2 (versions &gt;&nbsp;10.50.1600.1).&nbsp;You may use this link to install&nbsp;&nbsp;<a href="https://www.microsoft.com/en-us/download/details.aspx?id=30437" target="_blank">SQL Server 2008 R2 Express&nbsp;SP2</a>.</p>
<p>Once the SQL Server Express installation was complete, the trick is to use the powershell command: <a href="https://technet.microsoft.com/en-us/library/ff607838.aspx" target="_blank">New-SPConfigurationDatabas</a>e to create the&nbsp;Config DB.&nbsp;You can specify the local account here! I could use the Powershell to create the SharePoint_ConfigDB successfully.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/2022.SP2013_New_SPConfigurationDatabase.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/2022.SP2013_5F00_New_5F00_SPConfigurationDatabase.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/58/95/2022.SP2013_New_SPConfigurationDatabase.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-58-95/2022.SP2013_5F00_New_5F00_SPConfigurationDatabase.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>Once this was done, I went back to the SharePoint Products&nbsp;Configurations Wizard, and this time I had the default option of <em>Connect to an Existing Farm </em>checked.&nbsp;A few more clicks and I was ready to explore the new SharePoint 2013.&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>