<?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>Jack Greenfield's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/jackgr/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/jackgr/feed.xml</link>
    <description>Mostly Cloudy With A Chance Of Services</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:05:38 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Geographically Distributed High Availability</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/geographically-distributed-high-availability</link>
      <pubDate>Mon, 26 Dec 2011 15:54:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2011/12/26/geographically-distributed-high-availability/</guid>
      <description><![CDATA[This is the last post in the series on business continuity. It briefly describes how the service...]]></description>
      <content:encoded><![CDATA[<p>This is the last post in the series on business continuity. It briefly describes how the service developer can provide geographically distributed high availability on the Azure platform.</p>
<p>The Azure platform currently does not directly support highly available, geographically distributed services. Customers can deploy services to multiple data centers, but the platform does nothing to help them integrate the separate deployments, or to achieve high availability with the resulting composite.</p>
<p>Geographically distributed high availability is essentially continuous disaster recovery. Each tenant&rsquo;s data is replicated to multiple physical service instances. Load is distributed dynamically across those service instances to provide an optimal user experience. The two primary challenges are:</p>
<ul>
<li>integrating physical service instances to create a single <i>virtual service</i>, and</li>
<li>minimizing data inconsistencies as client requests are routed among the different physical service instances.</li>
</ul>
<p><strong>Creating a Virtual Service</strong></p>
<p>To create a single virtual service from a collection of physical service instances, clients of the service must use logical URIs that can be bound to different physical URIs. Using a <i>global load balancer</i> (GLB), a variety of policies can then be used to select a physical service instance to service a given client request. For example, many GLBs support the following types of routing:</p>
<ul>
<li>ratio, which routes some fraction of client requests to each physical service instance,</li>
<li>geographical, which routes client requests to physical service instances in a given geography,</li>
<li>proximity, which routes client requests to the nearest physical service instances, and</li>
<li>round-robin, which routes client requests to physical service instances in a round-robin fashion.</li>
</ul>
<p>Geographical routing is usually based on the requested domain name, but some services may require routing decisions to be based on other components of the request, such as path segments, query string parameters, or payload contents. In these cases, the&nbsp;service may use proximity routing to route requests to the nearest physical instance, which then proxies them to appropriate locations using a custom routing strategy.</p>
<p><strong>Minimizing Data Inconsistencies</strong></p>
<p>If the service data changes frequently, clients may see data inconsistencies, such as recently inserted data disappearing and recently deleted data reappearing, when their requests are routed to different service instances. One way to mitigate but not completely eliminate the inconsistencies is to affinitize clients to specific service instances, and to change affinities infrequently. For some data, this level of consistency may be acceptable. For other data, however, the service may have to use synchronous replication, which was described briefly in the previous post in this series, or to block writes for a client until all outstanding changes have propagated before routing their requests to a different service instance.</p>]]></content:encoded>
    </item>
    <item>
      <title>Disaster Recovery</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/disaster-recovery</link>
      <pubDate>Sun, 23 Oct 2011 12:04:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2011/10/23/disaster-recovery/</guid>
      <description><![CDATA[While the Azure platform provides high availability within a single data center, as discussed in the...]]></description>
      <content:encoded><![CDATA[<p>While the Azure platform provides high availability within a single data center, as discussed in <a title="the previous post" href="https://blogs.msdn.com/b/jackgr/archive/2011/10/22/high-availability-on-the-azure-platform.aspx">the previous post</a>, it&nbsp;currently does not explicitly support or enable disaster recovery or geographically distributed high availability. This post and the next one will discuss how the service developer can provide these two capabilities, respectively.</p>
<p><strong>Disaster Recovery</strong></p>
<p>Disaster recovery typically involves a pair of processes called <i>fail over</i> and <i>fail back</i>. Both involve the use of redundant service components. A fail over moves service load from one set of components to another. In the case of an actual outage, a fail over is&nbsp;performed because the original components have failed. However, planned fail overs may be performed for testing, upgrade, or other purposes. Because most issues within a single data center are addressed by the high availability features of SQL Azure and Windows Azure, fail over will generally be used to move load between data centers. A fail back restores the original service load distribution.</p>
<p>For stateful services, these processes target both compute and storage components. For stateless services, only compute components are targeted. Compute fail overs reroute client requests to different compute components, usually by changing DNS CNAME records to bind a given logical URI to different physical URIs. Storage fail overs cause service requests to be served from different storage components, typically by changing connection strings used internally by the service.</p>
<p>Both processes require redundant service components to be available and ready to receive the service load being moved. Satisfying this requirement can be challenging. Provisioning redundant components in advance may incur additional cost, for example, but provisioning them on demand during a fail over may incur unacceptable latency. There is also the question of how to make sure the redundant components are correctly deployed and configured, so that the service continues to behave&nbsp;correctly following the move.</p>
<p><em><strong>Deployment Units</strong></em></p>
<p>One way to simplify the task of providing redundant service components is to use deployment units. A <em>deployment unit</em> is a set of resources provisioned in advance and configured to support the execution of an instance of a given&nbsp;service. Conceptually, it's like a template for a service instance. For example, if a given service had two web roles, three worker roles and three databases before loading production data, then a deployment unit for that service might consist of five hosted services with deployed exectuables, and one SQL Azure logical sever containing three databases configured with appropriate schema and initial data.</p>
<p>Configuring a scale unit involves a variety of tasks, such as provisioning certificates, configuring DNS, setting configuration parameters in&nbsp;application and library configuration files, building executables from the configured sources, setting configuration parameters in deployment configuration files, building deployable packages from the executables and deployment settings, deploying the packages to the hosted services, and running SQL scripts to configure the databases.</p>
<p>The process should be automated, since the number of configuration parameters may be too large to reliably set by hand, and some parts of it may have to run in Azure, since some of the configuration parameters, such as SQL Azure connection strings and other credentials may have to be sourced from secure locations rather than developer machines, or by operations staff, rather than developers. Of course, the ability to rapidly provision configured deployment units provides significant value beyond disaster recovery. Deployment units can be used for development, test, staging, private releases, a/b testing and upgrade scenarios.</p>
<p>The key to success with deployment units is systematic organization. When provisioning a deployment unit is a merely matter of running a tool, it doesn't take long before the number of hosted services and databases gets out of hand, and it can quickly become challenging to track which deployment units have been provisioned, which resources each one is using, and what purpose each one is serving. A key step toward service maturity is therefore building&nbsp;a deployment unit management system, with systematic naming of deployment units and the resources they contain. Typically, the DNS names of the hosted services will reflect the organizational structure, identifying the name of the component, the name of the deployment unit, and the name of the data center in which it resides, for example, making it easy to identify components programmatically for fail over and fail back operations.</p>
<p><strong><em>Compute Redundancy</em></strong></p>
<p>With Windows Azure, a cost effective compute redundancy strategy is to operate redundant service instances in two or more data centers, and to fail over by moving load from one instance to another. Because the platform varies the number of worker roles running as the load varies, this approach can be used to add capacity without incurring additional cost because the additional worker roles will not run until the load actually moves. This is called an <i>active/active </i>configuration, as opposed to an <i>active/passive </i>configuration, where the service instance in one data center does not carry any load until a fail over occurs.</p>
<p><em><strong>Storage Redundancy</strong></em></p>
<p>Storage fail overs are more complex than compute fail overs because of the challenge of maintaining consistency among copies of the data when the data is changing. Because of the time required to copy data between locations, there is a possibility of data loss if a location fails or is isolated from other locations while holding data that has not yet been replicated. On the other hand, forcing synchronous replication to multiple locations when the data is written can result in poor performance due to added latency. In the extreme, when too few locations are available, forcing synchronous replication causes writes to block until additional locations become available.</p>
<p>This trade-off, known as <a href="https://lpd.epfl.ch/sgilbert/pubs/BrewersConjecture-SigAct.pdf">the CAP theorem</a><a title="" href="#_ftn1">[1]</a>, is the motivation behind the many technologies for managing geographically distributed data used on the Internet. The two major categories of distributed data technology are as follows:</p>
<ul>
<li>Fully consistent stores, such as <a href="https://www.cidrdb.org/cidr2011/Papers/CIDR11_Paper32.pdf">Google&rsquo;s MegaStore</a><a title="" href="#_ftn2">[2]</a>, use <i>synchronous replication</i> based on distributed algorithms like PAXOS, to write to a quorum of replicas. Synchronous replication avoids inconsistency, but is generally too slow to be used for high throughput, low latency applications. Also, to prevent loss of service and resynchronization issues, a quorum of three or more locations is typically required. Currently, on the Azure platform, there are only two data centers in every region, making it hard to build quorums with reasonable performance.</li>
<li>Eventually consistent stores, such as <a href="https://s3.amazonaws.com/AllThingsDistributed/sosp/amazon-dynamo-sosp2007.pdf">Amazon&rsquo;s Dynamo</a><a title="" href="#_ftn3">[3]</a>, use <i>asynchronous replication</i> to copy data to replicas after it is written to a primary location, and provide mechanisms for dealing with data loss and inconsistency. Without an eventually consistent store, service developers must deal with inconsistencies in business logic or use conflict resolution mechanisms to detect and resolve them.</li>
</ul>
<p><em><strong>Asynchronous Replication</strong></em></p>
<p>In a <i>multi-master </i>architecture, writes can occur in multiple locations. Continuous conflict resolution is required to resolve inconsistencies. In a <i>single-master</i> architecture, writes can occur in one location. However, conflict resolution is still required if the master is allowed to change, as it must in the case of a fail over, and must be performed after the master changes to build a consistent view of service state. An alternative to conflict resolution is to flatten and rebuild from scratch any replicas holding a later copy of the data than the new master.</p>
<p>On the Azure platform, one of the best bets for achieving asynchronous replication is the <a title="Sync Framework" href="https://msdn.microsoft.com/en-us/sync/bb736753">Sync Framework</a>, which handles the complexities of virtual clocks, knowledge vectors and difference computation, while providing enormous flexibility through the use of confict resolution polcies, application level conflict resolution, and a provider architecture for data and metadata sources. The <a title="SQL Azure Data Sync Service" href="https://blogs.msdn.com/b/sync/archive/2011/10/13/sql-azure-data-sync-preview-is-now-available.aspx">SQL Azure Data Sync Service</a>, now in CTP, hosts the Sync Framework on Windows Azure to provide synchronization as a service. Using the service,&nbsp;instead of&nbsp;rolling your&nbsp;own solution with the Sync Framework&nbsp;means living with some limitations, but also offloads the work of building, maintaining and operating an asynchronous replication service. Check this blog for more on these two technologis and the trade off between them in upcoming posts.</p>
<p>In the extreme, asynchronous replication becomes backup and restore, which offers a simple form of storage redundancy, if customers are willing to accept an RPO defined by the window between backups. If a service cannot block writes for extended periods of time, then data may change while a backup is taken, and the contents of different storage components captured by the backup may reflect different views of the state of the service. In other words, backups may also contain inconsistencies, and recovery processing is therefore generally required following a restore.</p>
<p>Some services use data mastered by other services, and update their copies when data changes at the source. In these cases, recovery processing involves replaying changes from the source to ensure that the copies are up to date. All updates must be idempotent, so that the data to be replayed can overlap with the data already stored in the copies to ensure that no updates are missed.</p>
<p><em><strong>Cross Data Center Operation</strong></em></p>
<p>While compute and storage fail overs generally occur in tandem, so that the entire service fails over from one data center to another, there are situations where it may make sense to fail over one but not the other. Since storage fail over may cause data loss, for example, it may make sense to fail over only the compute components, allowing them to access the primary storage facilities, assuming they&rsquo;re still accessible.</p>
<p>Following a compute only fail over, compute and storage components may be located in two different data centers. Storage access calls will therefore traverse the backbone network between data centers, instead of staying within a single data center, causing performance degradation. One the Azure platform, round trip times between data centers within a region are about 6 times higher than they are within a data center. Between regions, the performance penalty grows to a factor of 30. Services will also incur data egress costs when running across data centers. Cross data center operation really only makes sense for short lived outages, and/or for services that only move small amounts of data.</p>
<hr align="left" size="1" width="33%" />
<div>
<div>
<p><a title="" href="#_ftnref1">[1]</a><br />See https://lpd.epfl.ch/sgilbert/pubs/BrewersConjecture-SigAct.pdf.</p>
</div>
<div>
<p><a title="" href="#_ftnref2">[2]</a><br />See https://www.cidrdb.org/cidr2011/Papers/CIDR11_Paper32.pdf.</p>
</div>
<div>
<p><a title="" href="#_ftnref3">[3]</a><br />See https://s3.amazonaws.com/AllThingsDistributed/sosp/amazon-dynamo-sosp2007.pdf.</p>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>High Availability On The Azure Platform</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/high-availability-on-the-azure-platform</link>
      <pubDate>Sat, 22 Oct 2011 22:54:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2011/10/22/high-availability-on-the-azure-platform/</guid>
      <description><![CDATA[Currently, both Windows Azure and SQL Azure offer high availability within a single data center. As...]]></description>
      <content:encoded><![CDATA[<p>Currently, both Windows Azure and SQL Azure offer high availability within a single data center. As long as a data center remains operational and accessible from the Internet, services hosted there can achieve high availability.</p>
<p><strong>Windows Azure</strong></p>
<p>Windows Azure uses a combination of resource management, elasticity, load balancing, and partitioning to enable high availability within a single data center. The service developer must do some additional work to benefit from these features.</p>
<p><em><strong>Resource Management</strong></em></p>
<p>All services hosted by Windows Azure are collections of web, worker and/or virtual machine roles. One or more instances of a given role can run concurrently. The number of instances is determined by configuration. Windows Azure uses Fabric Controllers (FCs) to monitor and manage role instances. FCs detect and respond to both software and hardware failure automatically.</p>
<ul>
<li>Every role instance runs&nbsp;in its own VM and communicates with its FC through a guest agent (GA). The&nbsp;GA collects resource and node metrics, including VM usage, status, logs,&nbsp;resource usage, exceptions, and failure conditions. The FC queries the GA&nbsp;at configurable intervals, and reboots the VM if the GA fails to respond.</li>
<li>In the event of hardware&nbsp;failure, the FC responsible for the failed node moves all affected role&nbsp;instances to a new hardware node and reconfigures the network to route&nbsp;traffic there. FCs use the same mechanisms to ensure the continuous&nbsp;availability of the services they provide.</li>
</ul>
<p><em><strong>Elasticity</strong></em></p>
<p>The FC dynamically adjusts the number of worker role instances, up to the limit defined by the service through configuration, according to system load.</p>
<p><em><strong>Load Balancing</strong></em></p>
<p>All inbound traffic to a web role passes through a stateless load balancer, which distributes client requests among the role instances. Individual role instances do not have public IP addresses, and are not directly addressable from the Internet. Web roles are stateless, so that any client request can be routed to any role instance. A StatusCheck event is raised every 15 seconds.</p>
<p><em><strong>Partitioning</strong></em></p>
<p>FCs use two types of partitions: update domains and fault domains.</p>
<ul>
<li>An <i>update domain</i> is used to upgrade a service&rsquo;s role instances in&nbsp;groups. For an in-place upgrade, the FC brings down all the instances in&nbsp;one upgrade domain, upgrades them, and then restarts them before moving to&nbsp;the next upgrade domain. This approach ensures that in the event of an&nbsp;upgrade failure, some instances will still be available to service&nbsp;requests.</li>
<li>A <i>fault domain</i> represents potential points of hardware or&nbsp;network failure. For any role with more than one instance, the FC ensures&nbsp;that the instances are distributed across multiple fault domains, in order&nbsp;to prevent isolated hardware failures from disrupting service. All&nbsp;exposure to VM and cluster failure in Windows Azure is governed by fault&nbsp;domains.</li>
</ul>
<p>According to the <a title="Windows Azure SLA" href="https://www.microsoft.com/windowsazure/sla/" target="_blank">Windows Azure SLA</a><a title="" href="#_ftn1"><sup><sup>[1]</sup></sup></a>, Microsoft guarantees that when two or more web role instances are deployed to different fault and upgrade domains, they will have external connectivity at least 99.95% of the time. There is no way to control the number of fault domains, but Windows Azure allocates them and distributes role instances across them automatically. At least the first two instances of every role are placed in different fault and upgrade domains in order to ensure that any role with at least two instances will satisfy the SLA.</p>
<p><em><strong>Implementation</strong></em></p>
<p>The service developer must do some additional work to benefit from these features.</p>
<ul>
<li>To benefit from resource management, developers should ensure that all service roles are stateless, so that they can go down at any time without creating inconsistencies in the transient or persistent state of the service.</li>
<li>To achieve elasticity, developers should configure each of their worker roles with the maximum number of instances sufficient to handle the largest expected load.</li>
<li>To optimize load balancing, developers should use the StatusCheck event when a role instance reaches capacity to indicate that it is busy and that it should be temporarily removed from the load-balancer rotation.</li>
<li>To achieve effective partitioning, developers should configure at least two instances of every role, and at least two upgrade domains for every service.</li>
</ul>
<p>The requirement to keep roles stateless deserves further comment. It implies, for example, that all related rows in a SQL Azure database should be changed in a single transaction, if possible. For example, instead of inserting a parent in one transaction, and then its children in another, the code should insert both the parent and the children in the same transaction, so that if it goes down after writing just one of the row sets, the data will be left in a consistent state.</p>
<p>Of course, it is not always possible to make all changes in a single transaction. Special care must be taken to ensure that role failures do not cause problems when they interrupt long running operations that span two or more updates to the persistent state of the service.</p>
<p>For example, in a service that partitions data across multiple stores, if a worker role goes down while relocating a shard, the relocation of the shard may not complete, or may be repeated from its inception by a different worker role, potentially causing orphaned data or data corruption. To prevent problems, long running operations must be idempotent (i.e., repeatable without side effect) and/or incrementally restartable (i.e., able to continue from the most recent point of failure).</p>
<ul>
<li>To be <i>idempotent</i>, a long running operation should have the same&nbsp;effect no matter how many times it is executed, even when it is&nbsp;interrupted during execution.</li>
<li>To be <i>incrementally restartable</i>, a long running operation should&nbsp;consist of a sequence of smaller atomic operations, and it should record&nbsp;its progress in durable storage, so that each subsequent invocation picks&nbsp;up where its predecessor stopped.</li>
</ul>
<p>Finally, all long running operations should be invoked repeatedly until they succeed. For example, a provisioning operation might be placed in an Azure queue, and removed from the queue by a worker role only when it succeeds. Garbage collection may be needed to clean up data created by interrupted operations.</p>
<p>Common long running operations that create special challenges include provisioning, deprovisioning, rolling upgrade, data replication, restoring backups and garbage collection.</p>
<p><strong>SQL Azure</strong></p>
<p>SQL Azure uses a combination of replication and resource management to provide high availability within a single data center. Services benefit from these features just by using SQL Azure. No additional work is required by the service developer.</p>
<p><em><strong>Replication</strong></em></p>
<p>SQL Azure exposes logical rather than physical servers. A logical server is assigned to a single tenant, and may span multiple physical servers. Databases in the same logical server may therefore reside in different SQL Server instances.</p>
<p>Every database has three replicas: one primary and two secondaries. All reads and writes go to the primary, and all writes are replicated asynchronously to the secondaries. Also, every transaction commit requires a quorum, where the primary and at least one of the secondaries must confirm that the log records are written before the transaction can be considered committed. Most production data centers have hundreds of SQL Server instances, so it is unlikely that any two databases with primary replicas on the same machine will have secondary replicas that also share a machine.</p>
<p><em><strong>Resource Management</strong></em></p>
<p>Like Windows Azure, SQL Azure uses a fabric to manage resources. However, instead of a fabric controller, it uses a ring topology to detect failures. Every replica in a cluster has two neighbors, and is responsible for detecting when they go down. When a replica goes down, its neighbors trigger a Reconfiguration Agent (RA) to recreate it on another machine. Engine throttling is provided to ensure that a logical server does not use too many resources on a machine, or exceed the machine&rsquo;s physical limits.</p>
<hr align="left" size="1" width="33%" />
<div>
<div>
<p><a title="" href="#_ftnref1">[1]</a> https://www.microsoft.com/windowsAzure/sla/</p>
</div>
</div>]]></content:encoded>
    </item>
    <item>
      <title>Business Continuity Basics</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/business-continuity-basics</link>
      <pubDate>Wed, 19 Oct 2011 12:46:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2011/10/19/business-continuity-basics/</guid>
      <description><![CDATA[This post describes the basics of business continuity. Business continuity poses both business and...]]></description>
      <content:encoded><![CDATA[<p>This post describes the basics of business continuity. Business continuity poses both business and technical challenges. In this series, we focus on the technical challenges, which include failure detection, response, diagnosis, and defect correction. Since failure diagnosis and defect correction are difficult to automate effectively in the platform, however, we narrow the focus even further to failure detection and response.</p>
<p><strong>Failure Detection</strong></p>
<p>Failures are expected during normal operation due to the characteristics of the cloud environment.</p>
<p>They can be detected by monitoring the service. <i>Reactive</i> monitoring observes that the service is not meeting <em>Service Level Objectives</em> (SLOs), while <i>proactive </i>monitoring observes conditions which indicate that the service may fail, such as rapidly increasing response times or memory&nbsp;consumption.</p>
<p>Failure detection is always relative to some observer. For example, in a partial network outage, the service may be available to one observer but not another. If the network outage blocks all external access to the service, it will appear to be unavailable to all observers, even if it is still operating correctly. A service therefore cannot reliably detect its own failure.</p>
<p><strong>Failure Response</strong></p>
<p>Failure response involves two related but different objectives: high availability and disaster recovery. Both boil down to satisfying SLOs: <i>h</i><i>igh availability</i> is about maintaining acceptable latencies, while <i>disaster recovery</i> is about recovering from outages in an acceptable amount of time with no more than an acceptable level of data loss.</p>
<p><em><strong>High Availability</strong></em></p>
<p><em>Availability</em> is generally measured in terms of responsiveness. A service is considered responsive if it responds to requests within a specified amount of time. Availability is measured as the amount of time the service is responsive in some time window divided by the length of the window, expressed as a percentage. Most services typically offer at least 99.9% availability, which amounts to 43.2 minutes of downtime or less per month.</p>
<p>Availability SLOs may not offer an accurate indication of the actual availability of a service in practice, because of how responsiveness&nbsp;is defined. For example, a common way to define availability is&nbsp;to say that a&nbsp;service&nbsp;is considered responsive if at least one request&nbsp;succeeds in every 5 minute interval. By this definition, the service can be unresponsive for 4 minutes and 59 seconds in every 5 minute interval, providing an actual availability of 0.3%, while satisfying a stated SLO of 99.9% availability.</p>
<p><em><strong>Disaster Recovery</strong></em></p>
<p>Disaster recovery is governed by SLOs that become relevant when the service becomes unavailable.</p>
<ul>
<li>A <i>Recovery Time Objective</i> (RTO) is the amount of time that can elapse&nbsp;before normal operation is restored following a loss of availability. It typically&nbsp;includes the time required to detect the failure, and the time required to&nbsp;either restore the affected components of the service, or to fail over to&nbsp;new components if the affected components cannot be restored fast enough.</li>
<li>A <i>Recovery Point Objective</i> (RPO) is a point in time to which the&nbsp;service must recover data committed by the user prior to the failure. It&nbsp;should be less than or equal to what users consider an "acceptable&nbsp;loss" in the event of a disaster.</li>
</ul>]]></content:encoded>
    </item>
    <item>
      <title>Business Continuity On Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/business-continuity-on-azure</link>
      <pubDate>Tue, 18 Oct 2011 11:49:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2011/10/18/business-continuity-on-azure/</guid>
      <description><![CDATA[Azure customers want their services to be continuously available to their users, despite component...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">Azure customers want their services to be continuously available to their users, despite component failures, platform degradations and data center outages. In other words, they want business continuity. To achieve it, the services must be highly available, and must recover from outages quickly and with minimal data loss, while complying with policies and regulations, and conforming to accepted industry practices.</span></p>
<p><span style="font-size: small;">Windows Azure and SQL Azure currently provide high availability within a data center, but they don&rsquo;t provide any protection when data centers go down or offline. Customers can deploy services to multiple data centers to work around this limitation, but the platform doesn&rsquo;t help them integrate the separate deployments to form highly available, geographically distributed services. </span><span style="font-size: small;">This is the first of several blog posts on this topic taken from a paper that I recently wrote with&nbsp;Dima Sonkin and Erik Wahlstrom.</span></p>
<p><span style="font-size: small;">The posts will provide an introduction to business continuity, describe Azure platform features enabling business continuity, and describe how to achieve business continuity with the existing features.</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Remembering Steve by Remembering NeXT</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/remembering-steve-by-remembering-next</link>
      <pubDate>Tue, 11 Oct 2011 10:08:15 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2011/10/11/remembering-steve-by-remembering-next/</guid>
      <description><![CDATA[Last week, JJ Dubray asked me to write something about NeXT in Steve's honor for InfoQ. It's part of...]]></description>
      <content:encoded><![CDATA[<p>Last week, JJ Dubray asked me to write something about NeXT in Steve's honor for InfoQ. It's part of <a href="https://www.infoq.com/news/2011/10/steve-jobs-contribution">a post about Steve </a>with thoughts from several people, including&nbsp;Eric Schmidt and Tim Berners-Lee. My thoughts are near the bottom of the post.</p>]]></content:encoded>
    </item>
    <item>
      <title>FabrikamJets Example Updated (Really)</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/fabrikamjets-example-updated-really</link>
      <pubDate>Thu, 08 Jul 2010 17:19:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2010/07/08/fabrikamjets-example-updated-really/</guid>
      <description><![CDATA[I just discovered that the 2.0 release of the Fabrikam Jets example on code gallery (described in...]]></description>
      <content:encoded><![CDATA[<p>I just discovered that the 2.0 release of<a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/the Fabrikam Jets example" title="https://code.msdn.microsoft.com/fabrikamjets"> the Fabrikam Jets example</a> on code gallery (described in <a href="https://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/this blog post" title="https://blogs.msdn.com/b/jackgr/archive/2010/01/08/fabrikamjets-example-updated-to-appfabric-access-control-v1.aspx">this blog post</a>) contained the original version 1.0 code that worked with OAuth WRAP v0.8, instead of the new version 2.0 code that works with OAuth WRAP v0.9. Apparently, I uploaded the wrong file back in January. The version 2.0 code was checked into our source tree, and has been sitting there all this time. I have just uploaded it as version 2.1.</p>]]></content:encoded>
    </item>
    <item>
      <title>Silverlight Samples for OData Over SQL Azure</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/silverlight-samples-for-odata-over-sql-azure</link>
      <pubDate>Tue, 20 Apr 2010 13:00:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2010/04/20/silverlight-samples-for-odata-over-sql-azure/</guid>
      <description><![CDATA[I've just published a some code samples that show how to build a Silverlight client for the OData...]]></description>
      <content:encoded><![CDATA[I've just published a some <A href="https://code.msdn.microsoft.com/SL3ODataSQLAzureACS" mce_href="https://code.msdn.microsoft.com/SL3ODataSQLAzureACS">code samples</A> that show how to build a Silverlight client for the <A href="https://blogs.msdn.com/jackgr/archive/2010/04/16/odata-for-sql-azure-with-appfabric-access-control.aspx" mce_href="https://blogs.msdn.com/jackgr/archive/2010/04/16/odata-for-sql-azure-with-appfabric-access-control.aspx">OData Service for SQL Azure</A>, and how to build a service that validates Secure Web Tokens (SWTs) issued by AppFabric Access Control. For more information about the client, see my earlier post about <A href="https://blogs.msdn.com/jackgr/archive/2010/04/19/silverlight-clients-and-appfabric-access-control.aspx" mce_href="https://blogs.msdn.com/jackgr/archive/2010/04/19/silverlight-clients-and-appfabric-access-control.aspx">Silverlight Clients and AppFabric Access Control</A>.&nbsp;To implement identity federation scenarios for the OData Service, see my <A href="https://blogs.msdn.com/jackgr/archive/2010/01/08/fabrikamjets-example-updated-to-appfabric-access-control-v1.aspx" mce_href="https://blogs.msdn.com/jackgr/archive/2010/01/08/fabrikamjets-example-updated-to-appfabric-access-control-v1.aspx">earlier post </A>and <A href="https://code.msdn.microsoft.com/fabrikamjets/Wiki/View.aspx?title=Home" mce_href="https://code.msdn.microsoft.com/fabrikamjets/Wiki/View.aspx?title=Home">code sample</A> that show how to use identity federation with <A href="https://www.microsoft.com/windowsazure/dallas/" mce_href="https://www.microsoft.com/windowsazure/dallas/">Codename "Dallas"</A>.]]></content:encoded>
    </item>
    <item>
      <title>Silverlight Clients and AppFabric Access Control</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/silverlight-clients-and-appfabric-access-control</link>
      <pubDate>Mon, 19 Apr 2010 15:08:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2010/04/19/silverlight-clients-and-appfabric-access-control/</guid>
      <description><![CDATA[As described in my previous post, I've just finished building some Silverlight clients and a portal...]]></description>
      <content:encoded><![CDATA[<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>As described in </FONT><A href="https://blogs.msdn.com/jackgr/archive/2010/04/16/odata-for-sql-azure-with-appfabric-access-control.aspx" mce_href="https://blogs.msdn.com/jackgr/archive/2010/04/16/odata-for-sql-azure-with-appfabric-access-control.aspx"><FONT face=verdana,geneva>my previous post</FONT></A><FONT face=verdana,geneva>, I've just finished building some Silverlight clients and a portal </FONT></SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>for the new </FONT><A href="https://www.sqlazurelabs.com/" mce_href="https://www.sqlazurelabs.com/"><SPAN style="COLOR: windowtext"><FONT face=verdana,geneva>OData service for SQL Azure</FONT></SPAN></A></SPAN><FONT face=verdana,geneva><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"> using </SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><A href="https://www.microsoft.com/windowsazure/?WT.srch=1&amp;WT.mc_id=SEARCH" mce_href="https://www.microsoft.com/windowsazure/?WT.srch=1&amp;WT.mc_id=SEARCH"><SPAN style="COLOR: windowtext">AppFabric Access Control</SPAN></A> (ACS)</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'">. In the process, I ran into a few issues worth documenting.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></P>
<H1 style="MARGIN: 24pt 0in 0pt"><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 11pt"><FONT color=#365f91><FONT size=2><FONT face=verdana,geneva>Hello, World!<o:p></o:p></FONT></FONT></FONT></SPAN></H1>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>Before we get to harder problems, let’s make sure we have the basics right.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>If you’re doing Silverlight client development, then you probably already know that any service accessed by a Silverlight client must either be </FONT><A href="https://msdn.microsoft.com/en-us/library/cc189008(VS.95).aspx" mce_href="https://msdn.microsoft.com/en-us/library/cc189008(VS.95).aspx"><FONT face=verdana,geneva>hosted from the same Internet zone, domain and scheme as the client</FONT></A><FONT face=verdana,geneva>, or have a cross domain </FONT><A href="https://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx" mce_href="https://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx"><FONT face=verdana,geneva>security policy file</FONT></A><FONT face=verdana,geneva> in place. What you may not know is that the </FONT><A href="https://blogs.msdn.com/netservices" mce_href="https://blogs.msdn.com/netservices"><FONT face=verdana,geneva>AppFabric Team</FONT></A><FONT face=verdana,geneva> recently released a version of ACS to </FONT><A href="https://blogs.msdn.com/netservices/archive/2010/03/11/now-available-the-windows-azure-platform-appfabric-labs-environment.aspx" mce_href="https://blogs.msdn.com/netservices/archive/2010/03/11/now-available-the-windows-azure-platform-appfabric-labs-environment.aspx"><SPAN style="COLOR: windowtext"><FONT face=verdana,geneva>AppFabric Labs</FONT></SPAN></A><FONT face=verdana,geneva> with a cross domain security policy file, allowing access from any domain over either http or https to any path below the base URI of any STS endpoint. You should be able to obtain and inspect the file using your web browser.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>You probably also know that you need to </FONT><A href="https://msdn.microsoft.com/en-us/library/dd920295(VS.95).aspx" mce_href="https://msdn.microsoft.com/en-us/library/dd920295(VS.95).aspx"><FONT face=verdana,geneva>specify client HTTP handling</FONT></A><FONT face=verdana,geneva> for REST endpoints like ACS. What you may not know is that for cross domain access to data using </FONT><A href="https://msdn.microsoft.com/en-us/library/cc838234(VS.95).aspx" mce_href="https://msdn.microsoft.com/en-us/library/cc838234(VS.95).aspx"><FONT face=verdana,geneva>WCF Data Services</FONT></A><FONT face=verdana,geneva> (formerly ADO.NET Data Services), you’ll either need to move to Silverlight 4, or use </FONT><A href="https://www.microsoft.com/downloads/details.aspx?FamilyID=A3DE8C35-8974-4C51-858C-C5A4544C2FED&amp;amp;displaylang=en&amp;displaylang=en" mce_href="https://www.microsoft.com/downloads/details.aspx?FamilyID=A3DE8C35-8974-4C51-858C-C5A4544C2FED&amp;amp;displaylang=en&amp;displaylang=en"><FONT face=verdana,geneva>ADO.NET Data Services for Silverlight 3 Update CTP3</FONT></A>&nbsp;(thanks to <A href="https://blogs.msdn.com/mflasko/" mce_href="https://blogs.msdn.com/mflasko/">Mike Flasko</A> and <A href="https://blogs.msdn.com/pablo/" mce_href="https://blogs.msdn.com/pablo/">Pablo Castro</A> for that pointer)<FONT face=verdana,geneva>.<o:p></o:p></FONT></SPAN></P>
<H1 style="MARGIN: 24pt 0in 0pt"><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 11pt"><FONT color=#365f91><FONT size=2><FONT face=verdana,geneva>Red Herrings<o:p></o:p></FONT></FONT></FONT></SPAN></H1>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>Now, assuming you’re using the right networking stack, and hitting the AppFabric Labs release of ACS, instead of production, you may see Not Found (404) WebExceptions raised when you try to request a token. <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT face=verdana,geneva><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'">These exceptions are often misleading.</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"> If </SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'">you read the response body, you may find that the problem is reported as an XML formatted “</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'MS Shell Dlg 2'; mso-fareast-font-family: 'Times New Roman'">request unauthorized</SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'">” error in some cases, or as an HTML formatted “HTTP method not allowed” in other cases.<o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>The “request unauthorized” error is expected behavior from ACS when the credentials needed to authenticate with the service are missing. The only surprise here is that it is reported by the Silverlight as Not Found (404), instead of the expected Unauthorized (401).<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>The “HTTP method not allowed” error is more perplexing. When you see it, you may also notice that the web request identified in the exception is not the one you used to do the POST to request the token, but rather a GET with different headers targeting the same URI.<o:p></o:p></FONT></SPAN></P>
<H1 style="MARGIN: 24pt 0in 0pt"><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 11pt; mso-fareast-font-family: 'Times New Roman'"><FONT color=#365f91><FONT size=2><FONT face=verdana,geneva>The Case of the Missing Slash<o:p></o:p></FONT></FONT></FONT></SPAN></H1>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><FONT face=verdana,geneva><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: Arial; mso-fareast-font-family: 'Times New Roman'">The “HTTP method not allowed” error </SPAN><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'">can be hard to track down, since it occurs inside the HTTPS tunnel, where it can’t be directly observed.&nbsp;Aaron Oneal provided the critical clue: when a POST results in a redirect, with auto-redirect enabled, Silverlight strips the request headers and issues a GET to the redirect address, not a POST. User code in the client sees one operation, while the server sees two.<o:p></o:p></SPAN></FONT></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>The clue was enough for </FONT><A href="https://blogs.technet.com/cyrusharvesf/default.aspx" mce_href="https://blogs.technet.com/cyrusharvesf/default.aspx"><FONT face=verdana,geneva>Cyrus Harvesf</FONT></A><FONT face=verdana,geneva> to understand the problem. When the endpoint address used to access ACS doesn’t contain a trailing slash, ACS redirects the caller to the same address with a trailing slash. When the Silverlight networking stack responds with a GET to the redirect address, the GET operation fails because it is not supported by the endpoint.</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>Why didn’t we notice this problem before? <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>Because&nbsp;the .NET framework silently replays POSTs in response to redirects, so omitting the trailing slash didn’t block any scenarios until now, with the enablement of Silverlight access in AppFabric Labs. Even more insidious is that in the case of POSTs to ACS without the trailing slash, the redirect and silent replay take place inside the HTTPS tunnel, where no one can really see what’s going on, even with any of the popular network monitoring tools (e.g., </FONT><A href="https://blogs.technet.com/netmon/" mce_href="https://blogs.technet.com/netmon/"><FONT face=verdana,geneva>NetMon</FONT></A><FONT face=verdana,geneva>, </FONT><A href="https://www.wireshark.org/" mce_href="https://www.wireshark.org/"><FONT face=verdana,geneva>WireShark</FONT></A><FONT face=verdana,geneva>, </FONT><A href="https://www.fiddler2.com/fiddler2/" mce_href="https://www.fiddler2.com/fiddler2/"><FONT face=verdana,geneva>Fiddler</FONT></A><FONT face=verdana,geneva>, etc.).<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>Which behavior is correct?<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><A href="https://blogs.msdn.com/matos/" mce_href="https://blogs.msdn.com/matos/"><FONT face=verdana,geneva>Marco Matos</FONT></A><FONT face=verdana,geneva> notes that the Silverlight behavior is designed to prevent cross site attacks in which request headers on a POST could be redirected to unknown domains. Clearly, this is preferable to the .NET framework behavior, which puts the client at risk. However, the HTTP specification says that in the case of a 301 or 303 response code, the user agent should not redirect the request without explicit permission from the user, unless the request is either a GET or HEAD, for precisely this reason. So, according to the specification, neither behavior is correct.<o:p></o:p></FONT></SPAN></P>
<H1 style="MARGIN: 24pt 0in 0pt"><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 11pt; mso-fareast-font-family: 'Times New Roman'"><FONT color=#365f91><FONT size=2><FONT face=verdana,geneva>Down the Garden Path<o:p></o:p></FONT></FONT></FONT></SPAN></H1>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>Now, here’s the kicker. Most of us copy and paste generated URIs to make sure nothing is lost in translation. However, the AppFabric portal displays the addresses for the endpoints it provisions WITHOUT the trailing slashes required by ACS, thereby ensuring that most of us have it wrong. Quick… go add slashes to all your STS endpoint addresses.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>How should ACS correct the problem? <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>It could fail outright when the trailing slash is missing, instead of redirecting the client. However, changing the behavior now would break existing clients, if they are using URIs without the trailing slashes.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>A better approach would be to preserve the existing behavior in the next release, and to document the problem, with a warning that the behavior may change in later releases. This would give clients time to prepare for the change, by making sure their URIs have trailing slashes.<o:p></o:p></FONT></SPAN></P>
<H1 style="MARGIN: 24pt 0in 0pt"><SPAN style="LINE-HEIGHT: 115%; FONT-FAMILY: 'Verdana','sans-serif'; FONT-SIZE: 11pt; mso-fareast-font-family: 'Times New Roman'"><FONT color=#365f91><FONT size=2><FONT face=verdana,geneva>Catch 22</FONT></FONT></FONT></SPAN></H1>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>So, now we’re ready to rock and roll, right? Not quite. <o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>There’s an important requirement in OAuth WRAP that can’t be satisfied using Silverlight 3 and earlier versions. The specification recommends that that clients place the SWT in the authorization header:<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 0pt 0.5in" class=MsoNoSpacing><SPAN style="mso-bidi-font-family: Calibri; mso-ansi-language: EN; mso-bidi-theme-font: minor-latin" lang=EN><FONT face=verdana,geneva>Clients always present an Access Token to access a Protected Resource.&nbsp; Use of the Authorization header is RECOMMENDED, since HTTP implementations are aware that Authorization headers have special security properties and may require special treatment in caches and logs.&nbsp; Protected Resources SHOULD take precautions to insure that Access Tokens are not inadvertently logged or captured.&nbsp; In addition to the methods presented here, the Protected Resource MAY allow the Client to present the Access Token using any scheme agreed on by the Client and Protected Resource.<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><o:p><FONT face=verdana,geneva></FONT></o:p></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>Unfortunately, the Authorization header can’t be set in versions prior to Silverlight 4 because it’s on the list of restricted headers, and it can only be set in Silverlight 4 when the cross domain security policy file contains an appropriate entry (e.g., an allow-from element with an http-request-headers attribute whose value contains the name of the Authorization header).<o:p></o:p></FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>The best solution is to move to Silverlight 4. However, for clients that can’t make the move, an alternate header should be a workable solution, provided&nbsp;that the service supports it, and configures the cross domain security policy file to allow it, as described above. </FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"><FONT face=verdana,geneva>For example, the OData Service checks both Authorization and X-Authorization.&nbsp;If it finds&nbsp;tokens in both locations, they must be identical. Also, the ACS management service checks Authorization and&nbsp;x-ms-Authorization. If it finds&nbsp;tokens in both locations, it returns an error to the client.</FONT></SPAN></P>
<P style="MARGIN: 0in 0in 10pt" class=MsoNormal><SPAN style="FONT-FAMILY: 'Verdana','sans-serif'; mso-bidi-font-family: 'Times New Roman'; mso-fareast-font-family: 'Times New Roman'"></SPAN>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>How to Use OData for SQL Azure with AppFabric Access Control</title>
      <link>https://docs.microsoft.com/archive/blogs/jackgr/how-to-use-odata-for-sql-azure-with-appfabric-access-control</link>
      <pubDate>Fri, 16 Apr 2010 16:16:00 GMT</pubDate>
      <dc:creator><![CDATA[JackGre]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/jackgr/2010/04/16/how-to-use-odata-for-sql-azure-with-appfabric-access-control/</guid>
      <description><![CDATA[[Created - April 16, 2010]
[Updated - October 5, 2010 - Revised text and URIs to refer to ACS...]]></description>
      <content:encoded><![CDATA[<p><span style="FONT-FAMILY: verdana,geneva">[Created - April 16, 2010]</span></p>
<p><span style="FONT-FAMILY: verdana,geneva">[Updated - October 5, 2010 - Revised text and URIs to refer to ACS production, since ACS Labs is now running ACS v2.]</span></p>
<p><span style="FONT-FAMILY: verdana,geneva">Looking for a way to expose data in SQL Azure to web clients&nbsp;using&nbsp;simple REST based APIs?&nbsp;If so, life just got easier. </span></p>
<p><span style="FONT-FAMILY: verdana,geneva">Over the last few weeks, I've been working with Mike Pizzo and </span><a href="https://blogs.msdn.com/sqlazure"><span style="FONT-FAMILY: verdana,geneva">David Robinson</span></a><span style="FONT-FAMILY: verdana,geneva">, building a portal and Silverlight clients for a new </span><a href="https://blogs.msdn.com/astoriateam/archive/2010/03/18/got-sql-azure-then-you-ve-got-odata.aspx"><span style="FONT-FAMILY: verdana,geneva">OData Service for SQL Azure</span></a><span style="FONT-FAMILY: verdana,geneva">. Together, the OData Portal and Service let you publish </span><a href="https://www.microsoft.com/windowsazure/sqlazure/"><span style="FONT-FAMILY: verdana,geneva">SQL Azure</span></a><span style="FONT-FAMILY: verdana,geneva"> databases as </span><a href="https://www.odata.org/"><span style="FONT-FAMILY: verdana,geneva">OData</span></a><span style="FONT-FAMILY: verdana,geneva"> services using simple configuration. (For more information about SQL Azure, OData or AppFabric Access Control, please see the glossary at the end of this post.)</span></p>
<p><span style="FONT-FAMILY: verdana,geneva">Of&nbsp;course, you can still use&nbsp;</span><a href="https://msdn.microsoft.com/en-us/data/bb931106.aspx"><span style="FONT-FAMILY: verdana,geneva">WCF Data Services</span></a><span style="FONT-FAMILY: verdana,geneva"> (formerly ADO.NET Data Services) to build a custom data service. But, if you just want to expose the data, without any business logic, then the OData Portal and Service provide a no code solution with web friendly security&nbsp;based on </span><a href="https://www.microsoft.com/windowsazure/developers/appfabric/"><span style="FONT-FAMILY: verdana,geneva">AppFabric Access Control</span></a><span style="FONT-FAMILY: verdana,geneva"> (ACS).</span></p>
<p><span style="FONT-FAMILY: verdana,geneva">Try it out using your web browser at </span><a href="https://odata.sqlazurelabs.com/OData.svc/v0.1/hqd7p8y6cy/Northwind"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">this public data service endpoint</span></span></a><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">.</span></span></p>
<h1><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Access Modes</span></h1>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">The OData Service has two access modes: anonymous and authenticated. In both modes, it executes OData queries by impersonating a designated database user. You use the&nbsp;</span><a href="https://www.sqlazurelabs.com/ConfigOData.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">OData Portal</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> to designate database users for both modes.</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span></span>&nbsp;</p>
<ul type="disc" style="MARGIN-TOP: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in">
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Anonymous mode requires no credentials, as the name implies.</span></span></span></li>
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"></span><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Authenticated mode, by contrast, requires clients to pass credentials with their queries. The OData Service uses </span></span><a href="https://oauth-wrap-wg.googlegroups.com/web/SWT-v0.9.5.1.pdf?gda=WIYYYkMAAABFB7PFAFiVedPtjcqT8uuIBb5IK8k6a8yV9t0w7viM-NF2tzlQ33RhT1wW8BFYO1QytiJ-HdGYYcPi_09pl8N7FWLveOaWjzbYnpnkpmxcWg"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Simple Web Token</span></span></a><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> (SWT), a lightweight, web friendly security token format. You can get a SWT to pass to it by querying an ACS based </span></span><a href="https://msdn.microsoft.com/en-us/library/aa480563.aspx"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Security Token Service</span></span></a><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> (STS) using </span></span><a href="https://oauth-wrap-wg.googlegroups.com/web/WRAP-v0.9.7.2.pdf?gda=sb2N3UQAAABFB7PFAFiVedPtjcqT8uuIlgUx-pblyvHNxQFpTPZmKhidFvlYqd_ZjmG9h9kh5-pV6u9SiETdg0Q2ffAyHU-dzc4BZkLnSFWX59nr5BxGqA"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">OAuth WRAP</span></span></a><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">, a lightweight, web friendly authorization protocol. Before going into more detail about how to get a SWT and pass it to the OData service, let's look at the OData Portal.</span></span></li>
</ul>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<h1><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Using the Portal</span></h1>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">To use the OData Portal, visit&nbsp;</span><a href="https://www.sqlazurelabs.com" title="SQL Azure Labs"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Azure Labs</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">, and navigate to the center tab in the top navigation bar, labeled "OData Service for SQL Azure". If you're not already signed in with a valid Windows Live ID, you'll be taken to a sign in page. When you've signed in, connect to a SQL Azure server by providing the server name (e.g., hqd7p8y6cy.database.windows.net), and the name and password for a login with access to the master catalog, and then clicking Connect. </span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">When a connection is made, OData Service configuration data is displayed for the databases on the selected server. Use the drop down list to switch between the databases on the server.</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">To enable&nbsp;OData access to&nbsp;the currently selected database, check the box labeled "Enable OData". When OData access is enabled, database user mapping information is displayed at the bottom of the form. </span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<ul type="disc" style="MARGIN-TOP: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in">
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Use the drop down list labeled "Anonymous Access User" to select an anonymous access user. If an anonymous access user is selected, then all queries against the database presented without credentials will execute by impersonating that user. You can access the database as the anonymous user by clicking on the link provided at the bottom of the page. If no anonymous access user is selected, then the OData Service will not allow anonymous access to the database. </span></span></li>
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Click the link labeled "Add User" to add a user for authenticated access. In the pop up panel, select&nbsp;the user from the drop down list. Leave the issuer name empty for simple authentication, or provide the name of a trusted Security Token Service (STS) for federated authentication. For example, to federate with another ACS based STS, provide the base URI for the STS endpoint&nbsp;displayed by the </span></span><a href="https://appfabric.azure.com/"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Windows Azure AppFabric Portal</span></span></a><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> for the STS, as shown in the first line below.</span></span></li>
</ul>
<p style="MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"><img src="https://blogs.msdn.com/jackgr/attachment/9997545.ashx" alt="Issuer name for ACS based STS" title="Issuer name for ACS based STS" /></span></p>
<p style="MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<ul type="disc" style="MARGIN-TOP: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in">
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Click the "OK" button to complete the configuration process and dismiss the pop up panel. When one or more authenticated access users are added, the OData Service will impersonate them&nbsp;when appropriate credentials are presented. You can designate as many authenticated access users as you like. The OData Service will decide which&nbsp;one to impersonate for each query by inspecting the credentials presented with the query.</span></span></li>
</ul>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<h1><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Building Clients</span></h1>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">For authenticated access, clients pass&nbsp;SWTs to the OData Service. To get a SWT, just query a </span><a href="https://msdn.microsoft.com/en-us/library/aa480563.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Security Token Service</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> (STS) trusted by the OData Service. Currently, the only STS trusted by the OData Service is an ACS based STS located at </span><a href="https://odataacs.accesscontrol.appfabriclabs.com/WRAPv0.9/" title="STS endpoint for the OData Service"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">https://odataacs.accesscontrol.windows.net/WRAPv0.9/</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">. (Note that we are using </span><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">production ACS, not AppFabric Labs, which is now running ACS v2</span><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">.)</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">The query is a token request, as defined by the OAuth WRAP specification: an HTTP POST to the STS endpoint containing a URL encoded form with the following elements:</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<ul type="disc" style="MARGIN-TOP: 0in; unicode-bidi: embed; DIRECTION: ltr; MARGIN-BOTTOM: 0in; MARGIN-LEFT: 0.75in">
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">The name of the protected resource to be accessed (the wrap_scope parameter). In the case of the OData Service, this is the base URI for the data source to be queried.</span></span></li>
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">The name of the issuer to be used for authentication (the wrap_name parameter). In the case of the OData Service, this is the issuer name displayed on the portal. The default issuer name is the base URI for the data source to be queried with the database user name appended as a path segment (e.g., https://odata.sqlazurelabs.com/OData.svc/v0.1/tatbuixa8p/Pubs/pubsuser). To enable federation, the name of an STS can be provided, instead of the default issuer name, as described above. Note, however that if you plan to use federation, the alternate issuer name must be specified on the OData Portal before you can use it to request a SWT.</span></span></li>
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">The secret key for the specified issuer name (the wrap_password parameter). In the case of the OData Service, this is the secret key for the database user displayed on the OData Portal.</span></span></li>
<li style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px; VERTICAL-ALIGN: middle"><span style="FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">One or more claims, expressed as form parameters. The OData Service requires&nbsp;a single claim (authorized=true).</span></span></li>
</ul>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Here is a typical token request body (note -&nbsp;the real secret key is not shown for security purposes):</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: 'Courier New'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">wrap_scope=https%3a%2f%2fodata.sqlazurelabs.com%2fOData.svc%2fv0.1%2fhqd7p8y6cy%2fAdventureWorks&amp;wrap_name=https%3a%2f%2fodata.sqlazurelabs.com%2fOData.svc%2fv0.1%2fhqd7p8y6cy%2fAdventureWorks%2fodata_guest&amp;wrap_password=9vR4uV7GvBXUcYhcBtbuPWJDwUPKu0UCd%2b%2bRJRC7Egw%3d&amp;authorized=true</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">If the token request is valid, then the STS will return a SWT in the body of the response as an URL encoded form. Here is a typical SWT for the OData Service (note - this token has expired, and therefore cannot be used):</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: 'Courier New'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">user=odata_guest&amp;Issuer=https%3a%2f%2fodataacs.accesscontrol.windows.net%2f&amp;Audience=https%3a%2f%2fodata.sqlazurelabs.com%2fOData.svc%2fv0.1%2fhqd7p8y6cy%2fAdventureWorks&amp;ExpiresOn=1271458956&amp;HMACSHA256=St1j434tXjyXbSJMPoAY6gsFMTzc3xsLum1UgvXokpw%3d</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SWTs issued by the STS for the OData Service expire 3 minutes after they are issued. Your client should therefore either request a new SWT for each query, or&nbsp;reuse SWTs to reduce network usage, checking the expiration timestamp as necessary, and requesting a new SWT&nbsp;whenever the&nbsp;current one expires.</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">To pass a SWT to the OData Service, place it in either the Authorization or X-Authorization header, encoding it as follows:</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.75in; FONT-FAMILY: 'Courier New'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">WRAP access_token="user=odata_guest&amp;Issuer=https%3a%2f%2fodataacs.accesscontrol.windows.net%2f&amp;Audience=https%3a%2f%2fodata.sqlazurelabs.com%2fOData.svc%2fv0.1%2fhqd7p8y6cy%2fAdventureWorks&amp;ExpiresOn=1271458956&amp;HMACSHA256=St1j434tXjyXbSJMPoAY6gsFMTzc3xsLum1UgvXokpw%3d"</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: Calibri; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Which header should you use? The standard Authorization header is recommended by the OAuth WRAP specification, and is therefore preferred. However, it cannot be set by user code in Silverlight 3 and earlier. Silverlight 4 does let user code set it, but only if the clientaccesspolicy.xml file on the target service contains an allows-from entry with an appropriate http-request-headers attribute. The OData service checks both headers for SWTs. If SWTs are found in both locations, they must match.</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">For more information about how to request and pass SWTs, see </span><a href="https://msdn.microsoft.com/en-us/library/ee173584.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">the AppFabric SDK</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">, especially </span><a href="https://msdn.microsoft.com/en-us/library/ee732536.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">the Programming Guide</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> and </span><a href="https://msdn.microsoft.com/en-us/library/ee706741.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Samples</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">. Maciej Skierkowski also has some excellent examples on </span><a href="https://blogs.msdn.com/sskier/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">his blog</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">, including examples for PHP, Java and Python. For more information about identity federation, see </span><a href="https://blogs.msdn.com/jackgr/archive/2009/12/16/it-s-a-wrap-wrap-v0-9-to-be-precise.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">my blog post</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> on using ACS with Codename "Dallas", and </span><a href="https://code.msdn.microsoft.com/fabrikamjets/Wiki/View.aspx?title=Home"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">the FabrikamJets example</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> on Code Gallery.</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<h1><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">What Now?</span></h1>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">That's all there is to it. It's easy to get started, so visit the OData Portal, enter your SQL Azure server information, and try it out. If you don't have a SQL Azure server, you can provision one easily on the </span><a href="https://sql.azure.com/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Azure Portal</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">.</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<h1><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Glossary</span></h1>
<h2><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Azure</span></h2>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><a href="https://www.microsoft.com/windowsazure/sqlazure/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Azure</span></a><span style="FONT-FAMILY: verdana,geneva"><span style="FONT-FAMILY: ; FONT-SIZE: x-small"> is <span style="COLOR: #353535">a highly available, scalable, multi-tenant, cloud-based relational database service hosted in </span></span></span><a href="https://www.microsoft.com/windowsazure/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Windows Azure</span></a><span style="COLOR: #353535"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> and based on </span></span><a href="https://www.microsoft.com/everybodysbusiness/en/us/default.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Server</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">. <span style="COLOR: #353535">U</span>sers can provision SQL Azure virtual servers using the </span><a href="https://sql.azure.com/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Azure Portal</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> access them over the Internet.</span></p>
<h2><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Azure Labs</span></h2>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><a href="https://www.sqlazurelabs.com/default.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">SQL Azure Labs</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> is a site that the SQL Azure team is using to publish incubations and early preview bits for products and enhancements in order to gather feedback from the community. Usage of the&nbsp;services in the Labs environment&nbsp;is not billed. Note, however, that usage of production services accessed through the services in the Labs environment will be billed, if applicable. For example, usage of the OData Service is not billed, but usage of an underlying SQL Azure server accessed through the OData Service will be billed, if applicable. Please note that there is no support or SLA associated with the Labs environment, but in return you can preview the future of SQL Azure while helping to shape it. Though similar to a Community Technology Preview, SQL Azure Labs technologies may occasionally be even farther away from commercial availability.<br /></span></p>
<h2><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">OData</span></h2>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">The Open Data Protocol (</span><a href="https://www.odata.org/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">OData</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">) is an emerging standard for querying and updating data from a wide variety of sources over the Internet using REST based protocols. It extends several existing standards, including Atom (RFC 4287), an XML format for describing structured data as collections of entries consisting of typed name-value pairs, and AtomPub (RFC 5023), a protocol for getting, adding, updating and removing entries. OData builds on the foundation they provide, adding a familiar entity relationship based data model for describing collections, a query language, formatting facilities, and other features required to enable simple and efficient access to structured data over the Internet. </span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span>&nbsp;</p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">As </span><a href="https://msdn.microsoft.com/en-us/data/ff478141.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Chris Sells</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> points out, OData is analogous to earlier data access standards like JDBC, ODBC and OLEDB. Rather than target a platform, however, it targets Web applications, regardless of implementation technology. OData is supported by many Microsoft products, including Windows Azure Storage, SQL Server 2008 R2, Excel 2010, SharePoint 2010, and </span><a href="https://msdn.microsoft.com/en-us/data/bb931106.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">WCF Data Services</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> (formerly ADO.NET Data Services), which provides client libraries for .NET, Silverlight, AJAX, PHP and Java. It is also supported by </span><a href="https://ibm.com/developerworks/websphere/downloads/xs_rest_service.html"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">IBM's WebSphere eXtreme Scale REST data service</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> and the </span><a href="https://www.microsoft.com/industry/government/opengovdata/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Open Government Data Initiative</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">. OData is published under the </span><a href="https://www.microsoft.com/interop/osp/default.mspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Open Specification Promise</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">, so that anyone can build servers, clients or tools without royalties or restrictions. For more information see, the </span><a href="https://msdn.microsoft.com/en-us/data/ee844254.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">OData FAQ</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> on MSDN.</span></p>
<h2><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">AppFabric Access Control</span></h2>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><a href="https://www.microsoft.com/windowsazure/appfabric/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">AppFabric Access Control</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> (ACS) is a REST based service that hosts Security Token Services (STSs) provisioned with the </span><a href="https://appfabric.azure.com/"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Windows Azure AppFabric Portal</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">. ACS based STSs support claims based authentication and authorization using multiple credential types, including SAML and X.509 certificates, and federate with </span><a href="https://www.microsoft.com/windowsserver2008/en/us/ad-main.aspx"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small">Active Directory Federation Services</span></a><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"> and other standards based identity providers.</span></p>
<p style="MARGIN: 0in 0in 0in 0.375in; FONT-FAMILY: 'Segoe UI'; FONT-SIZE: 11pt"><span style="FONT-FAMILY: verdana,geneva; FONT-SIZE: x-small"></span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Components.PostAttachments/00/09/99/75/45/ACSBasedSTSIssuerName.PNG" original-url="https://blogs.msdn.com/cfs-file.ashx/__key/communityserver-components-postattachments/00-09-99-75-45/ACSBasedSTSIssuerName.PNG">ACSBasedSTSIssuerName.PNG</a></p>]]></content:encoded>
    </item>
  </channel>
</rss>