<?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>Hanuk's Microsoft IoT Strategy Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/hanuk/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/hanuk/feed.xml</link>
    <description>Hanu Kommalapati&amp;#039;s musings on IoT architecture and implementation on Microsoft Azure platfrom</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:08:10 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Azure Service Fabric Cluster Behind A Firewall</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/azure-service-fabric-cluster-behind-a-firewall</link>
      <pubDate>Tue, 07 Jul 2015 23:44:00 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2015/07/07/azure-service-fabric-cluster-behind-a-firewall/</guid>
      <description><![CDATA[Hosting a Service Fabric cluster on Azure for internet hosted clients requires it to be deployed...]]></description>
      <content:encoded><![CDATA[<p>Hosting a Service Fabric cluster on Azure for internet hosted clients requires it to be deployed behind a load balancer with public IP. By default the services will not have any network listeners configured; so, each service needs to implement its own listener by overriding CreateCommunicationListener() defined in StatefulServiceBase and StatelessServiceBase classes; the signature is shown below:</p>
<pre><code>protected override ICommunicationListener CreateCommunicationListener() { ... } </code></pre>
<p>See <a href="https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-communication/">Service Communications Model</a> for guidance on implementing your own communications stack.</p>
<p>WcfCommunicationListner is provided by the Service Fabric SDK for hosting WCF endpoints inside stateful and stateless services. The usage of the listener is documented at <a href="https://azure.microsoft.com/en-us/documentation/articles/service-fabric-reliable-services-communication-wcf/">WCF Communication Listener</a>.</p>
<p>Current implementation of WcfCommunicationListener is not aware of the public IP address/FQDN; so, for NetTcpBinding it generates the following communication endpoint with private IP address:</p>
<pre><code>net.tcp://10.0.0.5:8080/7854ce3f-4e30-4949-b5e4-22cdcbd477c1/8f4106a5-0d38-4f30-aaf0-e435688e5ed6-130808019994632301 </code></pre>
<p>This will work fine if the client also located in the same network; however, for internet based access the local IP address will have to be replaced with the load balancer's public IP/FQDN.</p>
<p>To fix this issue, I used the following listener implementation that extended WcfCommunicationListener:</p>
<p><span style="font-family: 'courier new', courier;"><code> //WcfFabricCommunicationsListener.cs&nbsp; <br />using Microsoft.ServiceFabric.Services.Wcf; <br />using System; <br />using System.Collections.Generic; &nbsp; <br />using System.Linq;&nbsp; <br />using System.Text;&nbsp; <br />using System.Threading.Tasks;&nbsp; <br />using System.Fabric;&nbsp; <br />using System.Threading;&nbsp; <br />using System.ServiceModel;&nbsp; <br />using System.ServiceModel.Description;&nbsp; <br />public class WcfFabricCommunicationsListener: WcfCommunicationListener <br />{ <br />&nbsp; private string _gatewayFQDN; <br />&nbsp; public WcfFabricCommunicationsListener(Type communicationInterfaceType, object service) : base(communicationInterfaceType, service) { } <br />&nbsp; public WcfFabricCommunicationsListener(Type communicationInterfaceType, Type communicationImplementationType) : base(communicationInterfaceType, communicationImplementationType) { }&nbsp; <br />&nbsp; public override void Initialize(ServiceInitializationParameters serviceInitializationParameters)&nbsp; <br />&nbsp; {&nbsp; <br />&nbsp; &nbsp; &nbsp;ConfigurationPackage configPackage = serviceInitializationParameters.CodePackageActivationContext.GetConfigurationPackageObject("Config");&nbsp; <br />&nbsp; &nbsp; &nbsp;var infrastructureSection = configPackage.Settings.Sections["Infrastructure"];&nbsp; <br />&nbsp; &nbsp; &nbsp;_gatewayFQDN = infrastructureSection.Parameters["Gateway"].Value;&nbsp; <br />&nbsp; &nbsp; &nbsp;base.Initialize(serviceInitializationParameters);&nbsp; <br /> }&nbsp; <br /> public async override Task&lt;string&gt; OpenAsync(CancellationToken cancellationToken)&nbsp; <br /> {&nbsp; <br /> &nbsp;&nbsp;string partitionUrl = await base.OpenAsync(cancellationToken);&nbsp; <br /> &nbsp;&nbsp;if (_gatewayFQDN == null)&nbsp; <br /> &nbsp;&nbsp;{&nbsp; <br /> &nbsp;&nbsp; return partitionUrl;&nbsp; <br /> &nbsp;&nbsp;}&nbsp; <br /> &nbsp;&nbsp;UriBuilder ub = new UriBuilder(partitionUrl);&nbsp; <br /> &nbsp;&nbsp; ub.Host = _gatewayFQDN;&nbsp; <br /> &nbsp;&nbsp; return ub.ToString();&nbsp;</code></span></p>
<p><span style="font-family: 'courier new', courier;">&nbsp;&nbsp;} </span><br /><span style="font-family: 'courier new', courier;">}</span></p>
<p>Initialize() expects the definition of the FQDN of the gateway through Config package as shown in the following snippet of Settings.xml: &lt;!-- Settings.xml located in the Config directory of the service project --&gt;&nbsp;</p>
<p><span style="font-family: 'courier new', courier;">&lt;Settings&gt;&nbsp; </span><br /><span style="font-family: 'courier new', courier;"> &lt;!-- other stuff --&gt;&nbsp; </span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;Section Name="Infrastructure"&gt;&nbsp; </span><br /><span style="font-family: 'courier new', courier;">&nbsp; &nbsp;&lt;Parameter Name="Gateway" Value="mycluster.cloudapp.net" /&gt;&nbsp; </span><br /><span style="font-family: 'courier new', courier;">&nbsp; &lt;/Section&gt;&nbsp; </span><br /><span style="font-family: 'courier new', courier;">&lt;/Settings&gt;</span></p>
<p>OpenAsync() merely replaces the host IP address with the FQDN of the load balancer.</p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Service Fabric Sessions at Ignite 2015</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/azure-service-fabric-sessions-at-ignite-2015</link>
      <pubDate>Mon, 11 May 2015 15:52:39 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2015/05/11/azure-service-fabric-sessions-at-ignite-2015/</guid>
      <description><![CDATA[Some useful Azure Service Fabric sessions:

Building Resilient, Scalable Services with...]]></description>
      <content:encoded><![CDATA[<p>Some useful Azure Service Fabric sessions:</p>
<ul>
<li>Building Resilient, Scalable Services with Microsoft&nbsp;Azure Service Fabric by Vipul Modi, Vaclav Turecek: <a href="https://channel9.msdn.com/Events/Ignite/2015/BRK3730" target="_blank">https://channel9.msdn.com/Events/Ignite/2015/BRK3730</a></li>
<li>Microsoft Azure Service Fabric Architecture by Gopal&nbsp;Kakivaya : <a href="https://channel9.msdn.com/Events/Ignite/2015/BRK3717" target="_blank">https://channel9.msdn.com/Events/Ignite/2015/BRK3717</a></li>
<li>Deploying and Managing Services with Microsoft Azure&nbsp;Service Fabric by Chacko Daniel, Kunal Deep Singh: <a href="https://channel9.msdn.com/Events/Ignite/2015/BRK3478" target="_blank">https://channel9.msdn.com/Events/Ignite/2015/BRK3478</a></li>
<li>Service Orchestration with Microsoft Azure Service&nbsp;Fabric by Matthew Snider : <a href="https://channel9.msdn.com/Events/Ignite/2015/BRK3485" target="_blank">https://channel9.msdn.com/Events/Ignite/2015/BRK3485</a></li>
<li>Microsoft Azure Service Fabric Actors: The Director's Cut by Vipul Modi <a href="https://e.yammer.com/wf/click?upn=b4fCD7LRJuFwY9GZJgAvMuSq43QZbdYhS71mchfdD0WFmH1XGx0tQG4VnXgD82MtSAC8Vp9uV65NmKb0GNvdwA-3D-3D_9yN25jBcTtWOyFGKoYN90M1ElehaixtCpQjbjPaL5ny-2FYUzUlEmgow42LRKKBWgiifH51i990SK3yGKMLuXZOq7w04cgoLrUnGi1X8c9CdPrsKwfFNkNTHg1YtVmjSFVC56nRuBVDxbOnYDfK96Y-2BME89wrj6Lz6JtFkPwEi4a22ZuF57WbG9gkF4oZAs2Pxzhu-2FfDxbUu5noetUu0IpRmirG826pjBK0clLVyHZvn3KAoUBV3OUWpxfDI04q-2BPpUT37fiUATAeTnUUWOs6BAFr-2Fb4f3nqJj-2BMWIh69RB-2Beeuk-2FsqO-2FR6wuowidJkZeqpg0kd5kU6MUDXCCa6Ss55XPHJMJUbHpDALTbhxu4oN90YSbjWgLSmIcBOhPxCBETbRfR86mnZPmwQuGCZDAp5l3MRYyvhI4I3iKRTypjoV-2FSmxvdRa2jE-2FYtQkcbyXTlXst9dzG3qYDaUcn8CTKrhZReeG-2FUNaW-2BHs0lFVuPIQLu0BkLpoxafpmQ-2ByzKvfRw3hdD-2Bi0o-2FL6oMudTK0hiinAhgV5gYTmwZGgJYsZWV3tkOyzIsdN3I8NaFtZb3U-2FUW1IXruKrBQsn-2Btze41H-2BdQ-3D-3D" target="_blank">https://channel9.msdn.com/Events/Ignite/2015/BRK3476</a></li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>C# Tool to Simulate IOT Sensor Telemetry for OpenTSDB</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/c-tool-to-simulate-iot-sensor-telemetry-for-opentsdb</link>
      <pubDate>Tue, 21 Apr 2015 15:03:00 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2015/04/21/c-tool-to-simulate-iot-sensor-telemetry-for-opentsdb/</guid>
      <description><![CDATA[tsdbwriter is a simple .NET solution that writes a single metric (e.g. LivingRoom.Temperature,...]]></description>
      <content:encoded><![CDATA[<p>tsdbwriter is a simple .NET solution that writes a single metric (e.g. LivingRoom.Temperature, FlowSensor.FlowRate) in a given time range at a configurable sampling rate to OpenTSDB (<a href="https://opentsdb.net/">https://opentsdb.net/)</a>. The generated metric value is random within the given range&nbsp;that is&nbsp;specified in the&nbsp;configuration file.&nbsp;For now only analog metrics like temperature, pressure, flow, wind speed, etc. are supported. &nbsp;Discrete sensors like on/off will be added soon.</p>
<p>For generating a metric stream, simply execute MetricWriter.exe after changing Config.json, a sample of which is below:</p>
<p><span style="font-family: courier new,courier;">{</span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "TsdbHostName": "localhost", <span style="color: #008000;">//the DNS name of the TSDB HOST</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "TsdbPortNumber": "4242",&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000;">//TSDB port number; the default is 4242;</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "MetricName": "LivingRoom.Temperature", <span style="color: #008000;">//any meaningful name</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "StartDate": "01/01/2013",&nbsp;<span style="color: #008000;">//mandatory</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "EndDate": "01/2/2013",&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #008000;">//if missing, current&nbsp;date will be used</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "SamplingIntervalMinutes": "5",&nbsp;<span style="color: #008000;">//minutes</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "MetricLow": "65",&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008000;">//low end of the metric</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "MetricHigh": "85",&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <span style="color: #008000;">//high end of the metric</span></span><br /><span style="font-family: courier new,courier;">&nbsp;&nbsp;&nbsp; "Tags": { "app": "test" }&nbsp; <span style="color: #008000;">//comma separated list of name:value pairs</span></span><br /><span style="font-family: courier new,courier;">}</span></p>
<p>The project is located at: <a href="https://github.com/hanuk/tsdbwriter">https://github.com/hanuk/tsdbwriter</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>TypeC -  Why?</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/typec-why</link>
      <pubDate>Thu, 02 Apr 2015 09:29:32 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2015/04/02/typec-why/</guid>
      <description><![CDATA[I didn't expect such a&nbsp;strong reaction and hence wanted to offer clarification; I was looking...]]></description>
      <content:encoded><![CDATA[<p>I didn't expect such a&nbsp;strong reaction and hence wanted to offer clarification; I was looking for a framework that helps me do the following:</p>
<ol>
<li>Namespace support: binding multiple implementations&nbsp;to the same base class/interface without collisions&nbsp;</li>
<li>Configuration driven type registry: extensibility of the application after it is published</li>
<li>Load assemblies from arbitrary locations: support for&nbsp; assembly loading from several arbitrary locations; needed this to make it easier for testing with build directories owned by someone else. I understand the security implications&nbsp;and hence the framework will insist on strong named assemblies and warns if not. &nbsp;[At the moment I am testing this and will commit later in the week]</li>
<li>Generate type registry: this is a consequence of 2; since the Type specification syntax for reflection can become complex with nested generics, I needed this in a framework.</li>
</ol>
<p>I can't say I have done thorough research across the IoC landscape but after a quick scan I didn't find one framework that supported all the above.</p>
<p>Also, I may have thought like a developer; within the time that is&nbsp;consumed by&nbsp;the research and testing of the frameworks,&nbsp;I thought I could put together one myself:)</p>
<p>Is this the best in its current&nbsp;incarnation?&nbsp;NO; it just serves my purpose. I will add constructor and setter injection soon.</p>
<p>End of the day, I did this for my own use and if any of you find it useful please use it. If not, IMO, no harm done. If you want to help me make it better, please do send me feedback.</p>
<p>As @Dave (THANK YOU @Dave!) suggested,&nbsp;I now have the experience of all the issues that one faces while writing an IoC container!</p>]]></content:encoded>
    </item>
    <item>
      <title>TypeC - A Simple .NET Dependency Injection / IoC Container</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/typec-a-simple-net-dependency-injection-ioc-container</link>
      <pubDate>Sat, 28 Mar 2015 16:21:00 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2015/03/28/typec-a-simple-net-dependency-injection-ioc-container/</guid>
      <description><![CDATA[TypeC is a simple .NET type container for resolving interfaces/abstract base classes to their...]]></description>
      <content:encoded><![CDATA[<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">TypeC is a simple .NET type container for resolving interfaces/abstract base classes to their concrete implementations. TypeC implements factory method for instantiating types. Only one container can exist in a given .NET AppDomain as it is a singleton implementation. Multiple concrete child types can be mapped to the same base class through namespace support.</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">The project repo is located at <a href="https://github.com/hanuk/typec">https://github.com/hanuk/typec</a>; the nuget package can be installed using the command: "Install-Package TypeC" from the NuGet Package Manager Console inside Visual Studio.</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">The following snippets show the sample usage:</span></p>
<pre><span style="font-family: 'courier new', courier; color: #008000;">//during the startup </span><br /><span style="font-family: 'courier new', courier;"> TypeContainer typeC = TypeContainer.Instance; </span><br /><span style="font-family: 'courier new', courier;"> typeC.Register&lt;IList&lt;string&gt;, List&lt;string&gt;&gt;(); </span><br /><br /><span style="font-family: 'courier new', courier; color: #008000;"> //bind the interface to an implementation</span><br /><span style="font-family: 'courier new', courier;"> var list = typeC.GetInstance&lt;IList&lt;string&gt;&gt;(); </span></pre>
<pre><span style="font-family: 'courier new', courier;"> list.Add("test"); </span></pre>
<pre class="scroll">&nbsp;</pre>
<pre class="scroll"><span style="font-family: tahoma, arial, helvetica, sans-serif;">With namespace support:</span></pre>
<pre><span style="font-family: 'courier new', courier; color: #339966;"> //during the startup </span><br /><span style="font-family: 'courier new', courier;"> string namespace = "MyNamespace"; </span><br /><span style="font-family: 'courier new', courier;"> TypeContainer typeC = TypeContainer.Instance; </span><br /><span style="font-family: 'courier new', courier;"> typeC.Register&lt;IList&lt;string&gt;, List&lt;string&gt;&gt;(namespace); //deep inside the layers of the code </span><br /><span style="font-family: 'courier new', courier;"> var list = typeC.GetInstance&lt;IList&lt;string&gt;&gt;(namespace); list.Add("test");</span> </pre>
<pre><span style="font-family: 'courier new', courier;"><code><br /></code></span></pre>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">Loading type mapping from a configuration file:</span></p>
<pre><code><span style="color: #339966; font-family: 'courier new', courier;">//during the startup </span><br /><span style="font-family: 'courier new', courier;"> string fileName = "TypeConfig.xml"; </span><br /><span style="font-family: 'courier new', courier;"> TypeContainer tc = TypeContainer.Instance; </span><br /><span style="font-family: 'courier new', courier;"> //the Load(fileName) will fail if types can't be resolved tc.Load(fileName);</span> <br />&nbsp;</code></pre>
<pre><code><span style="color: #008000; font-family: 'courier new', courier;">&nbsp;//bind the interface to an implementation</span><br /><span style="font-family: 'courier new', courier;"> IGenericWriter&lt;MyClass&gt; writer1 = tc.GetInstance&lt;IGenericWriter&lt;MyClass&gt;&gt;("gwriter3"); </span><br /><span style="font-family: 'courier new', courier;"> writer1.Write(new MyClass()); </span><br /><span style="font-family: 'courier new', courier;"> IGenericWriter&lt;MyClass&gt; writer2 = tc.GetInstance&lt;IGenericWriter&lt;MyClass&gt;&gt;("gwriter4"); </span></code></pre>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">Sample XML configuration file is located in TypeC.Tests project. The file follows the standard reflection notation: <a title="Text Notation for Describing .NET Type" href="https://msdn.microsoft.com/en-us/library/w3f99sx1(v=vs.110).aspx">https://msdn.microsoft.com/en-us/library/w3f99sx1(v=vs.110).aspx</a></span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">TypeContainer.GetRegistryAsXml() will dump the registry for easy configuration file creation and debugging. The returned XML string can be pasted into the configuration file so that complex generic types can be defined easily for dynamic binding.</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">The sample xml configuration snippet returned by TypeContainer.GetRegistryAsXml()is shown below:</span></p>
<pre><span style="font-family: 'courier new', courier; color: #008000;">//code snippet&nbsp;</span></pre>
<pre><span style="font-family: 'courier new', courier;">TypeContainer tc = TypeContainer.Instance;</span><br /><span style="font-family: 'courier new', courier;">tc.Register&lt;IWriter, Lib1Writer1&gt;("writer1");</span><br /><span style="font-family: 'courier new', courier;">tc.Register&lt;IWriter, Lib2Writer1&gt;("writer2");</span><br /><span style="font-family: 'courier new', courier;">tc.Register&lt;IGenericWriter&lt;string&gt;, Lib1GenericWriter1&gt;("gwriter1");</span><br /><span style="font-family: 'courier new', courier;">tc.Register&lt;IGenericWriter&lt;string&gt;, Lib2GenericWriter1&gt;("gwriter2");</span><br /><span style="font-family: 'courier new', courier;">tc.Register&lt;IGenericWriter&lt;MyClass&gt;, Lib1GenericWriter2&gt;("gwriter3");</span><br /><span style="font-family: 'courier new', courier;">tc.Register&lt;IGenericWriter&lt;MyClass&gt;, Lib2GenericWriter2&gt;("gwriter4");</span><br /><span style="font-family: 'courier new', courier;">&nbsp;</span></pre>
<pre><span style="font-family: 'courier new', courier;">string xml = tc.GetRegistryAsXml();</span></pre>
<pre><span style="font-family: 'courier new', courier; color: #008000;">//corresponding XML</span></pre>
<pre><span style="font-family: 'courier new', courier;">&lt;typecmap&gt;</span><br /><span style="font-family: 'courier new', courier;"> &lt;mapping namespace="writer1" from="TypeC.Tests.Shared.IWriter,TypeC.Tests.Shared" to="TypeC.Tests.Lib1.Lib1Writer1, TypeC.Tests.Lib1"/&gt;</span><br /><span style="font-family: 'courier new', courier;"> &lt;mapping namespace="writer2" from="TypeC.Tests.Shared.IWriter,TypeC.Tests.Shared" to="TypeC.Tests.Lib1.Lib1Writer2, TypeC.Tests.Lib1"/&gt; </span><br /><span style="font-family: 'courier new', courier;"> &lt;mapping namespace="gwriter1" from="TypeC.Tests.Shared.IGenericWriter`1[[System.String, mscorlib]], TypeC.Tests.Shared" to ="TypeC.Tests.Lib1.Lib1GenericWriter1, TypeC.Tests.Lib1"/&gt; </span><br /><span style="font-family: 'courier new', courier;"> &lt;mapping namespace="gwriter2" from="TypeC.Tests.Shared.IGenericWriter`1[[System.String, mscorlib]], TypeC.Tests.Shared" to ="TypeC.Tests.Lib2.Lib2GenericWriter1, TypeC.Tests.Lib2"/&gt; </span><br /><span style="font-family: 'courier new', courier;"> &lt;mapping namespace="gwriter3" from="TypeC.Tests.Shared.IGenericWriter`1[[TypeC.Tests.Model.MyClass, TypeC.Tests.Model]], TypeC.Tests.Shared" to ="TypeC.Tests.Lib1.Lib1GenericWriter2, TypeC.Tests.Lib1"/&gt; </span><br /><span style="font-family: 'courier new', courier;"> &lt;mapping namespace="gwriter4" from="TypeC.Tests.Shared.IGenericWriter`1[[TypeC.Tests.Model.MyClass, TypeC.Tests.Model]], TypeC.Tests.Shared" to ="TypeC.Tests.Lib2.Lib2GenericWriter2, TypeC.Tests.Lib2"/&gt; </span><br /><span style="font-family: 'courier new', courier;">&lt;/typecmap&gt;</span> </pre>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">If you have complex nested generic types, hand coding XML can be error prone; build your registry using code and dump xml into the configuration file.</span></p>
<p><span style="font-family: tahoma, arial, helvetica, sans-serif;">Hope this helps.</span></p>
<!-- This document was created with MarkdownPad, the Markdown editor for Windows (https://markdownpad.com) -->]]></content:encoded>
    </item>
    <item>
      <title>Building Mission Critical Systems using Cloud Platform Services</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/building-mission-critical-systems-using-cloud-platform-services</link>
      <pubDate>Fri, 19 Dec 2014 20:42:00 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2014/12/19/building-mission-critical-systems-using-cloud-platform-services/</guid>
      <description><![CDATA[Overview
Mission critical systems will often have higher SLA requirements than those offered by the...]]></description>
      <content:encoded><![CDATA[<h2>Overview</h2>
<p>Mission critical systems will often have higher SLA requirements than those offered by the constituent cloud platform services. It is possible to build systems whose reliability and availability are higher than the underlying platform services by incorporating necessary measures into the system architecture. Airplanes, satellites, nuclear reactors, oil refineries and other mission critical real world systems have been operating at higher reliabilities in spite of the constant failures of the components. These systems employ varying degrees of redundancy based on the tolerance for failure. For instance, Space Shuttle used 4 active redundant flight control computers with the fifth one on standby in a reduced functionality mode. Through proper parallel architecture for redundancy, software systems can attain the necessary reliability on general purpose cloud platforms like Microsoft Azure. The SLA numbers used in this document are theoretical possibilities and the real SLA numbers depend on the quality of the application architecture and the operational excellence of the deployment.</p>
<h2>Reliability of Software Systems</h2>
<p>Any system that is composed of other sub systems and components exhibits a reliability trait that is the aggregate of all of its constituent elements. This is true for airplane rudder control, deployment of solar panels in a satellite, or the control system that maintains the position of control rods in a nuclear reactor. Many of these systems include both electronic and mechanical components that are prone to fail, yet these systems apparently function at a high degree of reliability. These real world systems attain high reliability through parallel architecture for the components in the critical path of execution. The parallel architecture is characterized by varying degrees of redundancy based on the reliability goals of the system.</p>
<p>The redundancy can be seen as heterogeneous or homogeneous; in heterogeneous redundancy the hardware and software of the primary and standby components will be made by entirely independent teams. The hardware may be manufactured by two independent vendors and in the case of software two different teams may write and test the code for the respective components. Previously mentioned Space Shuttle flight control system is an example of heterogeneous redundancy where the 5th standby flight control computer runs software written by an entirely different team.</p>
<p>Not every system can afford heterogeneous redundancy because the implementation can get very complex and expensive. Most commercial software systems use homogeneous redundancy where same software is deployed for both primary and redundant components. With homogeneous redundancy it is difficult to attain the same level of reliability as its heterogeneous counterpart due to the possibility of the correlated failures resulting from the software bugs and hardware faults replicated through homogeneity. For the sake of simplifying the discussion we will ignore the complexity of correlated failures in commercial systems caused by homogeneous deployments.</p>
<h2>Impact of Redundancy on Reliability</h2>
<p>Borrowing from the control system reliability concepts, if there are n components and if each of the components have a probability of success of Ri, the overall system reliability is the Cartesian product of all the success probabilities as shown by the following equation:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/4643.mcs_pic1.png" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/4643.mcs_5F00_pic1.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/4643.mcs_pic1.png" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/4643.mcs_5F00_pic1.png" alt="" border="0" /></a></p>
<p>If a system has three independent components in the execution path the reliability of the system can be expressed by the following equation:</p>
<div style="font-size: 18;" align="center"><strong><em>R<sub>system</sub> = R<sub>1</sub> x R<sub>2</sub> x R<sub>3</sub></em></strong></div>
<p>This equation assumes that the reliability of the individual component doesn&rsquo;t depend on the reliability of the other participating components in the system. Meaning that there are no correlated failures between the components due to the sharing of the same hardware or software failure zones.</p>
<h2>System with no Redundancy</h2>
<p>The following is a system with three components with no redundancy built into the critical path of execution. The effective reliability of this system is the product of R1, R2 and R3 as shown by the above equation:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/5314.mcs_pic2.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/5314.mcs_5F00_pic2.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/5314.mcs_pic2.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/5314.mcs_5F00_pic2.PNG" alt="" border="0" /></a></p>
<p>Since no component can be 100% reliable, the overall reliability of the system will be less than the reliability of the most reliable component in the system. We will use this in the context of a cloud hosted web application that connects to cloud storage through a web API layer. The server side architecture schematic with hypothetical SLAs for the respective components is shown below:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8585.mcs_pic3.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8585.mcs_5F00_pic3.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8585.mcs_pic3.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8585.mcs_5F00_pic3.PNG" alt="" border="0" /></a></p>
<div align="center">Figure 1: Multi-tiered web farm with no redundancy</div>
<p>SLA of the Web Farm and Web API is 99.95 and the Cloud Storage is 99.9; hence the overall system reliability is shown by the following equation:</p>
<div style="font-size: 18;" align="center"><strong><em>R<sub>system</sub> = 0.9995 x 0.9995 x 0.9990 = 0.998</em></strong></div>
<p>The system&rsquo;s reliability went down to 0.998 in spite of each component operating at a higher level of individual reliability. Complex systems tend to have more interconnected components than shown in this example and you can imagine what it does to the overall reliability of the system.</p>
<p>Let us see how redundancy can help us reaching our reliability objective of, say 99.999, through the progressive refinement of the above application architecture.</p>
<h2>Double Modular Redundancy (DMR)</h2>
<p>In a Double Modular Redundancy (DMR) implementation, two active physical components combined with a voting system will form the logical component. If one of the components were to fail, the other will pick up the workload, and the system will never experience any downtime. Proper capacity planning is required to accommodate the surge in workload due to the failover in an active-active system. Active-passive systems tend to have identical capacity for both the execution paths and hence may not be an issue. The application outage can only occur if both the physical components fail.</p>
<p>Component #2 in the above system is duplicated so that if one instance fails the other will take over. The requests from component #1 will go through both the paths and the voting system will decide which output of the components is the correct one to be accepted by component #3. This typically happens in a control system circuitry, but similar concepts can be applied to software systems. To attain higher reliability in this configuration, it is absolutely critical for both the instances of component #2 to be active. In control system circuitry, DMR is not sufficient; if two outputs of component #2 disagree there is no way to verify which component is correct. DMR can effectively be employed in scenarios where component #1 can decide if the connection to component #2 is successful through the execution status codes known a priori.</p>
<p>An example of DMR in the computer networking space is the creation of redundancy (active-standby mode) with network load balancers to prevent single point of failure. In this case, the voting system typically is the heartbeat from master to the standby (e.g. Cisco CSS) system. When the master fails the standby takes over as the master and starts processing the traffic. Similarly DMR can be applied to web farms where HTTP status codes form the implicit voting system.</p>
<p>The reliability of a DMR applied component can be computed by subtracting the Cartesian product of the probabilities (since both of them have to fail at the same time) of failure from &ldquo;1&rdquo;:</p>
<div style="font-size: 18;" align="center"><strong><em>R<sub>component</sub> = (1 - (1 - R<sub>1</sub>) x (1 - R<sub>2</sub>))</em></strong></div>
<p>If the individual load balancer&rsquo;s SLA is 99.9, the redundant deployment raises its reliability to 99.9999.</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/3377.mcs_pic4.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/3377.mcs_5F00_pic4.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/3377.mcs_pic4.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/3377.mcs_5F00_pic4.PNG" alt="" border="0" /></a></p>
<p>Now we will work on improving the availability of the deployment shown in Figure 1 through DMR. After applying redundancy to the Web API layer the systems looks like Figure 2 shown below:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/0488.mcs_pic5.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/0488.mcs_5F00_pic5.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/0488.mcs_pic5.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/0488.mcs_5F00_pic5.PNG" alt="" border="0" /></a></p>
<div align="center">Figure 2: Double Modular Redundancy for the Web API layer</div>
<p>Reliability of this system can be computed using the following equation:</p>
<div style="font-size: 18;" align="center"><strong>R<sub>system</sub> = 0.9995 x (1 &ndash; (1 - 0.9995) x (1 - 0.9995)) x 0.999 ≃ 0.9985</strong></div>
<p>Redundancy of component #2 only marginally improved the system&rsquo;s reliability due to the availability risk posed by the other two components in the system. Now let us implement redundancy for the storage layer which gives us the system reliability of 99.95 as shown by the following equation:</p>
<div style="font-size: 18;" align="center"><strong>R<sub>system</sub> = 0.9995 x (1 &ndash; (1 - 0.9995) x (1 - 0.9995)) x (1 &ndash; (1 - 0.999) x (1 - 0.999)) = 0.9995</strong></div>
<p>Redundancy with stateful components like storage is more complex than the stateless components such as web servers in a web farm. Let us see if we can take the easy route to get acceptable reliability by adding redundancy at the web frontend level and removing it at the storage level. The schematic looks like the one below:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8765.mcs_pic6.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8765.mcs_5F00_pic6.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8765.mcs_pic6.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8765.mcs_5F00_pic6.PNG" alt="" border="0" /></a></p>
<div align="center">Figure 3: Double Modular Redundancy for the Web and the Web API layers</div>
<p>&nbsp;</p>
<div style="font-size: 18;" align="center"><strong>R<sub>system</sub> = (1 &ndash; (1 - 0.9995) x (1 - 0.9995)) x (1 &ndash; (1 - 0.9995) x (1 - 0.9995)) x 0.999 ≃ 0.999</strong></div>
<p>This still did not give us the target rate of, say, 0.99999. The only option we have now is to bring back the redundancy to storage as shown below:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8662.mcs_pic7.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8662.mcs_5F00_pic7.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8662.mcs_pic7.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8662.mcs_5F00_pic7.PNG" alt="" border="0" /></a></p>
<div style="font-size: 18;" align="center"><strong>R<sub>system</sub> = (1 &ndash; (1 - 0.9995) x (1 - 0.9995)) x (1 &ndash; (1 - 0.9995) x (1 - 0.9995)) x (1 &ndash; (1 - 0.999) x (1 - 0.999)) ≃ 0.999999 </strong></div>
<p>The following table shows the theoretical reliabilities that can be attained by applying redundancy at various layers of the schematic in Figure 1:</p>
<p>&nbsp;</p>
<table border="1">
<tbody>
<tr><th>Redundancy Model</th><th>Web App (SLA = 99.95)</th><th>Web API(SLA = 99.95)</th><th>Azure Table (SLA = 99.9)</th><th>Attainable SLA</th></tr>
<tr>
<td>Deployment #1</td>
<td>NO</td>
<td>NO</td>
<td>NO</td>
<td>99.80</td>
</tr>
<tr>
<td>Deployment #2</td>
<td>YES</td>
<td>NO</td>
<td>NO</td>
<td>99.85</td>
</tr>
<tr>
<td>Deployment #3</td>
<td>NO</td>
<td>YES</td>
<td>NO</td>
<td>99.85</td>
</tr>
<tr>
<td>Deployment #4</td>
<td>NO</td>
<td>NO</td>
<td>YES</td>
<td>99.90</td>
</tr>
<tr>
<td>Deployment #5</td>
<td>YES</td>
<td>YES</td>
<td>NO</td>
<td>99.90</td>
</tr>
<tr>
<td>Deployment #6</td>
<td>NO</td>
<td>YES</td>
<td>YES</td>
<td>99.95</td>
</tr>
<tr>
<td>Deployment #7</td>
<td>YES</td>
<td>YES</td>
<td>YES</td>
<td>99.99999</td>
</tr>
</tbody>
</table>
<p>After applying redundancy across all system components, we finally reached our goal of 99.999. Now we will look at the implementation strategies of this scheme on Azure. As mentioned previously the homogeneity of the hardware and software for commercial systems may impact the reliability numbers shown in the above table. See the Wikipedia article &ldquo;High Availability&rdquo; for the downtime numbers of various nines of availability.</p>
<h2>DMR within an Azure Region</h2>
<p>When redundancy is being designed into the system, careful consideration has to be given to make sure that both the primary and the redundant components are not deployed to the same unit of fault isolation. Windows Azure infrastructure is divided into regions where each region is composed of one or more data centers. In our discussion we will use &ldquo;region&rdquo; and &ldquo;data center&rdquo; interchangeably based on the physical or logical aspects of the context.</p>
<p>Failures in any given data center can happen due to the faults in the infrastructure (e.g. Power and cooling), hardware (e.g. networking, servers, storage), or management software (e.g. Fabric Controller). Given that the first two are invariant for a DC, software faults can be avoided if applications are given a chance to deploy to multiple fault isolation zones. In the context of Azure, compute cluster and storage stamp are such fault isolation zones.</p>
<p>Each Windows Azure data center is composed of clusters of compute nodes and each cluster contains approximately a 1000 servers. The first instinct is to deploy multiple cloud services for compute redundancy; however, at the time when this article was written, the ability to override Azure decisions on compute cluster selection for provisioning PaaS or IaaS VMs is not enabled through the portal or through the REST APIs. So, there is no guarantee that any two cloud services either within the same Azure subscription or across multiple subscriptions will be provisioned on two distinct compute clusters.</p>
<p>Similarly Azure Storage uses clusters of servers called storage stamps, each of which is composed of approximately a 1000 servers. The developers can&rsquo;t achieve redundancy at the storage layer by placing two storage accounts on two different storage stamps in a deterministic manner.</p>
<p>Since developers have no control over increasing the redundancy for single region deployments, the model in Figure 3 can&rsquo;t be realized unless multiple regions are considered. The system shown in Figure 1 is what can be attained realistically with Windows Azure through a single region deployment which caps the maximum achievable system reliability at 0.998.</p>
<h2>DMR through Multi-Region Deployments</h2>
<p>The implementation shown in Figure 3 can only be realized through multiple Azure regions because of the lack of control on the compute cluster and storage stamp selection in a single Azure region. The only reliable way of getting desired redundancy is to deploy the complete stack on each region as shown in Figure 4.</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/4403.mcs_pic8.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/4403.mcs_5F00_pic8.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/4403.mcs_pic8.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/4403.mcs_5F00_pic8.PNG" alt="" border="0" /></a></p>
<div align="center">Figure 5: DMR architecture deployed to two Azure regions</div>
<p>Affinity-less interaction between application layers in an active-active deployment shown above is too complex to implement due to the near real time multi-master replication requirements of the persistent application state (e.g. Azure Table) resulting from the arbitrary cross DC access of the application layers. No matter which storage technology is used, changes to the business entities have to be written to storage tables in both the data centers. Preventing arbitrary layer interaction between data centers reduces the state complexity issues and hence the architecture can be simplified as shown below:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/6266.mcs_pic9.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/6266.mcs_5F00_pic9.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/6266.mcs_pic9.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/6266.mcs_5F00_pic9.PNG" alt="" border="0" /></a></p>
<div align="center">Figure 6: DMR architecture deployed to two Azure regions</div>
<p>Let us describe the changes that we made from the hypothetical system in Figure 5 to an implementable model.</p>
<ul>
<li>
<p>The inter-layer communications between the data centers is removed due to the complexities involved with the multi-master write activities. Instead of an active-active model we selected an active-passive model where the secondary is in a warm standby mode.</p>
</li>
<li>
<p>Azure Traffic Manager is replaced with a custom traffic manager (e.g. an on-premise distributed traffic manager or a client rotating through a list of URLs) that can have higher availability than Azure Traffic Manager&rsquo;s SLA of 99.99. With Azure Traffic Manager usage, the max reliability of even the multi-region deployment will mathematically be &lt;= 99.99.</p>
</li>
<li>
<p>Since Azure Table doesn&rsquo;t support multi-master replication and doesn&rsquo;t give storage account level control to failover (entire stamp has to fail6) to the geo replicated secondary for writes, application level writes are required. In order for this to work, a separate storage account is required on the secondary data center.</p>
</li>
<li>Web API level Azure Table replication requires local writes to be asynchronously queued (e.g. storage or service bus queue) to the remote storage table because otherwise it will reduce the SLA due to the tight coupling of the remote queuing infrastructure.</li>
</ul>
<p>The above implementation can turn into an active-active set up if the storage state can be cleanly partitioned across multiple deployments. The transactional data from such partitions can be asynchronously brought into a single data warehouse for analytics<sup>4</sup>.</p>
<p>Content driven applications like media streaming, e-Books, and other services can easily build systems with 99.999 on Azure by distributing content through multiple storage accounts located in multiple Azure regions. So, with shared nothing architecture the set up in Figure 3 can easily be translated into an active-active deployment.</p>
<h2>Triple Modular Redundancy (TMR)</h2>
<p>Triple modular redundancy, as the name indicates, involves the creation of 3 parallel execution paths for each component that is prone to fail. TMR can dramatically raise the reliability of the logical component even if the underlying physical component is highly unreliable. For most software systems, DMR is good enough unless the systems (such as industrial safety systems and airplane systems) can potentially endanger human life. In fact, Space Shuttle2 employed quadruple redundancy for its flight-control systems.</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8715.mcs_pic10.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8715.mcs_5F00_pic10.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/8715.mcs_pic10.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/8715.mcs_5F00_pic10.PNG" alt="" border="0" /></a></p>
<p>The Azure architecture shown in Figure 3 is morphed into the Figure 7 shown below for TMR:</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/3835.mcs_pic11.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/3835.mcs_5F00_pic11.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/3835.mcs_pic11.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/3835.mcs_5F00_pic11.PNG" alt="" border="0" /></a></p>
<div align="center">Figure 7: TMR architecture deployed to three Azure regions</div>
<p>The theoretical availability for such a system is as shown below:</p>
<div style="font-size: 18;" align="center"><strong>R<sub>system</sub> = (1 &ndash; (1-0.998) x (1-0.998) x (1-0.998)) = 0.99999999</strong></div>
<p>99.999999 is unthinkable for most cloud-hosted systems because it is an extremely complex and expensive undertaking. The same architecture patterns that are applied to DMR can easily be applied to TMR, so we will not rehash the strategies here.</p>
<h2>CAP Theorem and High Availability of Azure Deployments</h2>
<p>Distributed multi-region deployment is a key success factor for building highly available systems on cloud platforms including Microsoft Azure. Per CAP theorem8, you can only guarantee two of the three (C &ndash; Consistency, A- Availability, P &ndash; network Partition tolerance) systemic qualities in applications that use state machines. Given that multi-region deployments on Azure are already network partitioned, the CAP theorem can be reduced to the inverse relationship of C and A. Consequently it is extremely hard to build a highly consistent system that is also highly available in a distributed setting. Availability in CAP theorem refers to the availability of the node of a state machine, and in our case Azure Table is such a logical node. In this case, the overall deployment&rsquo;s Availability and Consistency are correlated to A and C of Azure Table . Azure Table can be replaced with any state machine (e.g. Mongo DB, Azure SQL Database, and Cassandra) and the above arguments are still true.</p>
<p>High availability at the order of 99.99 and above requires the relaxation of system&rsquo;s dependency on state consistency. Let us use a simple e-commerce scenario where shoppers can be mapped to their respective zip codes. We needed TMR due to the availability requirement of 99.999 or above for this hypothetical system. We can safely assume that the reference data like product catalog is consistently deployed to all the Azure regions.</p>
<p style="text-align: center;"><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/4670.mcs_pic12.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/4670.mcs_5F00_pic12.PNG"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/46/78/4670.mcs_pic12.PNG" original-url="https://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-00-46-78/4670.mcs_5F00_pic12.PNG" alt="" border="0" /></a></p>
<div align="center">Figure Figure 8: Embarrassingly parallel data sets for high availability</div>
<p>This multi-region deployment requires the identification of embarrassingly parallel data sets within the application state and map each deployment as the primary for mutability of the respective data sets. In this case, the deployment in each region is mapped to a set of zip codes and all the transactional data from the users belonging to these zip codes will be written to the respective regional database partition (e.g. Azure Table). All the three regions are serving the same application in an active-active setting. Let us assume that the replication latency is 15 min for an entity write. We could set up the following mapping for primary and fail-over operations:</p>
<div align="center">
<table border="1">
<tbody>
<tr><th>Zip Code Range</th><th>Primary</th><th>Secondary</th><th>Tertiary</th></tr>
<tr>
<td>10000 to 39999</td>
<td>Region #1</td>
<td>Region #2</td>
<td>Region #3</td>
</tr>
<tr>
<td>40000 to 69999</td>
<td>Region #2</td>
<td>Region #3</td>
<td>Region #1</td>
</tr>
<tr>
<td>70000 to 99999</td>
<td>Region #3</td>
<td>Region #1</td>
<td>Region #2</td>
</tr>
</tbody>
</table>
</div>
<p>If Region #1 is down, users can be sent to other regions with appropriate annotation that their shopping carts and order status are not current. Users can continue browsing the catalog, modify the shopping cart (albeit an older one) and view the delayed order status. Given that this only happens at the failure of a region, which is expected to be a rare event, users may be more forgiving than the dreaded &ldquo;System is down and comeback later&rdquo; message.</p>
<p>Tying this back to CAP theorem, we attained higher availability through an active-active TMR deployment at the expense of the overall consistency of the state data. If system functionality can&rsquo;t tolerate data inconsistency resulting from the replication latency, one can&rsquo;t use eventual consistency model. Strong consistency implementation between Azure regions can result in reduced availability due to the cascading effect of a region&rsquo;s failure because of the tight coupling with other regions.</p>
<h2>Summary</h2>
<p>Given the current SLA model of Azure managed services such as compute, storage, networking and other supporting services, architecting systems with high availability like 99.99 and beyond requires a multi-region deployment strategy. In most cases the ceiling for a single region Azure deployment is 99.95 or below due to the compounding effect of the SLAs of multiple services used in a typical cloud service. Redundancy with shared nothing architecture is the key success factor of achieving high system reliability. Building highly reliable systems of 99.99 or above is an expensive undertaking that requires deliberate designs and architecture practices regardless of whether it is for the cloud or on-premise. Factoring in the trade-offs between consistency and availability into the application architecture will produce the desired solution outcome whose complexity can be manageable.</p>
<p>Thanks to Mark Russinovich, Patrick Chanezon, and Brent Stineman for helping me in improving this article.</p>
<h2>References</h2>
<ol>
<li>"Redundant System Basic Concepts." - National Instruments. N.p., 11 Jan. 2008. Web. 30 Mar. 2014. <a href="https://www.ni.com/white-paper/6874/en/">https://www.ni.com/white-paper/6874/en/</a>.</li>
<li>"Computers in the Space Shuttle Avionics System." Computer Synchronization and Redundancy Management. NASA, n.d. Web. 30 Mar. 2014. <a href="https://www.hq.nasa.gov/office/pao/History/computers/Ch4-4.html">https://www.hq.nasa.gov/office/pao/History/computers/Ch4-4.html</a>.</li>
<li>Russinovich, Mark. "Windows Azure Internals." Microsoft MSDN Channel 9. Microsoft, 1 Nov. 2012. Web. 30 Mar. 2014. <a href="https://channel9.msdn.com/Events/Build/2012/3-058">https://channel9.msdn.com/Events/Build/2012/3-058</a>.</li>
<li>McKeown, Michael, Hanu Kommalapati, and Jason Roth. "Disaster Recovery and High Availability for Windows Azure Applications." Msdn.microsoft.com. N.p., n.d. Web. 30 Mar. 2014. <a href="https://msdn.microsoft.com/en-us/library/windowsazure/dn251004.aspx">https://msdn.microsoft.com/en-us/library/windowsazure/dn251004.aspx</a>.</li>
<li>Mercuri, Marc, Ulrich Homann, and Andrew Townsend. "Failsafe: Guidance for Resilient Cloud Architectures." Msdn.microsoft.com. Microsoft, Nov. 2012. Web. 30 Mar. 2014. <a href="https://msdn.microsoft.com/en-us/library/jj853352.aspx">https://msdn.microsoft.com/en-us/library/jj853352.aspx</a>.</li>
<li>Haridas, Jai, and Brad Calder. "Windows Azure Storage Redundancy Options and Read Access Geo Redundant Storage." Microsoft MSDN. Microsoft, 11 Dec. 2013. Web. 30 Mar. 2014. <a href="https://blogs.msdn.com/b/windowsazurestorage/archive/2013/12/04/introducing-read-access-geo-replicated-storage-ra-grs-for-windows-azure-storage.aspx">https://blogs.msdn.com/b/windowsazurestorage/archive/2013/12/04/introducing-read-access-geo-replicated-storage-ra-grs-for-windows-azure-storage.aspx</a>.</li>
</ol><!-- This document was created with MarkdownPad, the Markdown editor for Windows (https://markdownpad.com) -->]]></content:encoded>
    </item>
    <item>
      <title>Microsoft Azure VNET-to-VNET Connectivity Timesaver</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/microsoft-azure-vnet-to-vnet-connectivity-timesaver</link>
      <pubDate>Tue, 24 Jun 2014 07:28:27 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2014/06/24/microsoft-azure-vnet-to-vnet-connectivity-timesaver/</guid>
      <description><![CDATA[If you are setting up VNET-to-VNET connectivity between two virtual networks using...]]></description>
      <content:encoded><![CDATA[<p><font size="3">If you are setting up VNET-to-VNET connectivity between two virtual networks using <a title="https://msdn.microsoft.com/en-us/library/azure/dn690122.aspx" href="https://msdn.microsoft.com/en-us/library/azure/dn690122.aspx">https://msdn.microsoft.com/en-us/library/azure/dn690122.aspx</a>, here is the summary of the process:</font></p>  <ol>   <li><font size="3">Create VNET1 with address space 10.1.0.0/16</font></li>    <li><font size="3">Create VNET2 with address space 10.2.0.0/16</font></li>    <li><font size="3">Create LOCAL-VNET1 with address space 10.1.0.0/16</font></li>    <li><font size="3">Create LOCAL-VNET2 with address space 10.2.0.0/16</font></li>    <li><font size="3">Edit VNET1 to connect to LOCAL-VNET2</font></li>    <li><font size="3">Edit VNET2 to connect to LOCAL-VNET1</font></li>    <li><font size="3">Provision gateway on VNET1</font></li>    <li><font size="3">Provision gateway on VNET2</font></li>    <li><font size="3">Update LOCAL-VNET1 gateway address with the provisioned gateway address&#160; of VNET1</font></li>    <li><font size="3">Update LOCAL-VNET2 gateway address with the provisioned gateway address of VNET2</font></li>    <li><font size="3">Set the IPsec/IKE key of the gateways of both VNET1 and VNET2 to the same value </font></li> </ol>  <p><font size="3">Once the above process is complete, the network connectivity is established between VNET1 and VNET2. if you are doing this first time the documentation tells you (steps 3 and 4) to use a place holder IP address for the yet to be created gateway. </font></p>  <p><font size="3">This placeholder can’t be any IP address from the private IP address spaces. Since this placeholder will be replaced with the gateway address created during steps 7 and 8, use anything (e.g. 25.345.131.1) that resembles a public IP address.</font></p>  <p><font size="3">Note that the address spaces of VNET1 and VNET2 are mutually exclusive as these two VNETs will be combined into one logical address space after the connectivity is established. </font></p>  <p><font size="3"></font></p>  <p><font size="3">Hope this helps to save a few minutes if you are doing this first time.</font></p>  <p><font size="3">-Hanu</font></p>  <p><font size="3"></font></p>  <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:dc8492f1-652a-454d-b323-f47050c1218e" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;">Technorati Tags: <a href="https://technorati.com/tags/Azure+Virtual+Networking" rel="tag">Azure Virtual Networking</a>,<a href="https://technorati.com/tags/Azure+VNET-to-VNET" rel="tag">Azure VNET-to-VNET</a>,<a href="https://technorati.com/tags/Microsoft+Azure+Virtual+Networking" rel="tag">Microsoft Azure Virtual Networking</a>,<a href="https://technorati.com/tags/Microsoft+Azure+VNET-to-VNET" rel="tag">Microsoft Azure VNET-to-VNET</a></div>  <p><font size="3"></font></p>]]></content:encoded>
    </item>
    <item>
      <title>Building Reliable Cloud Systems on Microsoft Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/building-reliable-cloud-systems-on-microsoft-azure</link>
      <pubDate>Wed, 14 May 2014 05:56:09 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2014/05/14/building-reliable-cloud-systems-on-microsoft-azure/</guid>
      <description><![CDATA[Sometimes mission critical systems may have higher SLA requirements than those offered by the cloud...]]></description>
      <content:encoded><![CDATA[<p>Sometimes mission critical systems may have higher SLA requirements than those offered by the cloud platform services. It is possible to build systems whose availability is higher than the constituent services by incorporating necessary measures into the system architecture. Airplanes, satellites, nuclear reactors, oil refineries and other mission critical real world systems have been building highly available architectures from components that are prone to fail. </p>  <p>These systems employ a varying degree of redundancy based on the tolerance for failure. For instance, Space Shuttle used 4 active redundant flight control computers with the fifth one on standby reduced functionality mode. Through proper parallel architecture for redundancy, software systems can attain the necessary reliability on general purpose cloud platforms like Windows Azure. </p>  <p>Building systems with reliability of 99.99 or above is a lot of hard work and can get expensive pretty fast. Cloud platforms like Microsoft Azure gives you the necessary tools but you have to do the hard work of designing the necessary redundancy into the system layers. </p>  <p>Just published a paper on this subject at: <a title="https://download.microsoft.com/download/1/C/2/1C23BE8E-D0D8-448C-BF38-A0708C9EF9F5/Building_Mission_Critical_Systems_on_Cloud_Platforms.pdf" href="https://download.microsoft.com/download/1/C/2/1C23BE8E-D0D8-448C-BF38-A0708C9EF9F5/Building_Mission_Critical_Systems_on_Cloud_Platforms.pdf">https://download.microsoft.com/download/1/C/2/1C23BE8E-D0D8-448C-BF38-A0708C9EF9F5/Building_Mission_Critical_Systems_on_Cloud_Platforms.pdf</a>. </p>    <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:d4af4b0a-066b-4d5e-848b-38f8f0a62c2d" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;">Technorati Tags: <a href="https://technorati.com/tags/Software+Reliability" rel="tag">Software Reliability</a>,<a href="https://technorati.com/tags/Microsoft+Azure" rel="tag">Microsoft Azure</a>,<a href="https://technorati.com/tags/99.99" rel="tag">99.99</a>,<a href="https://technorati.com/tags/99.999" rel="tag">99.999</a>,<a href="https://technorati.com/tags/misssion+critical+cloud+systems" rel="tag">misssion critical cloud systems</a>,<a href="https://technorati.com/tags/software+redundancy" rel="tag">software redundancy</a></div>]]></content:encoded>
    </item>
    <item>
      <title>Setting up Debugging Environment for ASP.NET Katana and Windows Azure Active Directory</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/setting-up-debugging-environment-for-asp-net-katana-and-windows-azure-active-directory</link>
      <pubDate>Mon, 20 Jan 2014 11:12:00 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2014/01/20/setting-up-debugging-environment-for-asp-net-katana-and-windows-azure-active-directory/</guid>
      <description><![CDATA[The process described in this post was tested on 01/13/2013 using Katana...]]></description>
      <content:encoded><![CDATA[<font style="font-size: 12pt;"></font>  <table cellspacing="0" cellpadding="2" width="599" border="0"><tbody>     <tr>       <td valign="top" width="597">         <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">The process described in this post was tested on 01/13/2013 using Katana 2.0.2, Visual Studio 2013 and .NET Framework 4.5.<span style="mso-spacerun: yes;">&#160; </span></font></p>         <font size="2"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">The authentication and authorization space is riddled with acronyms and cryptic terms like realm, issuer, tenant, audience URI and when you combine this with OAuth terminology and implementation specific terms, it becomes even more confusing and it is pretty easy to make mistakes especially if you are handling multiple identity providers. </font></p>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">There are good chances that you may mess up the configuration either in WAAD (Windows Azure Active Directory) or in the application server code.&#160; It exactly happened to me while working on a multi-tenant auth handling components for WebAPI; I was running into an authorization error which I had no idea why it’s happening. </font></p>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">I wasn’t sure how to enable tracing on Katana to see if it even helps. So, I resorted to the brute force approach of source code level debugging and thought that this process will save some time if you ever run into this issue. </font></p>         <font size="2"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">Here is the process:<span style="mso-spacerun: yes;">&#160;</span></font></p>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2"><b style="mso-bidi-font-weight: normal;">Step 1</b>: <font face="Consolas">git clone </font></font><a style="cursor: auto;" href="https://git01.codeplex.com/katanaproject"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font size="2" face="Consolas">https://git01.codeplex.com/katanaproject</font></span></a><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"></span></p>         <font size="2"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2"><b style="mso-bidi-font-weight: normal;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">Step 2</span></b><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">: </span>Open<span style="line-height: 10pt; mso-ansi-language: en;"> <span lang="EN">“katana.sln” </span></span>and add your existing ASP.NET WebAPI project to Katana solution.<span style="line-height: 10pt; mso-ansi-language: en;"> <span lang="EN"></span></span></font></p>         <font size="2"></font>          <blockquote>           <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">[I prefer to configure authentication manually than using the VS 2013 WebAPI template. Manual approach will help me undo it if needed and also the wizard messes up with my app definitions inside WAAD. The steps for manual configuration are: </font></p>         </blockquote>          <blockquote>           <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">a. </span>Install<span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"> Microsoft.Owin.Security.ActiveDirectory </span>and<span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"> <font face="Consolas">Microsoft.Owin.Host.SystemWeb</font> </span>and the associated dependencies<span style="line-height: 10pt; mso-ansi-language: en;"> </span></font></p>            <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="line-height: 10pt; mso-ansi-language: en;"></span><font size="2"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">b. </span>Add <span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">Startup.cs</span> to contain code as seen in Step 5 later </font></p>            <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">c. </span>Decorate the<span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"> WebAPI </span>controllers with<span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"> [Authorize]</font> </span>attribute as needed<span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">]</span></font></p>         </blockquote>         <font size="2"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2"><b style="mso-bidi-font-weight: normal;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">Step 3</span></b><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">: Install Owin using “<font face="Consolas">install-package Owin</font>” from nuget package manager</span></font></p>          <blockquote>           <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><span style="mso-tab-count: 1;">&#160;</span></span>[Note: Katana builds upon Owin]</font><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"></span></p>         </blockquote>         <font style="font-size: 12pt;"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><b style="mso-bidi-font-weight: normal;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;">Step 4</font></span></b><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;">: Add references to the following projects in the solution: </font></span></p>          <ul>           <li>             <div class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"></span><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font size="2" face="Consolas">Microsoft.Owin.Net45</font> </span></div>           </li>         </ul>          <blockquote>           <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">This gets built as Microsoft.Owin.dll which contains fundamental interfaces (e.g. IHostingEngine, IAppLoader), core components (e.g. HostingEngine, AppActivator) and utilities for tracing. If you are targeting .NET 4.0, be sure to add a project reference to Microsoft.Owin.Net40 project.</font> </p>         </blockquote>          <ul>           <li>             <div class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;"><font size="2">Microsoft.Owin.Host.SystemWeb.Net45</font> </font></span></div>           </li>         </ul>          <blockquote>           <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"></span><font size="2">This gets built as Microsoft.Owin.Host.SystemWeb.dll which is necessary for integrating with ASP.NET pipeline]</font></p>         </blockquote>          <ul>           <li>             <div class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font face="Consolas"><font size="2"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">Microsoft.Owin.Security</span></font></font></div>           </li>            <li>             <div class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font face="Consolas"><font size="2"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"></span></font></font><font face="Consolas"><font size="2"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;">Microsoft.Owin.Security.ActiveDirectory</span></font></font></div>           </li>         </ul>         <font style="font-size: 12pt;"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><span style="mso-tab-count: 1;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160; </font></span></span><font style="font-size: 11pt;">[Note: our WebAPI project targets netfx 4.5]</font><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"></span></p>         <font style="font-size: 12pt;"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><b style="mso-bidi-font-weight: normal;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;">Step 5</font></span></b><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;">: Add Startup.cs with the following code:</font></span></p>         <font style="font-size: 12pt;"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"><span style="mso-tab-count: 1;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;">public partial class Startup</font></font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; text-indent: 0.5in; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;" face="Consolas">{</font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>public void ConfigureAuth(IAppBuilder app)</font></font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>app.UseWindowsAzureActiveDirectoryBearerAuthentication(</font></font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 3;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>new WindowsAzureActiveDirectoryBearerAuthenticationOptions</font></font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Audience = </font></span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font style="font-size: 9.5pt;">&quot;[APP ID URI FROM WAAD]”,</font></span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"></span></font></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>MetadataEndpoint = </font></span><font style="font-size: 9.5pt;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">&quot;[FEDERATION METADATA DOCUMENT URL]”</span></font><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font style="font-size: 9.5pt;">,</font></span></font></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><font face="Consolas"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>Realm = </font></span><font style="font-size: 9.5pt;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">&quot;[YOUR_TENANT.onmicrosoft.com&quot;</span></font><span style="line-height: 10pt;"><font style="font-size: 9.5pt;">]</font></span></font></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><font face="Consolas"><span style="line-height: 10pt;"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></span></span><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;">});</font></span></font></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas"><span style="mso-spacerun: yes;"><font style="font-size: 9.5pt;">&#160;&#160;&#160; </font></span><font style="font-size: 9.5pt;"><span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font></font></span></p>         <font style="font-size: 12pt;"></font><font face="Consolas"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; text-indent: 0.5in; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas">}</font> </span></p>         <font style="font-size: 12pt;"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><b style="mso-bidi-font-weight: normal;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;">Step 6</font></span></b><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font style="font-size: 9.5pt;">: </font></span><font size="2">Set up break points in<span style="line-height: 10pt; mso-ansi-language: en;"> <font face="Consolas"></font><span lang="EN"><font face="Consolas">OAuthBearerAuthenticationHandler.cs</font> </span></span>which is located in the project<span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"> <font face="Consolas">Microsoft.Owin.Security.Oauth</font>.</span></font></p>          <blockquote>           <p><font size="2">[Note: I set up breakpoint in the method “<font face="Consolas">protected</font> override async Task&lt;AuthenticationTicket&gt; AuthenticateCoreAsync()” as WS-Federation and OAuth JWT tokens ultimately gets validated in this code]</font></p>         </blockquote>         <font size="2"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><font size="2">After all this effort, my problem was caused by a configuration mismatch for the “Audience” URI. App ID URI in the WAAD tenant is equivalent to “<span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas">ActiveDirectoryFederationServicesBearerAuthenticationOptions.Audience”</font> </span>used by the above configured<span style="line-height: 10pt;"> </span><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font face="Consolas">app.UseActiveDirectoryFederationServicesBearerAuthentication()</font> extension method. </span></font></p>         <font size="2"></font>          <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: 12pt; list-style-type: disc;"><span lang="EN" style="line-height: 10pt; mso-ansi-language: en;"><font size="2">&#160;</font></span></p>         <font size="2"></font>          <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font size="2">I hope this saves you some time in setting up your debugging environment in troubleshooting authentication issues.</font></p>       </td>     </tr>   </tbody></table>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="mso-spacerun: yes;"><font style="font-size: 11pt;"></font></span></p> <font style="font-size: 12pt;"></font>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><font style="font-size: 11pt;"></font></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"></p>  <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:072053ff-8302-4701-9408-c1668f4b2a4f" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;">Technorati Tags: <a href="https://technorati.com/tags/Katana" rel="tag">Katana</a>,<a href="https://technorati.com/tags/ASP.NET" rel="tag">ASP.NET</a>,<a href="https://technorati.com/tags/OAuth+Testing" rel="tag">OAuth Testing</a>,<a href="https://technorati.com/tags/WAAD" rel="tag">WAAD</a>,<a href="https://technorati.com/tags/Windows+Azure+Active+Directory" rel="tag">Windows Azure Active Directory</a>,<a href="https://technorati.com/tags/Katana+Debugging" rel="tag">Katana Debugging</a>,<a href="https://technorati.com/tags/WebAPI+Auth+Debugging" rel="tag">WebAPI Auth Debugging</a></div>  <font style="font-size: 12pt;"></font><font style="font-size: 12pt;"></font>]]></content:encoded>
    </item>
    <item>
      <title>Clearing Stored Credentials in Windows 8.1 using PasswordVault</title>
      <link>https://docs.microsoft.com/archive/blogs/hanuk/clearing-stored-credentials-in-windows-8-1-using-passwordvault</link>
      <pubDate>Sun, 19 Jan 2014 19:31:02 GMT</pubDate>
      <dc:creator><![CDATA[hanuk_MSFT]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/hanuk/2014/01/19/clearing-stored-credentials-in-windows-8-1-using-passwordvault/</guid>
      <description><![CDATA[If you ever have to test Windows Store applications with multiple OAuth providers interactively, you...]]></description>
      <content:encoded><![CDATA[<p><font size="3">If you ever have to test Windows Store applications with multiple OAuth providers interactively, you will run into a little bit of annoyance caused by the credential storage within the vault. Apparently the application has no control on this as even if did not check “Keep me signed in” during log in, the credentials were still stored into the vault managed by Credential Manager. </font><font size="3">This could be a combination of&#160; the preview of ADAL (“Install-Package Microsoft.Preview.WindowsAzure.ActiveDirectory.Authentication” and WebAuthenticationBroker. </font></p>  <p><font size="3">In any case, since I needed the log in challenge screen to show up every time click sign in during testing, I wrote the following simple function to clear the credentials issued by Windows Azure Active Directory. Thought this might be useful for anyone integrating multiple OAuth providers including Azure Active Directory. </font></p>  <p><font size="3"><font face="Consolas"></font></font></p>  <p><font size="3"><font face="Consolas">//clear stored credentials</font></font></p>  <p><font size="3" face="Consolas">ClearPasswordVault(&quot;Microsoft.WindowsAzure.ActiveDirectory.Authentication&quot;);</font></p>  <p><font size="3"></font></p> <font size="3"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font size="3"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">private</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> </span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">void</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> ClearPasswordVault(</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">string</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> resourceName)</span></font></font></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas">{</font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font size="3"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>var</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> passwordVault = </span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">new</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> </span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">PasswordVault</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">();</span></font></font></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font size="3"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>try</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"></span></font></font></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3"><font face="Consolas"><span style="mso-spacerun: yes;">&#160;&#160; </span>{&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </font></font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font size="3"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160; </span>var</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> storedCreds = passwordVault.FindAllByResource(resourceName);</span></font></font></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas">&#160;</font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font size="3"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160; </span>foreach</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> (</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">PasswordCredential</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> pc </span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">in</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"> storedCreds)</span></font></font></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3"><font face="Consolas"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160; </span>{</font></font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3"><font face="Consolas"><span style="mso-tab-count: 1;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>passwordVault.Remove(pc);</font></font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3"><font face="Consolas"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160; </span>}</font></font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font face="Consolas"><font size="3"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160; </span>WriteLog(</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">string</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">.Format(</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">&quot;Removed {0} passwords for {1}&quot;</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">, storedCreds.Count, </span></font><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3">resourceName)); </font></span><font size="3"></font></font></p>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3"><font face="Consolas"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>} </font></font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font size="3"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span></span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">catch</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"></span></font></font></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3"><font face="Consolas"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>{</font></font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><font size="3"><font face="Consolas"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><span style="mso-spacerun: yes;">&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span>WriteLog(</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">&quot;No passwords found in the vault&quot;</span><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">);<span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></span></font></font></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 0pt; line-height: normal; list-style-type: disc; mso-layout-grid-align: none;"><span style="background-position: 0% 0%; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3"><font face="Consolas"><span style="mso-spacerun: yes;">&#160;&#160;&#160; </span>}<span style="mso-tab-count: 2;">&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; </span></font></font></span></p> <font size="3" face="Consolas"></font>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas">}</font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas"></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas"></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas"></font></span></p>  <div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:38525951-1a8a-4569-8e6f-5559abf68a22" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;">Technorati Tags: <a href="https://technorati.com/tags/WebAuthenticationBroker" rel="tag">WebAuthenticationBroker</a>,<a href="https://technorati.com/tags/Windows+Azure+Active+Directory" rel="tag">Windows Azure Active Directory</a>,<a href="https://technorati.com/tags/PasswordVault" rel="tag">PasswordVault</a>,<a href="https://technorati.com/tags/OAuth+Testing" rel="tag">OAuth Testing</a></div>    <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas"></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;"><font size="3" face="Consolas"></font></span></p>  <p class="MsoNormal" style="margin: 0in 0in 8pt; line-height: 12pt; list-style-type: disc;"><span style="background-position: 0% 0%; line-height: 10pt; background-image: none; background-attachment: scroll; background-repeat: repeat; background-size: auto; background-origin: padding-box; background-clip: border-box; mso-highlight: white;">&#160;</span></p> <font style="font-size: 12pt;"></font>]]></content:encoded>
    </item>
  </channel>
</rss>