<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Phil's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/philpenn/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/philpenn/feed.xml</link>
    <description>Phil Pennington @ MSFT</description>
    <lastBuildDate>Wed, 17 Apr 2019 04:01:00 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>HealthVault + Your Web Service + Your Client Apps</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/healthvault-your-web-service-your-client-apps</link>
      <pubDate>Mon, 03 Jun 2013 08:28:00 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2013/06/03/healthvault-your-web-service-your-client-apps/</guid>
      <description><![CDATA[Cloud hosted services such as HealthVault, Windows Azure, Office365, Dynamics Online, and others...]]></description>
      <content:encoded><![CDATA[<p>Cloud hosted services such as HealthVault, Windows Azure, Office365, Dynamics Online, and others provide a great canvas upon which to compose both consumer and enterprise solutions. In this article, we'll establish a foundation upon which to "front-end" a number of HealthVault solution scenarios. We'll illustrate the use of a web-service (hosted on Windows Azure, of course) to encapsulate HealthVault specific feature-areas that we subsequently wish to expose for our client applications. In a subsequent article, we'll illustrate how this approach enables flexible support of differing client types including enterprise systems, mobile devices, and web-applications.</p>
<p><a href="http://db.tt/OuARaRWm" target="_blank">Download</a> this article as a PDF document.</p>
<p><a title="Download" href="http://code.msdn.microsoft.com/HealthVault-Your-Web-0f0d0142" target="_blank">Download</a> corresponding Visual Studio 2012 project files.</p>
<h3>Basic Configuration</h3>
<p>The figure below illustrates the HealthVault Proxy Service using an Offline application deployment configuration. Notice that the HealthVault Proxy Service is a client of the HealthVault platform whilst Client Apps, interface directly only with the proxy.</p>
<p>This web-service does not need its own database and does not keep any state. It can easily run on an Azure WebSite or within an Azure WebRole. The proxy may also be deployed using an on-premises web-server for an enterprise scenario. Our Proxy Service exposes WCF (i.e. SOAP) service-interfaces. But, the sample could be modified to expose a REST interface instead.&nbsp; We will defer that exercise for now in favor of some pending experimentation with Windows Azure Mobile Services (coming soon).</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6471.clip_image001_711855C2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6471.clip_5F00_image001_5F00_711855C2.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image001" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/4338.clip_image001_thumb_105AFC96.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/4338.clip_5F00_image001_5F00_thumb_5F00_105AFC96.png" alt="clip_image001" width="817" height="461" border="0" /></a></p>
<p>Figure 1. Basic Solution Architecture</p>
<p>The HealthVault Proxy Service exposes three primary service-interfaces for client apps. These interfaces correspond to HealthVault feature areas. Specifically, <strong>Patient Connect</strong>, <strong>Get/Put Things</strong>, <strong>DOPU</strong>.</p>
<p><strong>Note</strong>: Learn more about HealthVault solution architectures and platform features at (<a href="http://blogs.msdn.com/b/healthvault/archive/2013/05/18/revisiting-connectivity-models-and-solutions-architectures.aspx">http://blogs.msdn.com/b/healthvault/archive/2013/05/18/revisiting-connectivity-models-and-solutions-architectures.aspx</a>).</p>
<p>&nbsp;</p>
<h3>Establish your Development and Test Environment</h3>
<h4>&nbsp;</h4>
<h4>The Pre-Production Environment</h4>
<p>From a platform perspective, HealthVault supports an <a href="http://www.microsoft.com/en-us/healthvault/tools-devices/overview.aspx">ecosystem</a> of applications and devices.&nbsp;&nbsp; The HealthVault platform is well-documented with open support for practically any web-based client solution.&nbsp; However, for integrity and security purposes, programmatic access to real user accounts is controlled.&nbsp; In order to access the production HealthVault service, client applications must be authorized to access not only the production service itself but also individual consumer accounts hosted therein.&nbsp;&nbsp;</p>
<p>This authorization process first involves development of your application utilizing a freely accessible <a href="https://account.healthvault-ppe.com/">Pre-Production Environment</a> (PPE).&nbsp;&nbsp; Once you have completed development and testing of your application using the PPE, then you may <a href="http://msdn.microsoft.com/en-us/healthvault/bb962148.aspx">apply</a> for authorized access to the production environment; a process termed &ldquo;Go Live&rdquo;.&nbsp;&nbsp;</p>
<p>The Pre-Production Environment enables you to develop and test a complete end-to-end solution and thus gain a high-degree of confidence prior to final deployment.&nbsp;&nbsp; Note that all PPE uniform resource identifiers (URIs) correspond to production environment URIs but with the &ldquo;-ppe&rdquo; suffix appended to the domain name (e.g. account.healthvault-ppe.com).&nbsp;&nbsp;</p>
<p>Spend a few moments up-front establishing a HealthVault PPE &ldquo;existing&rdquo; user-account for your development purposes.&nbsp; User logon and authentication to PPE corresponds exactly to the production HealthVault platform in that you may select from Windows Live, Facebook, or OpenID authentication.&nbsp;&nbsp; We recommend creating a new test account using <a href="http://outlook.com/">Outlook.com</a> as illustrated.&nbsp;&nbsp; You should first create the test account using Outlook.com, Facebook, or OpenID, and then proceed to the PPE environment in order to associate your new user-account with a corresponding HealthVault PPE account.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/91/47/metablogapi/4885.MSALogon_1A713563.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-91-47-metablogapi/4885.MSALogon_5F00_1A713563.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image002" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/3348.clip_image002_0FEEC9A1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/3348.clip_5F00_image002_5F00_0FEEC9A1.png" alt="clip_image002" width="535" height="314" border="0" /></a></p>
<p>When you now logon to the <a href="https://account.healthvault-ppe.com/signup/new">HealthVault PPE Shell</a> as a new user, the Shell creates an authorization workflow that associates your user-account with your corresponding authentication service.&nbsp;&nbsp;</p>
<p>Consider end-user usage scenarios.&nbsp; A common HealthVault end-user usage scenario involves a family.&nbsp; A family healthcare manager (e.g. &ldquo;Mom&rdquo;) may configure, access, and manage HealthVault accounts for each family member (e.g. &ldquo;Dad&rdquo;, &ldquo;Son&rdquo;, &ldquo;Daughter&rdquo;).&nbsp;&nbsp; Spend a few moments exploring the HealthVault PPE Shell.&nbsp;&nbsp; Note that the &ldquo;Health Information&rdquo; section corresponds to collections of data-types that you may access from your solutions.</p>
<p><a href="https://account.healthvault-ppe.com/"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image003" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6813.clip_image003_417A3736.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6813.clip_5F00_image003_5F00_417A3736.png" alt="clip_image003" width="540" height="424" border="0" /></a></p>
<p>&nbsp;</p>
<h4>Register your HealthVault Proxy Service Application</h4>
<p>The proxy service will need to be registered as a HealthVault application with a corresponding Application ID. Additionally, an X.509 Certificate will need to be generated and the public key provided to the HealthVault platform. The corresponding private key will be hosted within the proxy service itself and utilized for mutual authentication and encryption between the proxy service and HealthVault. You&rsquo;ll want to first install the <a href="http://www.microsoft.com/en-us/download/details.aspx?id=3418">HealthVault .NET SDK</a> on your development workstation along with Visual Studio.</p>
<p>After installation of the HealthVault .NET SDK, you will need to register your proxy application using the <a href="https://config.healthvault-ppe.com/">HealthVault Application Configuration Center</a> (ACC).&nbsp; The ACC enables a solution developer to associate an Application ID as well as a Public Key Certificate with a new HealthVault application.&nbsp;&nbsp; A view of the ACC portal appears below.&nbsp; Although you may accomplish the necessary registration steps using just the portal, don&rsquo;t do so now.&nbsp;&nbsp; We will instead utilize a tool included with the HealthVault SDK, the Application Manager, which automates this task.</p>
<p><a href="https://config.healthvault-ppe.com/"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image004" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/4331.clip_image004_482D40B9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/4331.clip_5F00_image004_5F00_482D40B9.png" alt="clip_image004" width="633" height="311" border="0" /></a></p>
<p>From the Tools folder within the HealthVault .NET SDK installation path (e.g. C:\Program Files (x86)\Microsoft HealthVault\SDK\Tools) start the HealthVault <strong>Application Manager</strong> (i.e. ApplicationManager.exe).&nbsp;&nbsp; Within the illustration below, note that I&rsquo;ve already used Application Manager to create a new &ldquo;HealthVaultProxy&rdquo; sample.&nbsp;&nbsp; Also note the link to the HealthVault Application Configuration Center (ACC) along with a short-cut to the local machine Computer Certificates store.&nbsp;&nbsp; For our HealthVault proxy-service application, we will instead utilize the &ldquo;Create New Application&rdquo; feature.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6320.clip_image005_07F7273F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6320.clip_5F00_image005_5F00_07F7273F.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image005" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1122.clip_image005_thumb_47C10DC4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1122.clip_5F00_image005_5F00_thumb_5F00_47C10DC4.png" alt="clip_image005" width="634" height="382" border="0" /></a></p>
<p>Press the <strong>Create New Application</strong> button now.&nbsp;&nbsp; This action opens the following dialog window.&nbsp; For this scenario, we will not ask the Application Manager to also create a Visual Studio project directly but rather only utilize Application Manager to configure our application meta-data including Application ID and Certificate.</p>
<p>Within the Create New Application dialog window, type your solution name and <em><span style="text-decoration: underline;">uncheck</span></em> the field labeled &ldquo;Automatically create Visual Studio website for this Appliction&rdquo;.&nbsp;&nbsp; Press <strong>Create and Register Application</strong>.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/91/47/metablogapi/1258.ApplicationManager-CreateNewApplication_043B1A11.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-91-47-metablogapi/1258.ApplicationManager_2D00_CreateNewApplication_5F00_043B1A11.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image006" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6835.clip_image006_599DA191.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6835.clip_5F00_image006_5F00_599DA191.png" alt="clip_image006" width="421" height="282" border="0" /></a></p>
<p>Notice that this action launches the HealthVault Application Configuration Center (ACC) within a browser window.&nbsp;&nbsp; You will first be prompted to logon.&nbsp;&nbsp; Use an account that will be considered your Development Manager or Release Manager Account.&nbsp; At the Terms and Conditions page, read and accept the agreement then select Create Application.&nbsp; This registers your application with the HealthVault Pre-Production Environment and redirects your browser to the Application Configuration Center default page.&nbsp;&nbsp; Your application name and assigned Application ID appear listed therein. The image below will differ based upon your specific application name and Application ID.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1638.clip_image007_19678817.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1638.clip_5F00_image007_5F00_19678817.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image007" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0820.clip_image007_thumb_071EC155.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0820.clip_5F00_image007_5F00_thumb_5F00_071EC155.png" alt="clip_image007" width="841" height="603" border="0" /></a></p>
<p>Also notice that the HealthVault Application Manager displays a new entry with a corresponding new self-signed certificate.&nbsp; By convention, the Certificate Name corresponds to the assigned Application ID.&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2502.clip_image008_6C05F246.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2502.clip_5F00_image008_5F00_6C05F246.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image008" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0535.clip_image008_thumb_5DC77956.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0535.clip_5F00_image008_5F00_thumb_5F00_5DC77956.png" alt="clip_image008" width="689" height="415" border="0" /></a></p>
<p>Click the Computer Certificates link.&nbsp;&nbsp; Notice the corresponding new certificate stored within the Local Computer certificate store.&nbsp;&nbsp; Be sure to save and protect this certificate as it contains both your public and private RSA keys.&nbsp;&nbsp; Plan to distribute only an exported certificate file containing your public key (typically saved as a file with the .cer extension).&nbsp;&nbsp; A certificate containing only your public key has been automatically added to the Application Configuration Center during the Create Application step above.&nbsp; Before moving your application to production, you may wish to assign a new production-only public-private key pair (i.e. a new certificate).</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/91/47/metablogapi/6567.ComputerCertificates_7CAFAAA3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-91-47-metablogapi/6567.ComputerCertificates_5F00_7CAFAAA3.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image009" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2133.clip_image009_6B2D8C5C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2133.clip_5F00_image009_5F00_6B2D8C5C.png" alt="clip_image009" width="849" height="181" border="0" /></a></p>
<p>Let&rsquo;s export the certificate file.&nbsp; This may be done either from the <strong>ComputerCertificates</strong> console immediately above or via the <strong>HealthVault Application Manager</strong>.&nbsp;&nbsp; Using the HealthVault Application Manager, right-click the Certificate Name and select <strong>Export public and private keys (.pfx).</strong>&nbsp;&nbsp; Choose a destination folder that will be associated with the proxy-service solution files included with the Solutions Accelerator. The Visual Studio project&rsquo;s &ldquo;App_Data&rdquo; folder is a good choice for prototype development purposes.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/91/47/metablogapi/8015.HealthVaultApplicationManager-3_3C799129.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-91-47-metablogapi/8015.HealthVaultApplicationManager_2D00_3_5F00_3C799129.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image010" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/5684.clip_image010_0350F6B8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/5684.clip_5F00_image010_5F00_0350F6B8.png" alt="clip_image010" width="845" height="355" border="0" /></a></p>
<p>We are now ready to return to the HealthVault <a href="https://config.healthvault-ppe.com/default.aspx">Application Configuration Center</a> and complete the application registration process.&nbsp; Within your browser, click on the Application ID link for the HealthVault Proxy Service application.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/3157.clip_image0071_548B3E15.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/3157.clip_5F00_image0071_5F00_548B3E15.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image0071" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/4075.clip_image0071_thumb_01A02AE4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/4075.clip_5F00_image0071_5F00_thumb_5F00_01A02AE4.png" alt="clip_image0071" width="832" height="597" border="0" /></a></p>
<p>The resultant tab&rsquo;ed web page represents your opportunity to tell the HealthVault platform about your application including why it needs access to HealthVault user-information, what fields will be accessed, whom to contact for management purposes, and additional rules and properties that you can explore later.&nbsp;&nbsp; For now, navigate to the <strong>Offline Rules</strong> tab and select Edit.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/91/47/metablogapi/5383.HealthVaultApplicationConfigurationCenter-5_581E1D1F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-91-47-metablogapi/5383.HealthVaultApplicationConfigurationCenter_2D00_5_5F00_581E1D1F.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image011" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/4162.clip_image011_39DEA1FC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/4162.clip_5F00_image011_5F00_39DEA1FC.png" alt="clip_image011" width="840" height="293" border="0" /></a></p>
<p>Each HealthVault application will have a unique set of data-access requirements depending upon your solution requirements.&nbsp; Hence, we&rsquo;ll need access to a specific and custom set of information data-types within consumer HealthVault records.&nbsp;&nbsp; Select that field group as illustrated below.&nbsp;&nbsp; Be careful to also scroll the window further down and press the Save button.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/91/47/6523.AccConfiguration.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-91-47/6523.AccConfiguration.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image012" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6131.clip_image012_4744B502.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6131.clip_5F00_image012_5F00_4744B502.png" alt="clip_image012" width="836" height="743" border="0" /></a></p>
<p><strong>Note</strong>: It&rsquo;s common to configure both an Online rule and an Offline rule with the same configuration. This provides flexibility in solution architecture in that you may then provide both a User Portal as well as a Web Service usage experience.</p>
<p>Next, switch to the <strong>Methods</strong> tab within the HealthVault Application Configuration Center web-page. Configure your application as indicated within the following image. These "method" settings enable our application to utilize HealthVault platform features including "Patient Connect", "Drop-Off and Pick-Up", and to send insecure email messages.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2844.clip_image013_52020C57.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2844.clip_5F00_image013_5F00_52020C57.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image013" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6165.clip_image013_thumb_11CBF2DD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6165.clip_5F00_image013_5F00_thumb_5F00_11CBF2DD.png" alt="clip_image013" width="823" height="523" border="0" /></a></p>
<p>Browse the additional tabs to familiarize yourself with additional configuration options. The <strong>Admins</strong> tab enables you to invite additional configuration managers to access this application configuration. At this point, you have everything you need to now configure and build the proxy-service sample application.</p>
<h3>&nbsp;</h3>
<h3>Configure, Build, and Deploy Your HealthVault Proxy Service</h3>
<h4>&nbsp;</h4>
<h4>Modify your Project Settings</h4>
<p>Now that you&rsquo;ve utilized the HealthVault Application Configuration Center to register a new Application ID and a have corresponding X.509 certificate file, you may proceed to configure the sample proxy service project. Download the project files using the link provided at the start of this article.&nbsp; Open the solution using Visual Studio. From within Solution Explorer, select and edit the <strong>HealthVaultAppSetting.cs</strong> file as illustrated.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/5582.clip_image014_187EFC60.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/5582.clip_5F00_image014_5F00_187EFC60.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image014" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1385.clip_image014_thumb_5848E2E5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1385.clip_5F00_image014_5F00_thumb_5F00_5848E2E5.png" alt="clip_image014" width="228" height="451" border="0" /></a></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/5187.clip_image015_1812C96B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/5187.clip_5F00_image015_5F00_1812C96B.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image015" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7585.clip_image015_thumb_05CA02A9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7585.clip_5F00_image015_5F00_thumb_5F00_05CA02A9.png" alt="clip_image015" width="836" height="406" border="0" /></a></p>
<p>Replace the dummy <strong>ApplicationID</strong> with your own as illustrated. Also set the .pfx certificate file name to match your new certificate file.</p>
<p><strong>Note</strong>: Copy your certificate file (.pfx) into the solution&rsquo;s <strong>App_Data</strong> folder. Be sure to set the certificate file property as &ldquo;copy if newer&rdquo; within the Visual Studio solution.</p>
<p>Also, note the <strong>myValidTokens</strong> Guid array within the <strong>AppSettings</strong> class. The corresponding list of tokens represents the list of client systems authorized (by you) to utilize this proxy service for access to HealthVault records. You must utilize and manage these tokens according to your business and solution deployment requirements. A typical scenario is to assign individual tokens to either separate departmental clinical systems or to individual client applications (e.g. enterprise tablets).&nbsp;&nbsp;</p>
<p><em><span style="background-color: #ffff00;"><strong><span style="text-decoration: underline;">Note</span>:</strong>&nbsp; Each of your client applications will share the same consumer record-set associated with your Application ID.&nbsp;&nbsp; You will need to understand this scenario and ensure that your organizational access to HealthVault lands within the purview of terms of service and privacy constraints.&nbsp; In effect you are responsible for authenticated and secure access to consumer records accessible via your web-service.&nbsp;&nbsp; The sample code provided is for illustration and concept discovery purposes only and does not represent implementation of a web-service with complete authentication nor secure-access features.</span></em></p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2388.clip_image016_57707CFB.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2388.clip_5F00_image016_5F00_57707CFB.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image016" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/4530.clip_image016_thumb_694D10C8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/4530.clip_5F00_image016_5F00_thumb_5F00_694D10C8.png" alt="clip_image016" width="843" height="431" border="0" /></a></p>
<p>In effect, our "token list" represents a shared-secret model of client-application support. Before moving this sample to production, you would want to implement a more sophisticated token-management facility than the simple Guid array provided. One possible approach is to implement a management interface that enables both application authentication as well as timeout-period token-generation. This article does not address security considerations beyond configuration of SSL for transport-level encryption between registered clients and the service.</p>
<p>&nbsp;</p>
<h4>Build and Test your Project</h4>
<p>Use Visual Studio to build your web-service project. A console application project is also included within the sample solution. You may utilize this console application in debug-mode directly from Visual Studio in order to test connectivity and functionality of the web-service project prior to deployment to a hosted environment.</p>
<p>First, update the <strong>Service References</strong> section of the test client application. Initially, configure these service references to utilize the in-solution HealthVaultProxy library project.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6518.clip_image017_70001A4B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6518.clip_5F00_image017_5F00_70001A4B.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image017" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8255.clip_image017_thumb_16CE308C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8255.clip_5F00_image017_5F00_thumb_5F00_16CE308C.png" alt="clip_image017" width="185" height="447" border="0" /></a></p>
<p>Before running the test-client, look at the command-line usage options in file <strong>HVProxyTest.cs</strong>. Initially, just choose the "-<strong>createconnection</strong>" command-line option.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8015.clip_image018_28AAC459.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8015.clip_5F00_image018_5F00_28AAC459.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image018" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8508.clip_image018_thumb_1661FD97.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8508.clip_5F00_image018_5F00_thumb_5F00_1661FD97.png" alt="clip_image018" width="846" height="214" border="0" /></a></p>
<p>Open the project properties windows and configure the Command line arguments section as illustrated.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2235.clip_image019_6F27B461.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2235.clip_5F00_image019_5F00_6F27B461.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image019" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0753.clip_image019_thumb_43E31D5A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0753.clip_5F00_image019_5F00_thumb_5F00_43E31D5A.png" alt="clip_image019" width="608" height="402" border="0" /></a></p>
<p>The -createconnection option will walk you through a sequence of questions and subsequently invoke the following <strong>TestCreateConnection</strong> method. Each of the remaining command-line options have a similar test-method illustrating the use of each web-service interface methods. Review file<strong> HVProxyTest.cs</strong>.</p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7127.clip_image020_6EBB816C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7127.clip_5F00_image020_5F00_6EBB816C.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image020" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2335.clip_image020_thumb_158997AD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2335.clip_5F00_image020_5F00_thumb_5F00_158997AD.png" alt="clip_image020" width="845" height="579" border="0" /></a></p>
<h4>&nbsp;</h4>
<h4>Deploy your HealthVault Proxy Service</h4>
<p>Deploy the WCF web-service project to any IIS web-server reachable via HTTP or HTTPS. Windows Azure offers several web-site hosting environment options. We&rsquo;ve utilized <a href="http://www.windowsazure.com/en-us/home/scenarios/web-sites/">Azure WebSites</a> for hosting our service during development and testing. This approach is very convenient, but not acceptable for production hosting because Azure WebSites doesn&rsquo;t currently support HTTPS endpoints.&nbsp; For production deployment, you&rsquo;ll want to use the Azure Web Role option instead.&nbsp; Proceeding with development/prototype deployment, configure your Windows Azure WebSite using the instructions provided <a href="http://www.windowsazure.com/en-us/manage/services/web-sites/how-to-create-websites/"><strong>here</strong></a>.</p>
<p>Once you have an Azure WebSite endpoint available, download the publish profile as illustrated. You will import this profile into your HealthVaultProxy project from the <strong>Publish</strong> menu.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1185.clip_image021_4A29F3E8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1185.clip_5F00_image021_5F00_4A29F3E8.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image021" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0513.clip_image021_thumb_750257FA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0513.clip_5F00_image021_5F00_thumb_5F00_750257FA.png" alt="clip_image021" width="846" height="506" border="0" /></a></p>
<p>You can easily deploy to an Azure website from within Visual Studio simply by right-clicking your HealthVaultProxy project within Solution Explorer and selecting <strong>Publish</strong>. Select <strong>Import</strong> and open the publish profile previously obtained from your Windows Azure dashboard.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0525.clip_image022_62B99138.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0525.clip_5F00_image022_5F00_62B99138.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image022" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7043.clip_image022_thumb_2DAD0208.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7043.clip_5F00_image022_5F00_thumb_5F00_2DAD0208.png" alt="clip_image022" width="694" height="544" border="0" /></a></p>
<p>Once you have your proxy web-service published to a hosted environment, note the service URL from the Windows Azure WebSite Dashboard. Copy this URL and use it to reconfigure your client-application <strong>Service Reference</strong> endpoints. Note they should point to your new hosted service URL (e.g. "<em>MyProxy.AzureWebSites.net/HVConnect.svc</em>").</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/5822.clip_image023_624D5E43.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/5822.clip_5F00_image023_5F00_624D5E43.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image023" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7571.clip_image023_thumb_7429F210.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7571.clip_5F00_image023_5F00_thumb_5F00_7429F210.png" alt="clip_image023" width="810" height="602" border="0" /></a></p>
<p>&nbsp;</p>
<h4>Enable Transport Security for your HealthVault Proxy Service</h4>
<p>Windows Azure WebSites are great for lots of scenarios including hosted web-services. However, this convenient hosting environment currently doesn&rsquo;t support HTTPS (i.e. SSL).&nbsp; [Correction 6/03 : Azure WebSites has just introduced SSL support.]&nbsp; Hence, you&rsquo;ll need to instead utilize the Windows Azure Web Role (i.e. dedicated virtual machine) deployment model in order to support SSL certificates.</p>
<p>You will need to modify your solution to add an <a href="http://www.windowsazure.com/en-us/develop/net/tutorials/multi-tier-web-site/3-web-role/" target="_blank">Azure Web Role</a> project as indicated.&nbsp; Your HealthVaultProxy service will be hosted on a dedicated (but not state persistent) virtual machine.&nbsp;&nbsp; Learn more about developing solutions with Azure Virtual Machines via the links provided at the end of this article.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/4747.clip_image024_13D8CBD9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/4747.clip_5F00_image024_5F00_13D8CBD9.png"><img style="margin: 0px; display: inline; background-image: none;" title="clip_image024" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/5736.clip_image024_thumb_0CB98F61.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/5736.clip_5F00_image024_5F00_thumb_5F00_0CB98F61.png" alt="clip_image024" width="331" height="253" border="0" /></a></p>
<p>See the following references section for information on using HTTPS with Windows Azure Web Role hosted services.</p>
<ul>
<li>Configuring SSL for an application in Windows Azure (<a href="http://www.windowsazure.com/en-us/develop/net/common-tasks/enable-ssl">http://www.windowsazure.com/en-us/develop/net/common-tasks/enable-ssl</a>)</li>
<li>Configure an SSL Certificate on an HTTPS Endpoint (<a href="http://msdn.microsoft.com/en-us/library/windowsazure/ff795779.aspx">http://msdn.microsoft.com/en-us/library/windowsazure/ff795779.aspx</a>)</li>
</ul>
<p>Corresponding modifications to the HealthVaultProxy project are limited to the web.config file and the system.servicemodel section as illustrated.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7485.clip_image025_6174F859.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7485.clip_5F00_image025_5F00_6174F859.png"><img style="display: inline; background-image: none;" title="clip_image025" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/5355.clip_image025_thumb_53367F69.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/5355.clip_5F00_image025_5F00_thumb_5F00_53367F69.png" alt="clip_image025" width="848" height="454" border="0" /></a></p>
<p>&nbsp;</p>
<h3>Next-Steps</h3>
<p>Please note the following key-points.</p>
<ol>
<li>This project intentionally does not depend upon any HealthVault SDK components on the client-side. All SDK constructs are hidden within the server-side proxy service. This approach is optional. Advantages include removing client-side dependencies and extending the range of possible client types. You may decide to import the Microsoft.Health.ItemTypes.dll assembly into your .NET client application project in order to work with "Thing Types" via C# classes instead of raw XML. Other options include writing simple wrapper classes (as I've done) or perhaps utilizing XSD.exe to generate C# classes from HealthVault Thing Type schema (see the schema type browser at <a href="http://developer.healthvault.com/">http://developer.healthvault.com</a>).</li>
<li>The HealthVault Proxy Service serializes Thing Type data into XML. JSON serialization API's are also available using the HealthVault SDK.</li>
<li>Our project utilizes WCF to expose SOAP based services. This approach is nice for many client application types (especially if you can use tools to generate the client-side proxies). However, it's not so nice for browser-based or JavaScript clients. For that scenario, a REST or HTTP Handler approach would be more ideal. We'll work on that demonstration soon.</li>
<li>There are lots of HealthVault features that we're leaving on the table. One of those is the ability to use built-in Thing Type transforms. A client could use these transforms to render data to HTML, for example, and thus achieve an easily coded HealthVault data-type viewer.</li>
<li>We recommend setting break-points within HealthVaultProxyTest and simply walk-thru the service interface methods to explore how Patient Connect, Get/Put Things, and DOPU work.</li>
<li>Integrate additional Windows Azure platform features.&nbsp;&nbsp; <a href="http://www.windowsazure.com/en-us/develop/net/app-services/">http://www.windowsazure.com/en-us/develop/net/app-services/</a>&nbsp; and <a href="http://www.windowsazure.com/en-us/develop/net/fundamentals/intro-to-windows-azure/">http://www.windowsazure.com/en-us/develop/net/fundamentals/intro-to-windows-azure/</a></li>
<li>Windows Azure virtual machines come in two flavors (persistent and not persistent).&nbsp;&nbsp; Web-role hosted virtual machines are not persistent (also referred to as Platform as a Service, or PAAS).&nbsp;&nbsp; You may wish to use the persistent variety instead (also referred to as Infrastructure as a Service, or IAAS).&nbsp;&nbsp; Advantages of IAAS hosting include easy integration with on-premises services including your Virtual Networks and Active Directory.</li>
</ol>]]></content:encoded>
    </item>
    <item>
      <title>HealthVault Library for Windows Store C#/XAML Sample</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/healthvault-library-for-windows-store-cxaml-sample</link>
      <pubDate>Sat, 25 May 2013 22:38:00 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2013/05/25/healthvault-library-for-windows-store-cxaml-sample/</guid>
      <description><![CDATA[The HealthVault for Windows Store application is now among the most popular Windows Store...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">The </span><a href="http://blogs.msdn.com/b/healthvault/archive/2013/03/06/healthvault-for-windows-is-now-live-in-the-windows-store.aspx" target="_blank"><span style="font-size: small;">HealthVault for Windows Store</span></a><span style="font-size: small;"> application is now among the most popular Windows Store applications.&nbsp; You can utilize the same underlying class library to develop your own HealthVault integrated Windows Store solutions.&nbsp;&nbsp; A recent blog post details availability and usage of the <a href="http://blogs.msdn.com/b/healthvault/archive/2012/10/10/now-available-healthvault-library-for-windows-8.aspx" target="_blank">HealthVault Library for Windows 8</a>.&nbsp; The library itself is available via <a href="http://healthvaultwin8.codeplex.com/" target="_blank">Codeplex</a> and includes library source files along with a WinJS (i.e. JavaScript) sample application.&nbsp;&nbsp; See <a href="http://blogs.msdn.com/b/dorischen/archive/2013/03/25/what-web-developers-need-to-know-to-develop-windows-8-apps.aspx" target="_blank">Doris Chen&rsquo;s</a> recent article for a comprehensive list of Windows 8 developer resources.&nbsp; Herein, we&rsquo;ll simply re-introduce the HealthVault Library for Windows 8 but with a focus upon development using C# and XAML instead of JavaScript.&nbsp;&nbsp; Download the source for this example <a href="http://db.tt/Mxn9sS8u" target="_blank"><strong>here</strong></a>.&nbsp;&nbsp; (5/26/2013 : Note, I found a bug during testing and will refresh the code-drop after further debugging.)</span></p>
<p>&nbsp;</p>
<h3>A Quick Visual to Set Expectations</h3>
<p><span style="font-size: small;">The following image is a screen-capture of the sample application as it opens from within the Visual Studio 2012 Windows Runtime simulator.&nbsp;&nbsp; Please ignore the fact that our sample isn&rsquo;t likely to pass the Windows Store &ldquo;look-and-feel&rdquo; quality-bar.&nbsp;&nbsp; For now, we&rsquo;re only interested in a simple UI experience that maps directly onto the primary HealthVault Library for Windows 8 API&rsquo;s.&nbsp;&nbsp; Notice that you can create a fully functional HealthVault application using only six or seven library functions.</span></p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8015.MyHealthVaultApp-1_45A7BF9E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8015.MyHealthVaultApp_2D00_1_5F00_45A7BF9E.png"><img style="display: inline; background-image: none;" title="MyHealthVaultApp-1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2742.MyHealthVaultApp-1_thumb_32F2C5E7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2742.MyHealthVaultApp_2D00_1_5F00_thumb_5F00_32F2C5E7.png" alt="MyHealthVaultApp-1" width="809" height="500" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">When a user presses the <strong>Connect</strong> button, the application initiates an interactive session with the HealthVault platform.&nbsp;&nbsp; If this is a first-time connection, a redirection to the HealthVault Shell with a logon experience occurs.&nbsp;&nbsp; Subsequent connections use cached credentials.&nbsp;&nbsp; Next, the user may press the <strong>QueryThings</strong> button.&nbsp;&nbsp; This action results in a HealthVault query for a number of data-elements within the user&rsquo;s HealthVault record.&nbsp;&nbsp; Any items returned are display in a scrolling List View wherein the query results are serialized to XML strings and displayed as illustrated.</span></p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1207.MyHealthVaultApp-2_75EE9454.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1207.MyHealthVaultApp_2D00_2_5F00_75EE9454.png"><img style="display: inline; background-image: none;" title="MyHealthVaultApp-2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7802.MyHealthVaultApp-2_thumb_709FADA3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7802.MyHealthVaultApp_2D00_2_5F00_thumb_5F00_709FADA3.png" alt="MyHealthVaultApp-2" width="811" height="499" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">That&rsquo;s it, nothing more than a simple demonstration of connecting-to, reading-from, and writing-to HealthVault platform services.&nbsp;&nbsp; But, hopefully, that&rsquo;s a good place to start and without introducing any unnecessary complexity.</span></p>
<p>&nbsp;</p>
<h3>A Look at our Visual Studio Projects</h3>
<p><span style="font-size: small;">The following image illustrates the contents of the Visual Studio 2012 Solution.&nbsp;&nbsp; Four projects are contained therein.&nbsp;&nbsp; The <strong>HealthVault.Foundation</strong> project builds into an assembly providing lower-level functionality for connecting-to, authenticating-with, and exchanging-data with the HealthVault platform service.&nbsp;&nbsp; The <strong>HealthVault.Runtime</strong> project builds into an assembly providing classes that encapsulate HealthVault data-types as well as classes that assist with storing HealthVault data within the Windows Runtime application cache facility.&nbsp; You must add these two assemblies as references within your Windows Store HealthVault projects.&nbsp;&nbsp; There is no need to use the published HealthVault .NET SDK as that SDK includes assemblies useful for Windows Desktop applications and not for Windows Runtime applications.</span></p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0574.MyHealthVaultSolution-1_08C317FF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0574.MyHealthVaultSolution_2D00_1_5F00_08C317FF.png"><img style="display: inline; background-image: none;" title="MyHealthVaultSolution-1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7345.MyHealthVaultSolution-1_thumb_2152B54F.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7345.MyHealthVaultSolution_2D00_1_5F00_thumb_5F00_2152B54F.png" alt="MyHealthVaultSolution-1" width="300" height="354" border="0" /></a></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">The <strong>hvJS</strong> project is the sample project provided <a href="http://blogs.msdn.com/b/healthvault/archive/2012/10/10/now-available-healthvault-library-for-windows-8.aspx" target="_blank">previously</a> demonstrating use of the aforementioned library but using HTML and JavaScript for the application user-interface.&nbsp;&nbsp; The <strong>hvXamlCS</strong> project is the subject of this blog.&nbsp;&nbsp; All of the code-snippets discussed herein are copied from either the MainPage.xaml file or the MainPage.xaml.cs file.&nbsp;&nbsp; No other files need be modified beyond these two as generated via the <em>New Project + Windows Store + Blank App (XAML)</em> Visual Studio template.</span></p>
<p>&nbsp;</p>
<h3>Constructing our Main Page</h3>
<p><span style="font-size: small;">The following XAML listing is copied from our MainPage.xaml file.&nbsp;&nbsp; Refer to the application UI screen-shots above.&nbsp;&nbsp; The elements herein serve to implement each element of the UI.&nbsp;&nbsp; We&rsquo;re using a parent Grid (line #1) defining three primary rows.&nbsp;&nbsp; Grid-Row 0, line #10, defines our application title-bar.&nbsp;&nbsp; Grid-Row 1, lines #13 thru #21, specify our user-action buttons.&nbsp;&nbsp; Grid-Row 2, lines #22 thru #48, specify the functionality of our scrolling ListView control (aka: our &ldquo;ResultsGrid&rdquo;).</span></p>
<p><span style="font-size: small;">Note the use of DataContext binding at line #3.&nbsp;&nbsp; Since we need to display a list of strings (i.e. a Collection of Strings), we&rsquo;ll specify this in XAML as a CollectionViewSource element.&nbsp;&nbsp; Additional data-binding statement occur further down at line #29 wherein we name the &ldquo;ResultsListView&rdquo; and bind it to the previously named CollectionViewSource &ldquo;CVS&rdquo;.&nbsp; A final binding statement occurs at line #39 in which individual strings within our collection are bound as &ldquo;Result&rdquo; items.</span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">&lt;</span><span class="html">Grid</span> <span class="attr">Background</span><span class="kwrd">="{StaticResource ApplicationPageBackgroundThemeBrush}"</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 2: </span>    <span class="kwrd">&lt;</span><span class="html">Grid.Resources</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 3: </span>        <span class="kwrd">&lt;</span><span class="html">CollectionViewSource</span> <span class="attr">x:Name</span><span class="kwrd">="CVS"</span> <span class="attr">IsSourceGrouped</span><span class="kwrd">="False"</span><span class="kwrd">/&gt;</span></pre>
<pre><span class="lnum"> 4: </span>    <span class="kwrd">&lt;/</span><span class="html">Grid.Resources</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 5: </span>    <span class="kwrd">&lt;</span><span class="html">Grid.RowDefinitions</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 6: </span>        <span class="kwrd">&lt;</span><span class="html">RowDefinition</span> <span class="attr">Height</span><span class="kwrd">="Auto"</span><span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 7: </span>        <span class="kwrd">&lt;</span><span class="html">RowDefinition</span> <span class="attr">Height</span><span class="kwrd">="Auto"</span><span class="kwrd">/&gt;</span></pre>
<pre><span class="lnum"> 8: </span>        <span class="kwrd">&lt;</span><span class="html">RowDefinition</span> <span class="attr">Height</span><span class="kwrd">="*"</span><span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 9: </span>    <span class="kwrd">&lt;/</span><span class="html">Grid.RowDefinitions</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 10: </span>    <span class="kwrd">&lt;</span><span class="html">TextBlock</span> <span class="attr">Text</span><span class="kwrd">="My HealthVault App"</span> </pre>
<pre class="alt"><span class="lnum"> 11: </span>               <span class="attr">Margin</span><span class="kwrd">="12"</span></pre>
<pre><span class="lnum"> 12: </span>               <span class="attr">Style</span><span class="kwrd">="{StaticResource HeaderTextStyle}"</span><span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 13: </span>    <span class="kwrd">&lt;</span><span class="html">StackPanel</span> <span class="attr">Grid</span>.<span class="attr">Row</span><span class="kwrd">="1"</span> <span class="attr">Margin</span><span class="kwrd">="10"</span> <span class="attr">Orientation</span><span class="kwrd">="Horizontal"</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 14: </span>        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">="Connect"</span>  <span class="attr">Click</span><span class="kwrd">="OnConnect"</span> <span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 15: </span>        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">="RevokeConnections"</span>  <span class="attr">Click</span><span class="kwrd">="OnRevokeConnections"</span> <span class="kwrd">/&gt;</span></pre>
<pre><span class="lnum"> 16: </span>        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">="ReConnect"</span>  <span class="attr">Click</span><span class="kwrd">="OnReconnect"</span> <span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 17: </span>        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">="AuthorizeOthers"</span>  <span class="attr">Click</span><span class="kwrd">="OnAuthorizeOthers"</span> <span class="kwrd">/&gt;</span></pre>
<pre><span class="lnum"> 18: </span>        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">="GetThing"</span>  <span class="attr">Click</span><span class="kwrd">="OnGetThing"</span> <span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 19: </span>        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">="QueryThings"</span>  <span class="attr">Click</span><span class="kwrd">="OnQueryThings"</span> <span class="kwrd">/&gt;</span></pre>
<pre><span class="lnum"> 20: </span>        <span class="kwrd">&lt;</span><span class="html">Button</span> <span class="attr">Content</span><span class="kwrd">="PutThing"</span>  <span class="attr">Click</span><span class="kwrd">="OnPutThing"</span> <span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 21: </span>    <span class="kwrd">&lt;/</span><span class="html">StackPanel</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 22: </span>    <span class="kwrd">&lt;</span><span class="html">Grid</span> <span class="attr">x:Name</span><span class="kwrd">="ResultsGrid"</span> <span class="attr">Grid</span>.<span class="attr">Row</span><span class="kwrd">="2"</span> <span class="attr">Margin</span><span class="kwrd">="10"</span> <span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 23: </span>        <span class="kwrd">&lt;</span><span class="html">Grid.Resources</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 24: </span>        <span class="kwrd">&lt;/</span><span class="html">Grid.Resources</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 25: </span>        <span class="kwrd">&lt;</span><span class="html">Grid.RowDefinitions</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 26: </span>            <span class="kwrd">&lt;</span><span class="html">RowDefinition</span> <span class="kwrd">/&gt;</span></pre>
<pre class="alt"><span class="lnum"> 27: </span>            <span class="kwrd">&lt;</span><span class="html">RowDefinition</span> <span class="attr">Height</span><span class="kwrd">="10"</span> <span class="kwrd">/&gt;</span></pre>
<pre><span class="lnum"> 28: </span>        <span class="kwrd">&lt;/</span><span class="html">Grid.RowDefinitions</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 29: </span>        <span class="kwrd">&lt;</span><span class="html">ListView</span> <span class="attr">x:Name</span><span class="kwrd">="ResultsListView"</span> <span class="attr">ItemsSource</span><span class="kwrd">="{Binding Source={StaticResource CVS}}"</span> </pre>
<pre><span class="lnum"> 30: </span>                <span class="attr">Width</span><span class="kwrd">="Auto"</span> <span class="attr">Margin</span><span class="kwrd">="0,0,0,0"</span> <span class="attr">Height</span><span class="kwrd">="Auto"</span> </pre>
<pre class="alt"><span class="lnum"> 31: </span>                <span class="attr">VerticalAlignment</span><span class="kwrd">="Top"</span> <span class="attr">Background</span><span class="kwrd">="DarkGray"</span>  </pre>
<pre><span class="lnum"> 32: </span>                <span class="attr">ScrollViewer</span>.<span class="attr">HorizontalScrollBarVisibility</span><span class="kwrd">="Auto"</span> </pre>
<pre class="alt"><span class="lnum"> 33: </span>                <span class="attr">ScrollViewer</span>.<span class="attr">VerticalScrollBarVisibility</span><span class="kwrd">="Auto"</span> </pre>
<pre><span class="lnum"> 34: </span>                <span class="attr">ScrollViewer</span>.<span class="attr">VerticalScrollMode</span><span class="kwrd">="Enabled"</span> </pre>
<pre class="alt"><span class="lnum"> 35: </span>                <span class="attr">ScrollViewer</span>.<span class="attr">HorizontalScrollMode</span><span class="kwrd">="Enabled"</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 36: </span>            <span class="kwrd">&lt;</span><span class="html">ListView.ItemTemplate</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 37: </span>                <span class="kwrd">&lt;</span><span class="html">DataTemplate</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 38: </span>                    <span class="kwrd">&lt;</span><span class="html">StackPanel</span> <span class="attr">Orientation</span><span class="kwrd">="Horizontal"</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 39: </span>                        <span class="kwrd">&lt;</span><span class="html">TextBlock</span> <span class="attr">x:Name</span><span class="kwrd">="RowText"</span> <span class="attr">Text</span><span class="kwrd">="{Binding Result, Mode=OneWay}"</span> </pre>
<pre><span class="lnum"> 40: </span>                        <span class="attr">Margin</span><span class="kwrd">="0,0,0,0"</span> <span class="attr">Height</span><span class="kwrd">="Auto"</span> <span class="attr">Width</span><span class="kwrd">="Auto"</span>  </pre>
<pre class="alt"><span class="lnum"> 41: </span>                        <span class="attr">ScrollViewer</span>.<span class="attr">VerticalScrollMode</span><span class="kwrd">="Auto"</span> </pre>
<pre><span class="lnum"> 42: </span>                        <span class="attr">ScrollViewer</span>.<span class="attr">HorizontalScrollMode</span><span class="kwrd">="Auto"</span> </pre>
<pre class="alt"><span class="lnum"> 43: </span>                        <span class="attr">ScrollViewer</span>.<span class="attr">BringIntoViewOnFocusChange</span><span class="kwrd">="True"</span> <span class="kwrd">/&gt;</span></pre>
<pre><span class="lnum"> 44: </span>                    <span class="kwrd">&lt;/</span><span class="html">StackPanel</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 45: </span>                <span class="kwrd">&lt;/</span><span class="html">DataTemplate</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 46: </span>            <span class="kwrd">&lt;/</span><span class="html">ListView.ItemTemplate</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 47: </span>        <span class="kwrd">&lt;/</span><span class="html">ListView</span><span class="kwrd">&gt;</span></pre>
<pre><span class="lnum"> 48: </span>    <span class="kwrd">&lt;/</span><span class="html">Grid</span><span class="kwrd">&gt;</span></pre>
<pre class="alt"><span class="lnum"> 49: </span><span class="kwrd">&lt;/</span><span class="html">Grid</span><span class="kwrd">&gt;</span></pre>
</div>
<p>&nbsp;</p>
<p><span style="font-size: small;">Now, let&rsquo;s consider how this XAML specification maps onto our collection of results-strings within the code-behind file, <em>MainPage.xaml.cs</em>.&nbsp;&nbsp; The class &ldquo;ResultItem&rdquo; is used to house a single string item.&nbsp;&nbsp; The class derives from <em>Windows.UI.Xaml.Data.IValueConverter</em> in order to reuse the base functionality of data-exchange between individual ResultItem instances and corresponding individual TextBlock elements within the XAML show above (line #39).</span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>    <span class="kwrd">public</span> <span class="kwrd">class</span> ResultItem : IValueConverter</pre>
<pre><span class="lnum"> 2: </span>    {</pre>
<pre class="alt"><span class="lnum"> 3: </span>        <span class="kwrd">public</span> <span class="kwrd">string</span> Result { get; set; }</pre>
<pre><span class="lnum"> 4: </span>        </pre>
<pre class="alt"><span class="lnum"> 5: </span>        <span class="kwrd">public</span> ResultItem()</pre>
<pre><span class="lnum"> 6: </span>        {</pre>
<pre class="alt"><span class="lnum"> 7: </span>        }</pre>
<pre><span class="lnum"> 8: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 9: </span>        <span class="kwrd">public</span> ResultItem(<span class="kwrd">string</span> result)</pre>
<pre><span class="lnum"> 10: </span>        {</pre>
<pre class="alt"><span class="lnum"> 11: </span>            Result = result;</pre>
<pre><span class="lnum"> 12: </span>        }</pre>
<pre class="alt"><span class="lnum"> 13: </span>&nbsp;</pre>
<pre><span class="lnum"> 14: </span>        <span class="rem">// Convert and ConvertBack derive from IValueConverter and provide data-exchange with UI elements.</span></pre>
<pre class="alt"><span class="lnum"> 15: </span>        <span class="kwrd">public</span> <span class="kwrd">object</span> Convert(<span class="kwrd">object</span> <span class="kwrd">value</span>, Type targetType, <span class="kwrd">object</span> parameter, <span class="kwrd">string</span> language)</pre>
<pre><span class="lnum"> 16: </span>        {</pre>
<pre class="alt"><span class="lnum"> 17: </span>            var item = <span class="kwrd">value</span> <span class="kwrd">as</span> <span class="kwrd">string</span>;</pre>
<pre><span class="lnum"> 18: </span>            <span class="kwrd">object</span> retVal = Result;</pre>
<pre class="alt"><span class="lnum"> 19: </span>            <span class="kwrd">return</span> retVal;</pre>
<pre><span class="lnum"> 20: </span>        }</pre>
<pre class="alt"><span class="lnum"> 21: </span>&nbsp;</pre>
<pre><span class="lnum"> 22: </span>        <span class="kwrd">public</span> <span class="kwrd">object</span> ConvertBack(<span class="kwrd">object</span> <span class="kwrd">value</span>, Type targetType, <span class="kwrd">object</span> parameter, <span class="kwrd">string</span> language)</pre>
<pre class="alt"><span class="lnum"> 23: </span>        {</pre>
<pre><span class="lnum"> 24: </span>            <span class="kwrd">throw</span> <span class="kwrd">new</span> NotImplementedException();   <span class="rem">// we're only using it for one-way visual output.</span></pre>
<pre class="alt"><span class="lnum"> 25: </span>        }</pre>
<pre><span class="lnum"> 26: </span>    }</pre>
</div>
<p>&nbsp;</p>
<p><span style="font-size: small;">We establish our ObservableCollection (i.e. list of ResultItems) further below within <em>MainPage </em>class as illustrated via the following code-snippet (line #8).&nbsp;&nbsp; The instructions at lines #15 and #16 programmatically bind the collection to our parent Grid as the CVS.Source.</span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">public</span> <span class="kwrd">sealed</span> <span class="kwrd">partial</span> <span class="kwrd">class</span> MainPage : Page</pre>
<pre><span class="lnum"> 2: </span>{</pre>
<pre class="alt"><span class="lnum"> 3: </span>    HealthVault.Foundation.HealthVaultAppSettings myAppSettings;</pre>
<pre><span class="lnum"> 4: </span>    HealthVault.Foundation.HealthVaultApp myApp;</pre>
<pre class="alt"><span class="lnum"> 5: </span>&nbsp;</pre>
<pre><span class="lnum"> 6: </span>    <span class="rem">// Use the ObservableCollection for DataContext Binding</span></pre>
<pre class="alt"><span class="lnum"> 7: </span>    <span class="kwrd">private</span> ResultItem resultItem;</pre>
<pre><span class="lnum"> 8: </span>    <span class="kwrd">public</span> ObservableCollection&lt;ResultItem&gt; ResultItems { get; set; }    </pre>
<pre class="alt"><span class="lnum"> 9: </span>&nbsp;</pre>
<pre><span class="lnum"> 10: </span>    <span class="kwrd">public</span> MainPage()</pre>
<pre class="alt"><span class="lnum"> 11: </span>    {</pre>
<pre><span class="lnum"> 12: </span>        <span class="kwrd">this</span>.InitializeComponent();</pre>
<pre class="alt"><span class="lnum"> 13: </span>&nbsp;</pre>
<pre><span class="lnum"> 14: </span>        <span class="rem">// Bind our results string collection to the ListView UI element.</span></pre>
<pre class="alt"><span class="lnum"> 15: </span>        <span class="kwrd">this</span>.ResultItems = <span class="kwrd">new</span> ObservableCollection&lt;ResultItem&gt;();</pre>
<pre><span class="lnum"> 16: </span>        CVS.Source = <span class="kwrd">this</span>.ResultItems;                                  </pre>
<pre class="alt"><span class="lnum"> 17: </span>&nbsp;</pre>
<pre><span class="lnum"> 18: </span>        <span class="rem">// Create HealthVault Application Instance.</span></pre>
<pre class="alt"><span class="lnum"> 19: </span>        <span class="kwrd">this</span>.CreateHealthVaultApplication();   </pre>
<pre><span class="lnum"> 20: </span>    }</pre>
</div>
<p>&nbsp;</p>
<p><span style="font-size: small;">While here, notice the call to CreateHealthVaultApplication(&hellip;) at line #19.&nbsp; This method appears immediately below.&nbsp; This demonstrates how to associate your application with the HealthVault platform.&nbsp;&nbsp; The GUID listed within line #4 is the Application ID associated with this HealthVault application as registered using the HealthVault <a href="https://config.healthvault-ppe.com/default.aspx" target="_blank">Application Configuration Center</a> portal.&nbsp;&nbsp; Learn more about how to register and configure a HealthVault application <a href="http://blogs.msdn.com/b/healthvault/archive/2013/02/18/a-healthvault-application-development-primer-using-asp-net-mvc.aspx" target="_blank">here</a>.</span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">private</span> <span class="kwrd">void</span> CreateHealthVaultApplication()</pre>
<pre><span class="lnum"> 2: </span>{</pre>
<pre class="alt"><span class="lnum"> 3: </span>    <span class="rem">// **** My AppID from config.healthvault-ppe.com ****</span></pre>
<pre><span class="lnum"> 4: </span>    myAppSettings = <span class="kwrd">new</span> HealthVault.Foundation.HealthVaultAppSettings(<span class="str">"8b48e454-f36f-4246-a6b7-b365af4754c4"</span>);   </pre>
<pre class="alt"><span class="lnum"> 5: </span>    myApp = <span class="kwrd">new</span> HealthVault.Foundation.HealthVaultApp(myAppSettings);</pre>
<pre><span class="lnum"> 6: </span>    myApp.AppInfo.InstanceName = <span class="str">"hvXamlCS TestApp"</span>;</pre>
<pre class="alt"><span class="lnum"> 7: </span>    myApp.DebugMode = <span class="kwrd">true</span>;</pre>
<pre><span class="lnum"> 8: </span>}</pre>
</div>
<p>&nbsp;</p>
<p><span style="font-size: small;">What remains to be illustrated is how the ResultItems collection is filled with individual Result objects.&nbsp; Lines #14 and #15 from the TestGetThing method demonstrate this step.&nbsp;&nbsp; The call to ScrollToBottom at line #17 is not strictly needed, it simply auto-scrolls the ListView so that the last ResultItems entry is visible.&nbsp;&nbsp; </span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>async <span class="kwrd">private</span> <span class="kwrd">void</span> TestGetThing()</pre>
<pre><span class="lnum"> 2: </span>{</pre>
<pre class="alt"><span class="lnum"> 3: </span>    <span class="rem">// Get a simple Weight measurement</span></pre>
<pre><span class="lnum"> 4: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 5: </span>    ItemQuery query = HealthVault.ItemTypes.Weight.QueryFor();</pre>
<pre><span class="lnum"> 6: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 7: </span>    var record = myApp.UserInfo.AuthorizedRecords[0];</pre>
<pre><span class="lnum"> 8: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 9: </span>    ItemDataTypedList result = await record.GetAsync(query);</pre>
<pre><span class="lnum"> 10: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 11: </span>    <span class="kwrd">foreach</span> (var item <span class="kwrd">in</span> result)</pre>
<pre><span class="lnum"> 12: </span>    {</pre>
<pre class="alt"><span class="lnum"> 13: </span>        Debug.WriteLine(item.Serialize());</pre>
<pre><span class="lnum"> 14: </span>        <span class="kwrd">this</span>.resultItem = <span class="kwrd">new</span> ResultItem(item.Serialize());   <span class="rem">// Update our collection</span></pre>
<pre class="alt"><span class="lnum"> 15: </span>        <span class="kwrd">this</span>.ResultItems.Add(<span class="kwrd">this</span>.resultItem); </pre>
<pre><span class="lnum"> 16: </span>    }</pre>
<pre class="alt"><span class="lnum"> 17: </span>    ScrollToBottom();</pre>
<pre><span class="lnum"> 18: </span>}</pre>
</div>
<p><span style="font-size: small;">The subsequent rendering of information is accomplished entirely via the automated DataContext binding of XAML and the Windows Runtime.&nbsp;&nbsp; Note that we&rsquo;re only putting new information into the display and not setting any class member data in our code-behind classes so there&rsquo;s no need for two-way data-exchange.</span></p>
<p>&nbsp;</p>
<h3>Getting Things from HealthVault</h3>
<p><span style="font-size: small;">A basic &ldquo;Get Things&rdquo; example function was presented immediately above.&nbsp;&nbsp; The &ldquo;TestGetThing&rdquo; method is invoked when an application user presses the <strong>GetThing</strong> button.&nbsp; Note that this test function uses the <em>HealthVault.ItemTypes.Weight.QueryFor(&hellip;)</em> library function to obtain a list of Weight measurements from the currently selected HealthVault user record.</span></p>
<p><span style="font-size: small;">The Weight class, like other data-type classes within the HealthVault.ItemTypes namespace, implements an QueryFor method derived from the HealthVault.Types.ItemQuery base class.&nbsp;&nbsp; A simple and thankfully shallow class hierarchy exists in which individual HealthVault data-types, such as Weight, are defined.&nbsp;&nbsp; You may easily extend this pattern to define your own data-types.&nbsp;&nbsp; A key benefit of doing so enables participation not only in the QueryFor construct but also in IItemDataType derived serialization capability as illustrated in line #14 above.</span></p>
<p><span style="font-size: small;">Continuing with a more sophisticated query, the following source illustrates the use of an ItemFilter to specify a request for multiple ItemTypes (e.g. Weight, Condition, Medication) created after a specific date, and ordered by an effective date (lines #11 thru #19).&nbsp;&nbsp; As indicated, the asynchronous request operation may be invoked with either a GetAsync(query) or a GetAllItemsAsync(query) library method call.&nbsp;&nbsp; The later option returns when all pending HealthVault transactions occur.</span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>async <span class="kwrd">private</span> <span class="kwrd">void</span> TestQuery()</pre>
<pre><span class="lnum"> 2: </span>{</pre>
<pre class="alt"><span class="lnum"> 3: </span>    <span class="rem">// The following code queries for a maximum of 10 Weight, Condition, </span></pre>
<pre><span class="lnum"> 4: </span>    <span class="rem">// and Medication items that were created after November 1st 2010 </span></pre>
<pre class="alt"><span class="lnum"> 5: </span>    <span class="rem">// and returns the results ordered by the effective date of each item </span></pre>
<pre><span class="lnum"> 6: </span>    <span class="rem">// (HealthVault&rsquo;s default sort order). </span></pre>
<pre class="alt"><span class="lnum"> 7: </span>&nbsp;</pre>
<pre><span class="lnum"> 8: </span>    ItemQuery query = <span class="kwrd">new</span> HealthVault.Types.ItemQuery();</pre>
<pre class="alt"><span class="lnum"> 9: </span>    query.Name = <span class="str">"GetThingsWithFilter"</span>;  </pre>
<pre><span class="lnum"> 10: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 11: </span>    ItemFilter filter = <span class="kwrd">new</span> HealthVault.Types.ItemFilter();</pre>
<pre><span class="lnum"> 12: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 13: </span>    filter.TypeIDs.Add(HealthVault.ItemTypes.Weight.TypeID); </pre>
<pre><span class="lnum"> 14: </span>    filter.TypeIDs.Add(HealthVault.ItemTypes.Condition.TypeID);</pre>
<pre class="alt"><span class="lnum"> 15: </span>    filter.TypeIDs.Add(HealthVault.ItemTypes.Medication.TypeID);</pre>
<pre><span class="lnum"> 16: </span>    filter.CreatedDateMin = <span class="kwrd">new</span> HealthVault.Types.DateTime(<span class="str">"11/1/2010"</span>);</pre>
<pre class="alt"><span class="lnum"> 17: </span>&nbsp;</pre>
<pre><span class="lnum"> 18: </span>    query.Filters.Add(filter);</pre>
<pre class="alt"><span class="lnum"> 19: </span>    query.MaxResults = <span class="kwrd">new</span> HealthVault.Types.NonNegativeInt(10);</pre>
<pre><span class="lnum"> 20: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 21: </span>    var record = myApp.UserInfo.AuthorizedRecords[0];</pre>
<pre><span class="lnum"> 22: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 23: </span>    <span class="rem">// GetAsync is one approach...</span></pre>
<pre><span class="lnum"> 24: </span>    <span class="rem">//</span></pre>
<pre class="alt"><span class="lnum"> 25: </span>    <span class="rem">// ItemDataTypedList result = await record.GetAsync(query); </span></pre>
<pre><span class="lnum"> 26: </span>    <span class="rem">// foreach (var item in result)</span></pre>
<pre class="alt"><span class="lnum"> 27: </span>    <span class="rem">// {</span></pre>
<pre><span class="lnum"> 28: </span>    <span class="rem">// Debug.WriteLine(item.Serialize());</span></pre>
<pre class="alt"><span class="lnum"> 29: </span>    <span class="rem">// }</span></pre>
<pre><span class="lnum"> 30: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 31: </span>    <span class="rem">// GetAllItemsAsync returns only when all recordItems AND </span></pre>
<pre><span class="lnum"> 32: </span>    <span class="rem">// pending items have been retrieved from HealthVault</span></pre>
<pre class="alt"><span class="lnum"> 33: </span>    var result2 = await record.GetAllItemsAsync(query);   </pre>
<pre><span class="lnum"> 34: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 35: </span>    <span class="kwrd">foreach</span> (RecordItem item <span class="kwrd">in</span> result2)</pre>
<pre><span class="lnum"> 36: </span>    {</pre>
<pre class="alt"><span class="lnum"> 37: </span>        Debug.WriteLine(item.Serialize());</pre>
<pre><span class="lnum"> 38: </span>        <span class="kwrd">this</span>.resultItem = <span class="kwrd">new</span> ResultItem(item.Serialize());   </pre>
<pre class="alt"><span class="lnum"> 39: </span>        <span class="kwrd">this</span>.ResultItems.Add(<span class="kwrd">this</span>.resultItem);</pre>
<pre><span class="lnum"> 40: </span>    }</pre>
<pre class="alt"><span class="lnum"> 41: </span>    ScrollToBottom();</pre>
<pre><span class="lnum"> 42: </span>}</pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Putting Things into HealthVault</h3>
<p><span style="font-size: small;">Adding information to a HealthVault user record is also very intuitive as illustrated in the following code-snippet.&nbsp; Simply utilize the HealthVault.ItemTypes class library to set your chosen data-type properties.&nbsp;&nbsp; Then, invoke the PutAsync API on the selected HealthVault Record.</span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>async <span class="kwrd">private</span> <span class="kwrd">void</span> TestPutThing()</pre>
<pre><span class="lnum"> 2: </span>{</pre>
<pre class="alt"><span class="lnum"> 3: </span>    <span class="rem">// Store a Blood Pressure item in a HealthVault record. </span></pre>
<pre><span class="lnum"> 4: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 5: </span>    HealthVault.ItemTypes.BloodPressure bp = <span class="kwrd">new</span> HealthVault.ItemTypes.BloodPressure();</pre>
<pre><span class="lnum"> 6: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 7: </span>    bp.When = HealthVault.Types.StructuredDateTime.Now();</pre>
<pre><span class="lnum"> 8: </span>    bp.SystolicValue = 120;</pre>
<pre class="alt"><span class="lnum"> 9: </span>    bp.DiastolicValue = 80;</pre>
<pre><span class="lnum"> 10: </span>    bp.PulseValue = 58;</pre>
<pre class="alt"><span class="lnum"> 11: </span>    bp.IrregularHeartbeat = <span class="kwrd">new</span> HealthVault.Types.BooleanValue(<span class="kwrd">false</span>);</pre>
<pre><span class="lnum"> 12: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 13: </span>    var record = myApp.UserInfo.AuthorizedRecords[0];</pre>
<pre><span class="lnum"> 14: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 15: </span>    await record.PutAsync(bp);</pre>
<pre><span class="lnum"> 16: </span>}  </pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Account and Connection Management</h3>
<p><span style="font-size: small;">The following set of methods correspond to the <strong>Connect</strong>, <strong>RevokeConnections</strong>, <strong>ReConnect</strong>, and <strong>AuthorizeOthers</strong> buttons available via the application UI.&nbsp;&nbsp; The use of these should be self-explanatory.&nbsp; The primary objective is to add flexibility to your Windows Store application for the management of HealthVault account connectivity.</span></p>
<p>&nbsp;</p>
<div class="csharpcode">
<pre class="alt"><span class="lnum"> 1: </span>async <span class="kwrd">private</span> <span class="kwrd">void</span> ConnectWithHealthVault()</pre>
<pre><span class="lnum"> 2: </span>{</pre>
<pre class="alt"><span class="lnum"> 3: </span>    await myApp.StartAsync();   <span class="rem">// Redirect to HealthVault for account access authorization.</span></pre>
<pre><span class="lnum"> 4: </span>}</pre>
<pre class="alt"><span class="lnum"> 5: </span>&nbsp;</pre>
<pre><span class="lnum"> 6: </span>async <span class="kwrd">private</span> <span class="kwrd">void</span> ReconnectWithHealthVault()</pre>
<pre class="alt"><span class="lnum"> 7: </span>{</pre>
<pre><span class="lnum"> 8: </span>    await myApp.ResetAsync();</pre>
<pre class="alt"><span class="lnum"> 9: </span>    ConnectWithHealthVault();</pre>
<pre><span class="lnum"> 10: </span>}</pre>
<pre class="alt"><span class="lnum"> 11: </span>&nbsp;</pre>
<pre><span class="lnum"> 12: </span>async <span class="kwrd">private</span> <span class="kwrd">void</span> RevokeConnectionsWithHealthVault()</pre>
<pre class="alt"><span class="lnum"> 13: </span>{</pre>
<pre><span class="lnum"> 14: </span>    <span class="kwrd">foreach</span> (var record <span class="kwrd">in</span> myApp.UserInfo.AuthorizedRecords)</pre>
<pre class="alt"><span class="lnum"> 15: </span>    {</pre>
<pre><span class="lnum"> 16: </span>        await record.RemoveApplicationRecordAuthorizationAsync();</pre>
<pre class="alt"><span class="lnum"> 17: </span>    }</pre>
<pre><span class="lnum"> 18: </span>}</pre>
<pre class="alt"><span class="lnum"> 19: </span>&nbsp;</pre>
<pre><span class="lnum"> 20: </span>async <span class="kwrd">private</span> <span class="kwrd">void</span> AuthorizeAdditionalRecords()</pre>
<pre class="alt"><span class="lnum"> 21: </span>{</pre>
<pre><span class="lnum"> 22: </span>    await myApp.AuthorizeAdditionalRecordsAsync();</pre>
<pre class="alt"><span class="lnum"> 23: </span>}</pre>
<pre><span class="lnum"> 24: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 25: </span>async <span class="kwrd">private</span> Task&lt;<span class="kwrd">bool</span>&gt; IsAuthorizedOnServer()</pre>
<pre><span class="lnum"> 26: </span>{</pre>
<pre class="alt"><span class="lnum"> 27: </span>     <span class="kwrd">return</span> await Task.Run(() =&gt; IsAuthorizedOnServerImpl());</pre>
<pre><span class="lnum"> 28: </span>}</pre>
<pre class="alt"><span class="lnum"> 29: </span>&nbsp;</pre>
<pre><span class="lnum"> 30: </span><span class="kwrd">private</span> <span class="kwrd">bool</span> IsAuthorizedOnServerImpl()</pre>
<pre class="alt"><span class="lnum"> 31: </span>{</pre>
<pre><span class="lnum"> 32: </span>    IAsyncOperation&lt;<span class="kwrd">bool</span>&gt; b = myApp.IsAuthorizedOnServerAsync();</pre>
<pre class="alt"><span class="lnum"> 33: </span>    <span class="kwrd">return</span> b.GetResults();</pre>
<pre><span class="lnum"> 34: </span>}</pre>
<pre class="alt"><span class="lnum"> 35: </span>&nbsp;</pre>
<pre><span class="lnum"> 36: </span><span class="kwrd">private</span> Record GetCurrentRecord()</pre>
<pre class="alt"><span class="lnum"> 37: </span>{</pre>
<pre><span class="lnum"> 38: </span>    <span class="kwrd">return</span> (myApp.UserInfo.AuthorizedRecords[0] <span class="kwrd">as</span> HealthVault.Foundation.Types.Record);</pre>
<pre class="alt"><span class="lnum"> 39: </span>}</pre>
<pre><span class="lnum"> 40: </span>&nbsp;</pre>
<pre class="alt"><span class="lnum"> 41: </span>LocalRecordStore GetCurrentRecordStore()</pre>
<pre><span class="lnum"> 42: </span>{</pre>
<pre class="alt"><span class="lnum"> 43: </span>    <span class="kwrd">return</span> myApp.LocalVault.RecordStores.GetStoreForRecord(GetCurrentRecord() <span class="kwrd">as</span> HealthVault.Foundation.IRecord);</pre>
<pre><span class="lnum"> 44: </span>}</pre>
</div>
<p>&nbsp;</p>
<p>&nbsp;</p>
<h3>Summary</h3>
<p><span style="font-size: small;">The </span><a href="http://blogs.msdn.com/b/healthvault/archive/2012/10/10/now-available-healthvault-library-for-windows-8.aspx" target="_blank"><span style="font-size: small;">HealthVault Library for Windows 8</span></a><span style="font-size: small;"> is a great new way to build Windows Runtime healthcare applications and take advantage of Windows Store marketing and distribution benefits.&nbsp;&nbsp; The library leverages the Software on Device Authentication (SODA) model for HealthVault connectivity.&nbsp;&nbsp; We&rsquo;ve provided &ldquo;getting-started&rdquo; samples using both WinJS and XAML/C#.&nbsp;&nbsp; The library includes source files that are both instructive and extensible.&nbsp; Enjoy!</span></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><span style="font-size: small;">&nbsp;</span></p>]]></content:encoded>
    </item>
    <item>
      <title>HealthVault Connectivity Models and Solutions Architectures</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/healthvault-connectivity-models-and-solutions-architectures</link>
      <pubDate>Sat, 18 May 2013 20:32:32 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2013/05/18/healthvault-connectivity-models-and-solutions-architectures/</guid>
      <description><![CDATA[Over the past few weeks, we’ve participated in healthcare solution development events at the...]]></description>
      <content:encoded><![CDATA[<p>Over the past few weeks, we’ve participated in healthcare solution development events at the <a href="http://cajuncodefest.org/" target="_blank">University of Louisiana</a> and in <a href="http://www.health2con.com/events/conferences/health-refactored/" target="_blank">Silicon Valley</a>.&#160; These events were designed to spark healthcare informatics innovation using team-competition and incentives, including cash prizes.&#160;&#160; We enjoyed many aspects of these events (<a href="http://books.google.com/books/about/Hacking_Healthcare.html?id=mi-JGVS3DNgC" target="_blank">Fred Trotter’s</a> soap-box session stands-out) and consider it a privilege to have met so many dedicated and wonderful people.&#160;&#160; As I observed event participants discussing and prototyping their solutions, a key takeaway for me was a perception of confusion about just how to get-started developing for HealthVault.&#160;&#160; In certain respects, the HealthVault platform is a simple XML over HTTP web-service.&#160;&#160; But, there is much more to it than that, and; in practice, perhaps few would choose to use the service without an encapsulating client-side SDK anyway.&#160;&#160; Much of our developer documentation necessarily details the platform’s foundational <a href="http://developer.healthvault.com/pages/sdk/docs/index.html" target="_blank">XML over HTTP implementation</a> with perhaps inadequate coverage of corresponding feature-areas as abstracted by our SDK classes and constructs.&#160;&#160; Navigating our platform features from a “getting-started” perspective, and especially during a 48 hour competition, can be challenging.&#160;&#160; Herein, we hope to clarify a few key solution design-options that map onto platform functionality and identify corresponding “getting-started” decisions.</p>  <h4>&#160;</h4>  <h4>HealthVault + Your Client Applications </h4>  <p>The following image illustrates that HealthVault Platform Services are exposed via a number of feature-areas.&#160;&#160; Some of these features are unique for a web-service in that they encapsulate workflow involving interaction with real people.&#160; If our web-service involved only content browsing, selection, and consumption, then it would be much more recognizable relative to common web-service abstractions.&#160;&#160; Consequently, a first-step conceptually is recognition that you may be dealing with uncommon terminology and unfamiliar extensibility models.&#160;&#160; Let’s explore this illustration further.</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/3124.HVClientApps_67953C8C.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/3124.HVClientApps_5F00_67953C8C.png"><img title="HV ClientApps" style="display: inline;" border="0" alt="HV ClientApps" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7840.HVClientApps_thumb_6D03AD30.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7840.HVClientApps_5F00_thumb_5F00_6D03AD30.png" width="813" height="459" /></a> </p>  <p>&#160;</p>  <h5>Choose Your Data-Types</h5>  <p>Refer to the lighter-blue graphic in the middle of the illustration directly above.&#160;&#160; Though not comprehensive, this feature-list is key to understanding solution integration options.&#160;&#160; For example, it’s readily apparent that the platform exposes a data-access API and that most operations utilize a PersonID and a RecordID parameter to uniquely target a HealthVault record.&#160; Also, note the top-most green text-block to the right under the heading “Your Client App(s)”.&#160;&#160; As a solution designer, a first decision is simply to identify what operations (e.g. create, read, update, delete) are required upon which data-types hosted within a HealthVault record.&#160; Do you need to know what data-types are available?&#160;&#160; Browse over to <a href="http://developer.healthvault.com/" target="_blank">developer.healthvault.com</a>.&#160;&#160; Notice the link therein to the <a href="http://developer.healthvault.com/pages/types/types.aspx" target="_blank">Health Types Schema Browser</a>.&#160;&#160; </p>  <p>Special considerations for data-types:</p>  <ul>   <li>If you are using <a href="http://msdn.microsoft.com/en-us/healthvault/jj126730" target="_blank">one of our SDK’s</a> to build your solution, then you can use predefined library classes encapsulating our data-types.&#160;&#160; With the .NET SDK, data-type classes are referenced from the <em>Microsoft.Health.ItemTypes.dll</em> assembly file.&#160;&#160; Using these classes trivializes creating data-type object instances, object serialization, and transferring data to/from HealthVault.&#160; Our new Win8 library includes a modernization of these class abstraction specify useful within the Windows Runtime execution environment.</li>    <li>If you are not able to use an SDK within your solution, then you’ll need to deal with data-types formatted as XML or JSON.&#160;&#160; This is often the case if your solution runs in an execution sand-box such as Silver Light, as client-side script running within a browser, or on an embedded device.&#160;&#160; You may need to “roll-your-own” data-handling classes, copy them from SDK source files, or perhaps auto-generate classes from schema using a tool like <a href="http://msdn.microsoft.com/en-us/library/x6c1kb0s(v=VS.71).aspx" target="_blank">XSD.exe</a>.&#160;&#160; The amount of development involved depends upon the number and complexity of data-types you’ll be using. </li>    <li>Each HealthVault integrated application is custom-configured to access specific data-types.&#160; You utilize the <a href="https://config.healthvault-ppe.com/default.aspx" target="_blank">HealthVault Application Configuration Center</a> to define data-access rules for your application along with corresponding specified data-types.&#160;&#160; HealthVault uses this configuration information to limit your application to as-specified and user-authorized fields within HealthVault records.</li>    <li>Spend some time thinking thru data-centric scenarios.&#160;&#160; For example, typical clinical-trial scenarios require that data-measurements can’t be changed.&#160; In that case, use the HealthVault “immutable” data-type attribute.&#160;&#160; </li>    <li>Consider using the Care Plan data-type or the Continuity of Care document type if your solution will be providing summary information to patients and especially if that information is important for sharing with other providers.</li>    <li>Will you be rendering the data to a UI, perhaps a browser?&#160;&#160; Consider utilizing the transforms provided with HealthVault platform services to ease your development burden.</li> </ul>  <h5>Choose Your Connectivity Model</h5>  <p>HealthVault exposes a rich set of client application connectivity options.&#160;&#160; Why do we need many options?&#160;&#160; Recall that your application will be participating in one or more workflow activities involving real people who may or may not be using your application interactively when HealthVault platform interaction occurs.&#160;&#160; This is an important design-to point best described by scenario example.&#160; Note that many HealthVault solutions utilize more than one connectivity model depending upon aspects of the overall solution architecture.&#160;&#160; Again, developers utilize the <a href="https://config.healthvault-ppe.com/default.aspx" target="_blank">HealthVault Application Configuration Center</a> to define their application connectivity requirements that correspond directly to <a href="http://msdn.microsoft.com/en-us/library/jj863170.aspx" target="_blank">connectivity model decisions</a>.</p>  <p>The <strong>Software on Device Authentication (SODA)</strong> connectivity model applies when you are writing an application that will most likely run with user-interactivity on a personal computer.&#160;&#160; A SODA application typically accesses only a single HealthVault record at once.&#160;&#160; This connectivity model was conceived in order to simplify management of secure access to the HealthVault platform from widely distributed client-application installations.&#160;&#160; Platform interactivity occurs securely within a shared-key encrypted session.&#160;&#160; This avoids the complexity of managing a Public Key Infrastructure as certificate exchanges are not required.&#160;&#160; Of course, the various HealthVault SDK’s encapsulate the SODA model functionality and most client applications thus inherently benefit without further development beyond invoking the connection methods.</p>  <p><strong>Online</strong> connectivity applies to web-page applications (e.g. Patient Portals) wherein HealthVault data-access occurs within a user-interactive browser session.&#160;&#160; Typically, user authentication initiates secure site access along with corresponding HealthVault application access.&#160;&#160; As most Online applications are deployed within data-centers, certificate based security is much more viable.&#160;&#160; Hence, Online applications are configured to use a private-key certificate in which the corresponding public-key has been previously shared with the HealthVault platform using the HealthVault Application Configuration Center.&#160; When using the HealthVault SDK, developers may derive their web-pages from HealthVault base classes that encapsulate Online application functionality.</p>  <p><strong>Offline</strong> connectivity is appropriate when your solution requires access to HealthVault records anytime and without user interactivity.&#160;&#160; A one-time Patient Connect workflow process (described further below) is required of Offline applications.&#160;&#160; Thereafter, your Offline application may simply invoke record access as needed.&#160;&#160; This access occurs indefinitely or until the access authorization is explicitly removed; either by the account owner or by the Offline application itself.&#160; Offline application authentication is also certificate based with corresponding Offline data-access rules defined using the HealthVault Application Configuration Center.&#160; When using the HealthVault SDK, developers may leverage the <em>OfflineWebApplicationConnection</em> class to initiate an Offline connection.</p>  <p><strong>Direct</strong> connectivity refers to a <a href="http://blogs.msdn.com/b/familyhealthguy/archive/2011/02/12/start-sharing-information-with-patients-today.aspx" target="_blank">secure messaging</a> (i.e. secure email) HealthVault platform facility.&#160; The <a href="http://directproject.org" target="_blank">Direct Project</a> served as the genesis of loosely-connected <a href="http://blue-button.github.io/docs/" target="_blank">consortium</a> providing secure data-transfer for healthcare providers and their patients.&#160;&#160; Each HealthVault consumer receives a free secure email inbox (e.g. <em>myname@direct.healthvault.com</em>).&#160;&#160; Solution providers may simply integrate with a secure email server gateway in order to exchange information with HealthVault account owners.&#160;&#160; What if you don’t know whether or not a patient has a HealthVault account?&#160;&#160; No worries, just send your message to a special HealthVault Direct address (i.e. newuser@direct.healthvault.com) and specify the patients insecure email address in the subject line (e.g. myname@outlook.com) and HealthVault will enable that patient to both create an account and receive your message.&#160;&#160; You may also attach standard healthcare documents (e.g. Continuity of Care Documents) and HealthVault will import the information into the appropriate Health Information fields of the patient’s HealthVault record.</p>  <p>Special considerations for connectivity models include:</p>  <ul>   <li>If you anticipate both a web-portal usage scenario as well as a back-end clinical system usage scenario, then you’ll need a combination of both Online and Offline connectivity.&#160;&#160; </li>    <li>It’s possible to have aspects of all connectivity models within a sophisticated distributed solution scenario.&#160;&#160; You may consider utilizing a Master-Child ID HealthVault Application configuration in that case.&#160;&#160; Otherwise, you’ll either have a single Application ID with multiple access-rule definitions or a number of Application ID’s with individual access-rule definitions.</li>    <li>Direct connectivity requires nothing more than an exchange of Trust between your organization and HealthVault operations.&#160;&#160; You may wish to join the <a href="http://blue-button.github.io/docs/" target="_blank">Automated Blue Button Initiative</a> and participate in Trust Bundles wherein multiple business entities exchange Trust collaboratively as groups.</li>    <li>Direct connectivity is a great way to accomplish <a href="http://www.advisory.com/Consulting/Meaningful-Use-Navigator" target="_blank">Meaningful Use</a> certification criteria.&#160;&#160; Leverage HealthVault to achieve patient View, Download, and Transmit (VDT) objectives and subsequently request a report of completed VDT activities.</li> </ul>  <p>&#160;</p>  <h5>Choose Your HealthVault Features</h5>  <p>It’s somewhat easy to confuse connectivity models with other platform features because there are close relationships between them.&#160;&#160; As mentioned, an Offline application will typically utilize a workflow named Patient Connect to gain authorized access to a HealthVault record.&#160;&#160; Hence, it’s common to refer to Offline connectivity and Patient Connect synonymously.&#160;&#160; However, it’s preferable to separate these as Patient Connect is more a type of workflow than a connectivity model.&#160;&#160; We won’t explore many HealthVault platform features in this section, but rather discuss a few that become important for HealthVault solution designers.</p>  <p>A <strong>Patient Connect</strong> workflow is typically used within a solution that requires access to HealthVault records without a user-interactive session.&#160;&#160; Patient Connect is often combined with <strong>Offline</strong> connectivity (discussed above).&#160;&#160; The classic use-case is one of new patient registration.&#160; In a clinical setting, you want to both establish a patient record within your back-end clinical systems as well as establish access to the new patient’s HealthVault record.&#160; Your application initiates Patient Connect by sending a request to HealthVault including a local patient ID and a secret question/answer known by the patient.&#160; HealthVault responds with an access token along with a welcome URL.&#160;&#160; You provide this information to your new patient (e.g. either via email or via a kiosk).&#160;&#160; When the patient browses to the URL, HealthVault validates the access token and guides the patient through account access/creation and authorization of your Offline application.&#160;&#160; Once this workflow is completed, your application may query HealthVault for a list of authorized accounts and associate those with entries within your patient database.&#160;&#160; You subsequently interact with HealthVault programmatically using the patient HealthVault PersonID and RecordID.</p>  <p><strong>DOPU</strong>, meaning Drop-Off and Pick-Up, is a workflow in which your application sends information to HealthVault but with no direct HealthVault record access.&#160;&#160; Like Patient Connect, you initiate DOPU by sending a request to HealthVault including attached healthcare information.&#160; You also provide your email address, the patient’s email address, text representing an email to the patient, and a secret question/answer know by the patient.&#160;&#160; HealthVault stores this information, returns a package ID, and subsequently sends your email message to the specified recipient.&#160;&#160;&#160; The patient will receive instructions via email for on how to retrieve the information securely.&#160;&#160; Any attached information recognized as HealthVault data-types are optionally imported into the recipient's HealthVault record.&#160;&#160; This feature enables a very loosely-coupled patient-provider information exchange.</p>  <p>I’ll mention support for <strong>Devices</strong> as a platform feature as well.&#160;&#160; Many healthcare devices are listed within the <a href="https://account.healthvault.com/us/en-US/Directory?target=Devices&amp;SearchType=ViewAll" target="_blank">HealthVault Device Directory</a>.&#160;&#160; Some of these devices are very capable providing directly integrated HealthVault connectivity via Wi-Fi or mobile networks.&#160;&#160; Others leverage companion personal computer applications, importing data via USB for example.&#160; Alternatively, devices vendors may leverage the <a href="https://www.healthvault.com/us/en/connection-center" target="_blank">HealthVault Connection Center</a> application and USB connectivity to transfer data to HealthVault records.&#160; Interestingly, the HealthVault Connection Center application also provides image file uploading functionality (e.g. DICOM images).</p>  <p><strong>Direct</strong> Messaging is also a workflow-oriented platform feature (in addition to a connectivity model).&#160; What could be more intuitive than sending an email with attachments from your clinical solution?&#160;&#160; Currently, HealthVault users will need to enable the integrated <a href="https://apps.healthvault.com/MessageCenter/about.aspx" target="_blank">HealthVault Message Center</a> in order to utilize their inbox and subsequently transmit information to providers.&#160;&#160; </p>  <p>Special considerations for HealthVault features include:</p>  <ul>   <li>Your solution’s patient and patient-record interactions will determine your choice of platform feature-area integration.&#160;&#160; Consider the workflows involved and design accordingly.</li>    <li>Perhaps you want to utilize more than one workflow feature area from within the same solution.&#160;&#160; Consider implementing a central service from which multiple subsystems may share a common HealthVault connection.</li>    <li>A usage scenario options matrix is published <a href="http://msdn.microsoft.com/en-us/library/jj863170.aspx" target="_blank">here</a>.</li> </ul>  <p>&#160;</p>  <h5>Choose Your Solution Platform</h5>  <p>We probably already have an SDK or <a href="http://www.codeplex.com/site/search?query=HealthVault&amp;ac=3" target="_blank">code-library</a> for your target solution platform.&#160;&#160; Again, an SDK is not strictly required for HealthVault solution integration.&#160;&#160; But, if you use one, you won’t have to write a lot of protocol handling, security constructs, and data-type parsing and serialization code.&#160;&#160;&#160; Our SDK list is <a href="http://msdn.microsoft.com/en-us/healthvault/default" target="_blank">here</a> along with a number of corresponding samples.&#160;&#160; </p>  <p>Special considerations for solution platforms include:</p>  <ul>   <li>Market reach.&#160;&#160; Are you developing for mobile?&#160; You will likely need to consider designing for code-portability which may drive your solution design to a web-service model with as much “common-code” on the client device as is possible.&#160;&#160; </li>    <li>Enterprise or Consumer?&#160; Consumer applications typically correspond in a one-to-one manner.&#160;&#160; That is, one application user to one HealthVault record.&#160;&#160; Enterprise applications, however, may exhibit a many-user to many-record usage model.&#160;&#160; This becomes very important as you imagine who your target users may be.&#160;&#160; A physician or nurse using a tablet device may wish to scroll a list of patient records, select one or more, and exchange information with the selected person or group.&#160;&#160; Hence, SODA connectivity running on a tablet platform may be appropriate for Consumer while the Enterprise scenario requires more design decisions and corresponding system integration considerations.</li>    <li>An interesting new platform option is the Windows Runtime introduced with Windows 8.&#160;&#160; Windows Runtime applications are distributed via the Windows Store (an Enterprise-scoped distribution option exists as well).&#160; A first-party <a href="http://apps.microsoft.com/windows/en-US/app/healthvault/728f1c88-7e2f-4b40-95c1-74fc09983689" target="_blank">HealthVault Windows Store application</a> is available to consumers for free.&#160; In fact, you may leverage the <a href="http://blogs.msdn.com/b/healthvault/archive/2012/10/10/now-available-healthvault-library-for-windows-8.aspx" target="_blank">same code library</a> as our Windows Store app to build your Windows Store application.</li> </ul>  <p>&#160;</p>  <h4>&#160;</h4>  <h4>HealthVault + Your Web Service + Your Client Apps</h4>  <p>You may require a solution architecture in which multiple client applications utilize the same HealthVault subscription.&#160;&#160; The following image illustrates this model.&#160; This design would be ideal for an enterprise clinical system servicing multiple departments with a variety of client-app types.&#160; Let’s walk-thru the illustration in more detail.</p>  <p>&#160;</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7652.HVWebServiceClientApps_25AE573E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7652.HVWebServiceClientApps_5F00_25AE573E.png"><img title="HV WebService ClientApps" style="display: inline;" border="0" alt="HV WebService ClientApps" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6607.HVWebServiceClientApps_thumb_5A4EB379.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6607.HVWebServiceClientApps_5F00_thumb_5F00_5A4EB379.png" width="818" height="465" /></a> </p>  <p>&#160;</p>  <p>In the middle of the image is a “cloud provider” hosted “HealthVault Proxy Service”.&#160;&#160; This service encapsulates all connectivity with the HealthVault Platform and is configured as an <strong>Offline</strong> application from a HealthVault perspective.&#160; It serves primarily as a stateless router of HealthVault access requests from any number of Mobile, Enterprise, or Device applications (illustrated on the lower-right of the image).&#160;&#160; Ideally, this Proxy Service would accomplish several functional requirements for the client-app community including:</p>  <ul>   <li>Serve as a HealthVault interface for an Enterprise domain enabling both a departmental system deployment model as well as an Enterprise tablet device deployment model.</li>    <li>Centralize a write-once, deploy-once, HealthVault connectivity and feature integration solution.&#160;&#160; The proxy service is the only subsystem component with the need to understand HealthVault connectivity and HealthVault feature API’s.&#160;&#160; All client-app types need only understand how to integrate with the proxy-service itself (more on this momentarily).</li>    <li>Expose a subset of HealthVault features including Data-Access, Patient Connect, DOPU, and as a Direct Gateway.&#160;&#160; The SODA connectivity model wouldn’t make sense within the proxy-service as it is intended instead as a direct-to-HealthVault connectivity model.&#160; The Online connectivity model might be combined with the Proxy Service if an interactive Patient-Portal experience is required.&#160;&#160; In that case, the proxy service would effectively host both a web-app as well as a web-service with corresponding Online and Offline configuration rules.</li>    <li>HealthVault currently doesn’t expose services directly as REST, SOAP, or OData.&#160;&#160; Hence, the proxy-service provides an opportunity to implement these standards on behalf of HealthVault.&#160;&#160; Thereby, increasing the richness of client usage scenarios.</li>    <li>HealthVault is a very XML friendly platform.&#160;&#160; A proxy service may provide a translation function wherein XML content is transformed to whatever client data-model desired; JSON, for example.</li>    <li>Serve as a central-point for organizational analytics, profiling, or security management.</li> </ul>  <p>In fact, this is the solution architecture that our <a href="http://blogs.msdn.com/b/familyhealthguy/archive/2012/12/10/dynamics-crm-healthvault-holy-crap-it-s-population-management.aspx" target="_blank">Dynamics CRM</a> partner’s are utilizing to implement <a href="http://blogs.msdn.com/b/healthvault/archive/2013/03/29/healthvault-at-convergence.aspx" target="_blank">Population Care Management</a> solutions.&#160;&#160; The use of a proxy service is actually necessitated by the Dynamics CRM solution <a href="http://msdn.microsoft.com/en-us/library/gg334357.aspx" target="_blank">extensibility</a> sand-box.&#160;&#160; The HealthVault SDK assemblies are restricted from use in the solution sand-box for a number of reasons including the use of system cryptographic methods.&#160;&#160; However, code running within the sand-box is completely capable of call-outs to web-services.&#160; It’s important to note that the proxy service need not be hosted in the cloud at all.&#160;&#160; In fact, it could reside on the same server or within the same domain data-center as the Enterprise client systems.</p>  <p>As you may have guessed, this article is a segway to subsequent articles focused on exactly how to implement a HealthVault “bridge” solution architecture.&#160;&#160; A number of motivations culminate in this exercise.&#160;&#160; One is that modern application design is largely focused on cloud-services composition instead of on isolated application design.&#160; Imagine a clinical office utilizing Office365, Dynamics Online, Windows Azure, Lync or Skype, and HealthVault as platform technologies for their healthcare informatics needs.&#160;&#160; With a bit of customization, these subscription-based services would fulfill a significant amount of business process technology requirements.&#160;&#160; </p>]]></content:encoded>
    </item>
    <item>
      <title>Resources for HealthVault Application Developers</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/resources-for-healthvault-application-developers</link>
      <pubDate>Wed, 20 Feb 2013 18:01:31 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2013/02/20/resources-for-healthvault-application-developers/</guid>
      <description><![CDATA[I’ve recently joined the Microsoft HealthVault team in a Solutions Architect role with...]]></description>
      <content:encoded><![CDATA[<p><font size="2"></font></p>  <table cellspacing="0" cellpadding="2" width="605" border="0"><tbody>     <tr>       <td valign="top" width="384"><font size="2">I’ve recently joined the Microsoft HealthVault team in a Solutions Architect role with a focus on assisting our partners and customers as they build great HealthVault integrated solutions.&#160;&#160; <br />&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; <br />I’ve always enjoyed this type of role and look forward to the learning experiences that HealthVault will bring into my life.&#160;&#160; One of the first such experiences is collaboration with the “<a href="http://hackinghealth.ca/" target="_blank">Hacking Health</a>” initiative underway now in Canada.&#160;&#160; The <a href="http://www.cajuncodefest.org/" target="_blank">Cajun Code-Fest</a> is a similar event happening in the USA.&#160; </font></td>        <td valign="top" width="219"><a href="http://blogs.msdn.com/philpenn" target="_blank"><img title="Phil4" style="margin: 0px; border: 0px currentcolor; display: inline; background-image: none;" border="0" alt="Phil4" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8535.Phil4_654C2A15.jpg" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8535.Phil4_5F00_654C2A15.jpg" width="208" height="157" /></a></td>     </tr>   </tbody></table>  <p><font size="2"></font></p>  <p><font size="2">In this post, I’ll seek to share a few tips for developers in the “Getting Started with HealthVault” phase of their solution development.&#160;&#160; I’m using my personal blog for this information (instead of the <a href="http://blogs.msdn.com/healthvault" target="_blank">team</a> blog) as I’m also ramping-up on the platform technology and corresponding use-case scenarios.&#160;&#160; Perhaps my perspective will be valuable to others.</font></p>  <p><font size="2">The </font><a href="http://healthvault.com/"><font size="2">HealthVault</font></a><font size="2"> platform provides several application </font><a href="http://msdn.microsoft.com/en-us/library/jj863170.aspx"><font size="2">connectivity models</font></a><font size="2"> supporting a variety of workflow experiences.&#160;&#160; For example, a typical on-premises </font><a href="http://msdn.microsoft.com/en-us/healthvault/cc561122.aspx"><font size="2">healthcare clinical system</font></a><font size="2"> may require a semi-automated HealthVault workflow involving direct patient interactions.&#160;&#160; Alternatively, an analytical application may require minimal user-interactions and rather a fully-automated </font><a href="http://msdn.microsoft.com/en-us/healthvault/bb871490"><font size="2">offline</font></a><font size="2"> HealthVault interaction workflow.&#160;&#160; In practice, most full-featured HealthVault solutions implement a combination of workflow scenarios depending upon a number of functional requirements including consumer-interaction, security model, deployment environment, data-management, and device integration.&#160; </font></p>  <p><font size="2">From a platform perspective, HealthVault supports an </font><a href="http://www.microsoft.com/en-us/healthvault/tools-devices/overview.aspx"><font size="2">ecosystem</font></a><font size="2"> of applications and devices.&#160;&#160; The HealthVault platform is well-documented with open support for practically any web-based client solution.&#160; However, for integrity and security purposes, programmatic access to real user accounts is controlled.&#160; In order to access the production HealthVault service, client applications must be authorized to access not only the production service itself but also individual consumer accounts hosted therein.&#160;&#160; The Consumer is truly the owner of their Health information.</font></p>  <p><font size="2">In the USA, initiatives such as </font><a href="http://www.advisory.com/Consulting/Meaningful-Use-Navigator" target="_blank"><font size="2">Meaningful Use</font></a><font size="2"> and the </font><a href="http://blue-button.github.com/docs/" target="_blank"><font size="2">Automated Blue Button Initiative</font></a><font size="2"> are driving innovation in healthcare information systems technology.&#160;&#160; A key objective is the simple and secure exchange of healthcare information between providers and patients.&#160;&#160; The </font><a href="http://blogs.msdn.com/b/familyhealthguy/archive/2011/02/12/start-sharing-information-with-patients-today.aspx" target="_blank"><font size="2">Direct Project</font></a><font size="2"> has produced a reference implementation for trust-based encrypted message exchange that is quickly becoming the standard.&#160;&#160; HealthVault users receive a free Direct Address and may utilize the <a href="https://apps.healthvault.com/messagecenter" target="_blank">HealthVault Message Center</a> to participate in secure Direct communications.</font></p>  <p><font size="2">Online services are also generating a great deal of innovative thinking.&#160;&#160; The ability to compose a solution utilizing a number of online services not only increases the speed of implementation but also the richness of end-user experiences.&#160; For example, clinical systems are really just customized Customer Relationship Management (CRM) systems.&#160; Why not compose these systems utilizing <a href="http://blogs.msdn.com/b/familyhealthguy/archive/2012/12/10/dynamics-crm-healthvault-holy-crap-it-s-population-management.aspx" target="_blank">Dynamics CRM Online and HealthVault</a>?&#160;&#160; Throw in Office365, Skype, Lync, and Windows Azure hosted services and you have a very powerful platform for quickly automating healthcare businesses.</font></p>  <p><font size="2"></font></p>  <h1>Getting Started</h1>  <ul>   <li><a href="http://blogs.msdn.com/b/healthvault/archive/2013/02/18/a-healthvault-application-development-primer-using-asp-net-mvc.aspx" target="_blank"><font size="2">A HealthVault Application Development Primer using ASP.NET MVC</font></a><font size="2"> – The first few paragraphs of this article apply to development of any HealthVault Application.&#160;&#160;&#160; </font></li>    <li><a href="http://msdn.microsoft.com/en-us/library/jj863170.aspx" target="_blank"><font size="2">Determine How Your Application and Users Will Connect to HealthVault</font></a><font size="2"> – This article (and links therein) will enable you to more quickly decide upon a solution architecture and corresponding development tasks.</font></li>    <li><a href="http://msdn.microsoft.com/en-us/healthvault" target="_blank"><font size="2">Get Your Development Tools and Find Documentation</font></a><font size="2"> – The MSDN <strong>HealthVault Developer Center</strong> is the central hub for HealthVault Application Developers.&#160;&#160; Use the Forums tab to participate in community Q&amp;A.&#160;&#160; See the various SDK’s and sample-code links.</font></li> </ul>  <p><font size="2"></font></p>  <h1>Noteworthy Samples</h1>  <ul>   <li><a href="http://hvtoys.azurewebsites.net" target="_blank"><font size="2">Sean’s HealthVault Toys</font></a><font size="2"> – Sean Nolan leads the HealthVault team and regularly contributes invaluable insights via the </font><a href="http://blogs.msdn.com/b/familyhealthguy/" target="_blank"><font size="2">Family Health Guy</font></a><font size="2"> blog.&#160; He has recently posted a few interactive samples using an Azure WebSite.&#160;&#160; Experiment with these to gain familiarity with various HealthVault Application models.</font></li>    <li><a href="http://msdn.microsoft.com/en-us/healthvault/jj128428" target="_blank"><font size="2">The HealthVault SDK Samples</font></a><font size="2"> – When you </font><a href="http://www.microsoft.com/en-us/download/details.aspx?id=3418" target="_blank"><font size="2">download</font></a><font size="2"> and install the HealthVault .NET SDK, you will find several samples hidden within the installation folder.&#160;&#160; </font></li>    <li><a href="http://www.codeplex.com/site/search?query=HealthVault&amp;ac=3" target="_blank"><font size="2">Codeplex Projects, Java, MVC, and Win8 SDKs</font></a><font size="2"> – Several “sample” projects hosted on Codeplex.com also include class libraries that are sneaking-out the door as SDKs in their own right.&#160;&#160; You can re-use these class libraries as reference assemblies (you get the source too) within your applications.&#160;&#160; The Java library provides a thin abstraction layer over the raw XML over HTTP HealthVault Platform API and is a good way to build system-independent solutions.&#160;&#160; The Win8 library enables development of new Windows Store style HealthVault Applications.</font></li>    <li><a href="http://blogs.msdn.com/b/ericgu/archive/2009/01/08/introduction-to-healthvault-development-1-introduction.aspx" target="_blank"><font size="2">Oldies but Goodies</font></a><font size="2"> – Eric wrote a number of how-to type topical articles several years ago.&#160;&#160; They remain very relevant resources.</font></li> </ul>  <p>&#160;</p>  <p><font size="2">And, of course, </font><a href="http://blogs.msdn.com/b/philpenn/contact.aspx" target="_blank"><font size="2">contact</font></a><font size="2"> us if you have a great idea for a </font><a href="http://msdn.microsoft.com/en-us/healthvault/default"><font size="2">HealthVault Application</font></a><font size="2"> and need a bit of technical assistance getting it going!</font></p>]]></content:encoded>
    </item>
    <item>
      <title>How to Configure a Windows Azure Virtual Machine File Server and use it from within Windows HPC Server Compute Jobs</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/how-to-configure-a-windows-azure-virtual-machine-file-server-and-use-it-from-within-windows-hpc-server-compute-jobs</link>
      <pubDate>Thu, 30 Aug 2012 16:34:28 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2012/08/30/how-to-configure-a-windows-azure-virtual-machine-file-server-and-use-it-from-within-windows-hpc-server-compute-jobs/</guid>
      <description><![CDATA[Recall the following axiom from your CS101 class…?     “To solve a problem, create...]]></description>
      <content:encoded><![CDATA[<p>Recall the following axiom from your CS101 class…?</p>  <blockquote>   <p><em>“To solve a problem, create abstractions.&#160;&#160; To attain efficiency, remove abstractions.”</em></p> </blockquote>  <p>Such is the case with I/O in the Cloud (i.e. all Clouds).&#160;&#160; Efficiency requires designing for the underlying platform with specific considerations for storage account quotas, network constraints, and partitioning strategies across available resources.&#160;&#160; Regarding storage, the article published <a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2010/05/10/windows-azure-storage-abstractions-and-their-scalability-targets.aspx" target="_blank"><strong>here</strong></a> is a good place to start with understanding capabilities and constraints.&#160;&#160; </p>  <p>Regardless of final solution design, it is often advantageous to initially simply get a prototype solution deployed with minimal configuration and code changes.&#160;&#160; Such is the promise of Infrastructure as a Service (IaaS).&#160;&#160; Especially with Windows HPC Server solutions, addition of an SMB File Server to your Windows Azure service enables an easy Cloud integration experience.&#160;&#160; If your objective is to create an evaluation prototype, the scenario described herein may either completely serve your file I/O requirements or just provide an operational envelope for testing purposes.&#160;&#160; For illustration purposes, I’ll keep the solution scenario as simple as possible.&#160;&#160; However, there are several deployment configuration options that would dramatically enhance your storage I/O performance and still not require modifications to your existing solution.&#160;&#160; I hope to document these advanced configuration options within subsequent posts.</p>  <p>First, a look at what we are to achieve herein…</p>  <ol>   <li>Configure a <em>file server</em> (SMB protocol, port 445) with a persistent name (e.g. “myfileserver.cloudapp.net”).</li>    <li>Create a <em>file share</em> (e.g. “\\myfileserver\myshare”) accessible from other Windows Azure worker-role VMs (e.g. compute-nodes) with user authentication (we will use workstation-mode, NTLM, and not domain authentication).&#160;&#160; </li>    <li>Ensure that the file share is backed by blob storage.</li>    <li>Execute a compute job wherein the working directory path resolves to a UNC path (e.g. “\\myfileserver\myshare”).</li>  </ol>  <p>Note the following non-objectives (perhaps to be documented in subsequent posts or even superseded by future platform features).</p>  <ol>   <li>Load-balance across multiple SMB file servers.</li>    <li>Optimize I/O (via partitioning) across multiple blob storage accounts.</li>    <li>Distribute the file structure namespace across multiple file shares (e.g. using mklink from the client perspective).</li>    <li>Leverage mountable read-only VHD files in order to gain wider distribution and staging of read-only data.</li>    <li>Utilize alternative file distribution utilities (e.g. <a href="http://technet.microsoft.com/en-us/library/ff972646(v=WS.10).aspx" target="_blank">ClusterCopyConsole</a>) to stage job input data.</li>    <li>Address on-premises to file server VM connectivity (e.g. using Windows Azure Connect or Virtual Network).</li>    <li>Securely configure the service and file server VM instance.</li>  </ol>  <p>Effectively, for illustration purposes, our Virtual Machine hosted file server instance will be a single point of I/O for any number of compute-node server instances.&#160; </p>  <h1><font size="3">Configure the Virtual Machine File Server</font></h1>  <p>Utilize the following procedure to configure a Windows Azure Virtual Machine (VM) instance for use as a File Server.</p>  <ol>   <li>Create the File Server VM instance (e.g. “MyFileServer.cloudapp.net”) using the Windows Azure <a href="http://manage.windowsazure.com" target="_blank">portal</a>.&#160;&#160; See reference instructions <a href="http://www.windowsazure.com/en-us/manage/windows/tutorials/virtual-machine-from-gallery/" target="_blank">here</a>.&#160;&#160; </li>    <li>Attach and format a blob-storage hosted <a href="http://www.windowsazure.com/en-us/manage/windows/tutorials/virtual-machine-from-gallery/#attachdisk" target="_blank">data-disk</a> to the VM.&#160;&#160; </li>    <li>Once the File Server instance is running, configure a limited privilege user-account (e.g. “MyUser”).&#160;&#160; Note that this service account is a primary security mechanism for the server instance.&#160; Any other VM within the data-center could access your server or cause denial of service.&#160;&#160; <em>More advanced server security configuration is beyond the scope of this article.</em></li>    <li>Using the Server Manager Console, enable the File Server Role.</li>    <li>Create a File Share folder (e.g. “MyShare”) on the attached data-disk and enable read/write access for the MyUser account.</li>    <li>Add two <a href="http://www.windowsazure.com/en-us/manage/windows/tutorials/virtual-machine-from-gallery/#endpoints" target="_blank">endpoints</a> to the VM for both <em>TCP port 445 and UDP port 445</em>.&#160;&#160; This enables the server (at the service deployment level) to communicate SMB protocol with worker-roles hosted in the same Windows Azure data-center.&#160;&#160; The SMB protocol is not currently routed externally from the data-center.</li> </ol>  <p>Your File Server configuration should appear as follows from the management portal.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/2262.MyFileServer1_2CB1E88D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/2262.MyFileServer1_5F00_2CB1E88D.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer1" border="0" alt="MyFileServer1" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/3833.MyFileServer1_thumb_10A129A2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/3833.MyFileServer1_5F00_thumb_5F00_10A129A2.png" width="569" height="216" /></a></p>  <p>With corresponding service end-points configured as illustrated.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1780.MyFileServer2_70861CE4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1780.MyFileServer2_5F00_70861CE4.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer2" border="0" alt="MyFileServer2" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0284.MyFileServer2_thumb_506B1027.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0284.MyFileServer2_5F00_thumb_5F00_506B1027.png" width="581" height="242" /></a></p>  <p>And the file share configuration similar to the following image.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7140.MyFileServer3_454185DD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7140.MyFileServer3_5F00_454185DD.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer3" border="0" alt="MyFileServer3" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8611.MyFileServer3_thumb_25267920.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8611.MyFileServer3_5F00_thumb_5F00_25267920.png" width="589" height="292" /></a></p>  <p>&#160;</p>  <h2><font size="3">Configure the Compute Node Templates</font></h2>  <p>You may wish to familiarize yourself with the “<a href="http://msdn.microsoft.com/en-us/hpcazurebursttrainingcourse.aspx" target="_blank">burst to azure</a>” capability of <a href="http://www.microsoft.com/en-us/download/details.aspx?id=12006" target="_blank">Windows HPC Server 2008 R2</a>.&#160;&#160; Also, a <a href="http://blogs.msdn.com/b/philpenn/archive/2012/05/21/how-to-configure-a-startup-script-for-windows-azure-nodes.aspx" target="_blank">previous article</a> discusses how to utilize start-up scripts in connection with “Windows Azure Node Templates”.&#160;&#160; You can utilize a start-up script to configure your worker-role compute-nodes so that they can “see” \\MyFileServer\MyShare.&#160;&#160; Let’s illustrate how that’s accomplished…</p>  <p>The following image illustrates a list of Compute Node Templates within the HPC Server Cluster Manager console.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6567.MyFileServer4_7019E9EF.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6567.MyFileServer4_5F00_7019E9EF.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer4" border="0" alt="MyFileServer4" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1185.MyFileServer4_thumb_7DEC2FEA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1185.MyFileServer4_5F00_thumb_5F00_7DEC2FEA.png" width="702" height="205" /></a></p>  <p>Node Templates enable partitioning of node-groups across multiple Windows Azure service deployments.&#160;&#160; Each service may contain a large number of compute nodes all managed from a single cluster head-node.&#160;&#160; Refer to the links immediately above for detailed information on how to configure a cluster to utilize Windows Azure worker role VMs as compute nodes.&#160;&#160; For our immediate purpose, we only need to modify the startup script (i.e. nodeprep.cmd) associated with each node template.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8032.MyFileServer5_76CCF372.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8032.MyFileServer5_5F00_76CCF372.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer5" border="0" alt="MyFileServer5" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/3326.MyFileServer5_thumb_56B1E6B5.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/3326.MyFileServer5_5F00_thumb_5F00_56B1E6B5.png" width="482" height="396" /></a></p>  <p>Add the following command line to the nodeprep.cmd file.&#160;&#160; Obtain your myfileserver.cloudapp.net VIP address from the Windows Azure management portal (e.g.&#160; nslookup myfileserver.cloudapp.net).&#160;&#160; The echo command appends an entry to the etc\hosts file on each local compute node and thus enables subsequent UNC host name resolutions (e.g. \\myfileserver).&#160;&#160; </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/1273.MyFileServer11_4F92AA3D.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/1273.MyFileServer11_5F00_4F92AA3D.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer11" border="0" alt="MyFileServer11" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8130.MyFileServer11_thumb_2F779D80.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8130.MyFileServer11_5F00_thumb_5F00_2F779D80.png" width="832" height="114" /></a></p>  <p>&#160;</p>  <h1><font size="3">Configure Your Job to Use the File Server and Share</font></h1>  <p>When you submit jobs using the HPC Server Scheduler those jobs are run within a user-logon context.&#160;&#160; With on-premises compute-nodes, the scheduler utilizes domain account credentials.&#160;&#160; When the target compute-node group for your job is the AzureNodes group, then a temporary local user logon is created for your job.&#160;&#160; You can verify this by submitting a job using the “whoami” command and viewing the resultant output.</p>  <p>Consequently, your job runs within a context in which any secure external resources (e.g. file shares) requires authenticated user access.&#160;&#160; You can achieve this by adding a Node Preparation Task to your job as illustrated.&#160;&#160; This task runs once on each node and precedes execution of any other task within your job.&#160;&#160; </p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6557.MyFileServer13_0F5C90C3.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6557.MyFileServer13_5F00_0F5C90C3.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer13" border="0" alt="MyFileServer13" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/5074.MyFileServer13_thumb_2B011CB9.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/5074.MyFileServer13_5F00_thumb_5F00_2B011CB9.png" width="744" height="466" /></a></p>  <p>Subsequent tasks, within your job context, will have access to the file server resources.&#160;&#160; For example, you can configure the Working Directory to utilize the file share for task input or output.</p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/3821.MyFileServer14_6ACB033E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/3821.MyFileServer14_5F00_6ACB033E.png"><img style="margin-right: auto; margin-left: auto; float: none; display: block; background-image: none;" title="MyFileServer14" border="0" alt="MyFileServer14" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/0272.MyFileServer14_thumb_4AAFF681.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/0272.MyFileServer14_5F00_thumb_5F00_4AAFF681.png" width="750" height="580" /></a></p>  <h1><font size="3">References</font></h1> Learn about Windows Azure <a href="http://blogs.msdn.com/b/windowsazure/archive/2012/06/28/data-series-exploring-windows-azure-drives-disks-and-images.aspx" target="_blank">Disks, Drives, and Images</a>.&#160; <p>Learn about Windows Azure <a href="http://www.meetwindowsazure.com/DigitalChalkTalks" target="_blank">Virtual Machines</a>.</p>]]></content:encoded>
    </item>
    <item>
      <title>C++ AMP Course Now Available From Acceleware</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/c-amp-course-now-available-from-acceleware</link>
      <pubDate>Wed, 27 Jun 2012 12:59:42 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2012/06/27/c-amp-course-now-available-from-acceleware/</guid>
      <description><![CDATA[I recently attended an excellent new course offered by Acceleware covering the C++ Accelerated...]]></description>
      <content:encoded><![CDATA[<p><font size="2">I recently attended an excellent new course offered by Acceleware covering the C++ Accelerated Massive Parallelism (AMP) library and tools.&#160;&#160; AMP extends the C++ language to enable high-scale data-parallel computational algorithms and targets devices such as Graphics Processing Units (GPUs).&#160;&#160; Significant advantages include device independence (i.e. via a DirectX abstraction layer) and integration with Visual Studio for development, debugging, and profiling.</font></p>  <p><font size="2">See the course information with schedules <a href="http://www.acceleware.com/cpp-amp-training" target="_blank">here</a>.&#160;&#160; Learn more about C++ AMP via the MSDN Parallel Programming in Native Code <a href="http://blogs.msdn.com/b/nativeconcurrency/archive/2011/09/13/c-amp-in-a-nutshell.aspx" target="_blank">blog</a>.</font></p>]]></content:encoded>
    </item>
    <item>
      <title>How to Configure a Startup Script for Windows Azure Nodes using Windows HPC Server Node Templates</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/how-to-configure-a-startup-script-for-windows-azure-nodes-using-windows-hpc-server-node-templates</link>
      <pubDate>Mon, 21 May 2012 13:24:14 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2012/05/21/how-to-configure-a-startup-script-for-windows-azure-nodes-using-windows-hpc-server-node-templates/</guid>
      <description><![CDATA[Download the script files associated with this topic from here.&#160; Refer to the authoritative...]]></description>
      <content:encoded><![CDATA[<p><font size="3"></font></p>  <p><font size="3">Download the script files associated with this topic from <a href="http://db.tt/33vVWshZ" target="_blank">here</a>.&#160; </font><font size="3">Refer to the authoritative documentation for this topic <a href="http://technet.microsoft.com/en-us/library/hh314618(v=ws.10).aspx" target="_blank">here</a>.</font></p>  <p><font size="3">This feature functionality applies when utilizing Windows HPC Server to deploy compute nodes onto Windows Azure using the Cluster Configuration Manager from the head-node.</font></p>  <p><font size="3">With Service Pack 3 (SP3) of Windows HPC Server 2008 R2 (November 2011 and later), Microsoft added the ability to specify integration with Windows Azure via Node Templates.&#160;&#160; When adding a new Node Template, you may optionally specify a node Startup Script as illustrated.</font></p>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/6837.MyNodePrepConfigurationTemplate_3A105E5E.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/6837.MyNodePrepConfigurationTemplate_5F00_3A105E5E.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="MyNodePrepConfigurationTemplate" border="0" alt="MyNodePrepConfigurationTemplate" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/7026.MyNodePrepConfigurationTemplate_thumb_4BECF22B.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/7026.MyNodePrepConfigurationTemplate_5F00_thumb_5F00_4BECF22B.png" width="603" height="329" /></a></p>  <p><font size="3">The startup script (e.g. nodeprep.cmd), is called during the Virtual Machine (VM) startup sequence upon deployment activation within a Windows Azure service.&#160;&#160; The script is executed only once and within system context on each VM instance within your deployment configuration as new nodes are added to the compute cluster.</font></p>  <p><font size="3">Proper configuration of the startup script sequence involves not only specification of the script name within the template editor, but also addition of the nodeprep “package” to the blob storage account also associated with the Node Template.&#160;&#160; This package upload activity must be accomplished prior to adding any new nodes to the cluster.&#160;&#160; Hence, the cluster admin must execute an “InstallNodePrep.bat” type script from the head-node prior to adding new nodes within the context of the new Node Template.</font></p>  <p><font size="3">Setup your scripts and package files on the head-node as illustrated below.&#160;&#160; </font></p>  <ul>   <li><font size="3">Create a two-level folder structure containing your scripts and startup package files.&#160;&#160; </font></li>    <li><font size="3">File “c:\MyHeadNode\InstallNodePrep.bat” is executed from cmd.exe on your head-node.&#160;&#160; This script creates two .zip file “packages” that will be uploaded to the Blob storage account associated with your Node Template.&#160;&#160; Note the command line syntax within the cmd.exe window below wherein the corresponding node template is specified using the “-t” argument.</font></li>    <li><font size="3">The first package is a zip of the file “c:\MyHeadNode\nodeprep\nodeprep.cmd”.&#160;&#160; Note that this file corresponds to the “nodeprep.cmd” script that you’ve specified within your Node Template configuration illustrated above.&#160; </font></li>    <li><font size="3">The second package is a zip of the folder “c:\MyHeadNode\nodeprep”.&#160;&#160;&#160; </font></li> </ul>  <p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/8510.MyNodePrepConfiguration_20A85B24.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/8510.MyNodePrepConfiguration_5F00_20A85B24.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="MyNodePrepConfiguration" border="0" alt="MyNodePrepConfiguration" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/00/93/01/metablogapi/4375.MyNodePrepConfiguration_thumb_275B64A7.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-00-93-01-metablogapi/4375.MyNodePrepConfiguration_5F00_thumb_5F00_275B64A7.png" width="604" height="624" /></a></p>  <p><font size="3">Now, when new Azure Node instances are added to your cluster, the “hpc sync” node configuration sequence will download these two packages automatically to the node-local “%CCP_PACKAGE_ROOT%” path.</font></p>  <p><font size="3">Your “nodeprep.cmd” startup script will be unzip’ed and executed.&#160;&#160; Note, a good practice is to ensure that any .msi installer executions occur synchronously using the “start /wait” command syntax (see the sample files from the download link above).&#160;&#160; Concurrent installations are problematic and could create a difficult to diagnose race condition.&#160;&#160; </font></p>  <p><font size="3">A very useful startup script output log is produced at “e:\approot\HpcStartupCommand.log” on each VM instance.&#160;&#160; You will want to ensure that your startup script contributes stdout and stderr results to the log file as illustrated within the example files (refer to the download link above).</font></p>]]></content:encoded>
    </item>
    <item>
      <title>Windows Azure HPC Scheduler SDK Now Available!</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/windows-azure-hpc-scheduler-sdk-now-available</link>
      <pubDate>Tue, 15 Nov 2011 12:07:25 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2011/11/15/windows-azure-hpc-scheduler-sdk-now-available/</guid>
      <description><![CDATA[Easily Develop Distributed Parallel Computing Solutions for Windows Azure.  A new optional extension...]]></description>
      <content:encoded><![CDATA[<p>Easily Develop Distributed Parallel Computing Solutions for Windows Azure.</p>  <p>A new optional extension of the Windows Azure SDK, the <em><strong>Windows Azure HPC Scheduler SDK</strong></em> enables developers to create a new class of Windows Azure solutions.&#160;&#160; The SDK includes a job scheduling service along with support for popular distributed parallel computing runtimes traditionally associated with High Performance Computing workloads.&#160;&#160; </p>  <p><em>Get started developing solutions…</em></p>  <p>•&#160;&#160;&#160; Update to the latest <a href="http://www.microsoft.com/windowsazure/sdk/" target="_blank">Windows Azure SDK for Visual Studio 2010</a>.    <br />•&#160;&#160;&#160; Download the <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=28015" target="_blank">Windows Azure HPC Scheduler SDK</a> installer.    <br />•&#160;&#160;&#160; Get the <a href="http://code.msdn.microsoft.com/windowsazure/Windows-Azure-HPC-7d75eb26" target="_blank">Code Samples</a> project files from MSDN Code Gallery.    <br />•&#160;&#160;&#160; Review the <a href="http://msdn.microsoft.com/en-us/library/hh560245(v=VS.85).aspx" target="_blank">Getting Started Guide</a> for installation and sample walk-through information.    <br />•&#160;&#160;&#160; Watch the <a href="http://www.microsoft.com/en-us/showcase/details.aspx?uuid=7c763f82-a9fe-4691-b145-30672d62e89a" target="_blank">introductory video</a> posted at Microsoft Showcase.    <br />•&#160;&#160;&#160; View the <a href="https://channel9.msdn.com/events/BUILD/BUILD2011/SAC-452T" target="_blank">BUILD Conference</a> session on HPC for Windows Azure.    </p>]]></content:encoded>
    </item>
    <item>
      <title>LINQ to HPC Beta2 Now Available</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/linq-to-hpc-beta2-now-available</link>
      <pubDate>Tue, 12 Jul 2011 14:02:27 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2011/07/12/linq-to-hpc-beta2-now-available/</guid>
      <description><![CDATA[Note the recent release of Windows HPC Server 2008 R2 Service Pack 2 with a list of new...]]></description>
      <content:encoded><![CDATA[<p>Note the recent release of <a href="http://blogs.msdn.com/b/windowsazure/archive/2011/06/29/hpc-pack-2008-r2-service-pack-2-sp2-released.aspx" target="_blank">Windows HPC Server 2008 R2 Service Pack 2</a> with a list of new features.&#160;&#160; A corresponding new distributed runtime for “big data” parallel computing is concurrently released in beta form.&#160;&#160; The “new” runtime is named “<a href="http://blogs.technet.com/b/windowshpc/archive/2011/07/07/announcing-linq-to-hpc-beta-2.aspx" target="_blank">LINQ to HPC</a>” and is an evolution of the popular Language Integrated Query technology in conjunction with the Microsoft Research spawned “<a href="http://research.microsoft.com/en-us/projects/DryadLINQ/" target="_blank">Dryad</a>” technology.&#160;&#160; Dryad has been used internally at Microsoft’s Bing business unit for some time.&#160;&#160; </p>  <p>Obtain the <em>LINQ to HPC beta2</em> bits at <a href="https://connect.microsoft.com/hpc" target="_blank">Microsoft Connect</a> (search for the downloads section).&#160;&#160; A prerequisite installation is the now released <a href="http://www.microsoft.com/download/en/details.aspx?displaylang=en&amp;id=26646" target="_blank">Service Pack 2</a> for Windows HPC Server.</p>]]></content:encoded>
    </item>
    <item>
      <title>Updated GAMESS for Windows HPC Server 2008 R2</title>
      <link>https://docs.microsoft.com/archive/blogs/philpenn/updated-gamess-for-windows-hpc-server-2008-r2</link>
      <pubDate>Tue, 10 May 2011 22:38:35 GMT</pubDate>
      <dc:creator><![CDATA[Phil-Pennington]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/philpenn/2011/05/10/updated-gamess-for-windows-hpc-server-2008-r2/</guid>
      <description><![CDATA[We recently completed a collaboration with the Quantum Theory Group at Ames Laboratory, Iowa State...]]></description>
      <content:encoded><![CDATA[<p>We recently completed a collaboration with the <a href="http://www.msg.chem.iastate.edu/index.html" target="_blank">Quantum Theory Group</a> at Ames Laboratory, Iowa State University, to update and tune the <a href="http://www.msg.chem.iastate.edu/gamess/index.html" target="_blank">GAMESS</a> application for <a href="http://www.microsoft.com/hpc" target="_blank">Windows HPC Server 2008 R2</a>.&#160;&#160; Obtain the source code <a href="http://www.msg.chem.iastate.edu/GAMESS/License_Agreement.html" target="_blank">here</a> and learn more about chemistry codes on Windows HPC <a href="http://blogs.msdn.com/b/hpctrekker/archive/2011/04/30/test2.aspx" target="_blank">here</a>.</p>]]></content:encoded>
    </item>
  </channel>
</rss>