<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" version="2.0">

<channel>
	<title>Nick Harris .NET</title>
	
	<link>http://www.nickharris.net</link>
	<description>Devices+Services Development with Windows Azure, ASP .NET MVC, Windows 8 and Windows Phone</description>
	<lastBuildDate>Mon, 06 May 2013 20:50:50 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/NickHarrisDotNet" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="nickharrisdotnet" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
		<title>Authenticate Windows Phone app users using Microsoft Account, Facebook, Twitter and Google with Windows Azure Mobile Services</title>
		<link>http://www.nickharris.net/2013/05/authenticate-windows-phone-app-users-using-microsoft-account-facebook-twitter-and-google-with-windows-azure-mobile-services/</link>
		<comments>http://www.nickharris.net/2013/05/authenticate-windows-phone-app-users-using-microsoft-account-facebook-twitter-and-google-with-windows-azure-mobile-services/#comments</comments>
		<pubDate>Mon, 06 May 2013 20:34:40 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Windows Phone]]></category>
		<category><![CDATA[Auth]]></category>
		<category><![CDATA[Facebook]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Microsoft Account]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1451</guid>
		<description><![CDATA[Authenticate Windows Phone app users using Microsoft Account, Facebook, Twitter and Google with Windows Azure Mobile Services Introduction This sample demonstrates how you can easily wire up your Windows Phone application to provide login capabilities ilities for your users to &#8230; <a href="http://www.nickharris.net/2013/05/authenticate-windows-phone-app-users-using-microsoft-account-facebook-twitter-and-google-with-windows-azure-mobile-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h1 id="Authenticate_users_using_Microsoft_Account_Facebook_Twitter_and_Google_with_Mobile_Services">Authenticate Windows Phone app users using Microsoft Account, Facebook, Twitter and Google with Windows Azure Mobile Services</h1>
<h1>Introduction</h1>
<p>This sample demonstrates how you can easily wire up your Windows Phone application to provide login capabilities ilities for your users to authenticate against well know social identity provides such as <strong>Microsoft Account</strong>, <strong>Facebook</strong>, <strong>Twitter</strong> and <strong>Google</strong> using <strong>Windows Azure Mobile Services</strong>.</p>
<p>You can download the sample and follow along from <a href="http://code.msdn.microsoft.com/WP-Authenticate-Account-c7e0ef84" target="_blank">here</a></p>
<h1 id="Prerequisites">Prerequisites</h1>
<div>
<ul>
<li>Visual Studio 2012 Express for Windows 8</li>
<li>and a Windows Azure account (get the <a href="http://www.windowsazure.com/en-us/pricing/free-trial/" target="_blank">Free Trial</a>)</li>
</ul>
</div>
<h1 id="Building_the_Sample">Building the Sample</h1>
<p>Follow these steps to set up the sample.</p>
<h1 id="Setting_up_the_Cloud_Environment">Setting up the Cloud Environment</h1>
<ol>
<li>Create a new <strong>Mobile Service</strong> from the Windows Azure Management Portal.To do this, log on to the <a href="https://manage.windowsazure.com">Windows Azure Management Portal</a>, navigate to Mobile Services and click <strong>New</strong>.<img class="alignnone" alt="" src="http://code.msdn.microsoft.com/windowsapps/site/view/file/72723/1/new-button.png" width="133" height="57" />Expand <strong>Compute | Mobile Service</strong>, and click <strong>Create</strong>.
<p><img class="alignnone" alt="" src="http://code.msdn.microsoft.com/windowsapps/site/view/file/72724/1/create-new-mobile-service.png" width="1160" height="464" /></p>
<p>This displays the <strong>New Mobile Service</strong> dialog.</p>
<p>In the <strong>Create a mobile service</strong> page, type a subdomain name for the new mobile service in the <strong>URL</strong> textbox and wait for name verification. Once name verification completes, select <em>Create a new SQL Database</em> in the <strong>Database</strong> dropdown list and click the right arrow button to go to the next page.</p>
<p><img class="alignnone" alt="" src="http://code.msdn.microsoft.com/windowsapps/site/view/file/72725/1/new-mobile-service-step-1.png" width="680" height="450" /></p>
<p>This displays the <strong>Specify database settings</strong> page.</p>
<blockquote><p><strong>Note:</strong> If you already have a database in the same region as the new mobile service, you can instead choose <em>Use existing Database</em> and then select that database. The use of a database in a different region is not recommended because of additional bandwidth costs and higher latencies.</p></blockquote>
<p>In <strong>Name</strong>, type the name of the new database, then type <strong>Login Name</strong>, which is the administrator login name for the new SQL Database server. Type and confirm the password, and select the check box to complete the process.</p>
<p><img class="alignnone" alt="" src="http://code.msdn.microsoft.com/windowsapps/site/view/file/72726/1/new-mobile-service-step-2.png" width="680" height="450" /></p>
<blockquote><p><strong>Note:</strong> If there is a mismatch or the password you supply does not meet the minimum requirements, a warning is displayed.</p></blockquote>
<p>You have now created a new mobile service that can be used by your mobile apps.</li>
<li>Register the sample application for authentication and configure <strong>Mobile Services</strong>. To do this, follow the instructions in <a href="https://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-users-dotnet/#register">https://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-users-dotnet/#register</a>.<br />
<blockquote><p><strong>Note:</strong> The link above provides details on how to register the sample application with <strong><a href="https://www.windowsazure.com/en-us/develop/mobile/how-to-guides/register-for-microsoft-authentication/">Microsoft Account</a></strong>, <strong><a href="https://www.windowsazure.com/en-us/develop/mobile/how-to-guides/register-for-facebook-authentication/" target="_blank">Facebook</a></strong>, <a href="https://www.windowsazure.com/en-us/develop/mobile/how-to-guides/register-for-twitter-authentication/" target="_blank"><strong>Twitter</strong> </a>and <a href="https://www.windowsazure.com/en-us/develop/mobile/how-to-guides/register-for-google-authentication/" target="_blank"><strong>Google</strong> </a>identity providers, and explains how to register the provider-generated client secret with <strong>Mobile Services</strong>.</p></blockquote>
</li>
</ol>
<h1 id="Setting_up_the_Local_Environment">Setting up the Local Environment</h1>
<ol>
<li>Configure the Mobile Service URL and access key.Get the <strong>Mobile Service URL</strong> and <strong>Mobile Service Key</strong> values. Browse to your Mobile Service dashboard, copy the service URL and click <strong>Manage Keys</strong> on the bottom bar.<img class="alignnone" alt="" src="http://code.msdn.microsoft.com/windowsapps/site/view/file/72727/1/mobile-service-settings-dashboard.png" width="762" height="691" /><em>Mobile Service URL</em>
<p>Now copy the <strong>Application Key</strong> value.</p>
<p><img class="alignnone" alt="" src="http://code.msdn.microsoft.com/windowsapps/site/view/file/72728/1/mobile-service-settings-keys.png" width="549" height="375" /></li>
<li>In <strong>Visual Studio 2012 Express for Windows Phone</strong>, open the <strong>Authentication.sln</strong> solution</li>
<li>Right Click on the <strong>Authentication project </strong>and select <strong>Manage Nuget Packages</strong></li>
<li>In the <strong>Manage Nuget Packages Dialog</strong> change the dropdown from Stable Only &gt; Include Prerelease and Search for WindowsAzure.MobileServices.  Select it and click Install (Note: at the time of writing April 26, 2013. The PCL nuget for Mobile Services was pre-release.  By the time you are reading this it may already be released as stable)</li>
<li>Open the <strong>App.xaml.cs</strong> file</li>
<li>Add a using statement for the MobileServices namespace</li>
<li>
<pre class="C#">using Microsoft.WindowsAzure.MobileServices;</pre>
</li>
<li>Supply the URL and add a using statement  application key from the mobile service in the <strong>MobileServiceClient</strong> constructor.
<div>
<pre class="C#">private static MobileServiceClient mobileService = new MobileServiceClient(
"https://{YOUR-MOBILE-SERVICE-NAME}.azure-mobile.net/",
"{YOUR-APPLICATION-KEY}");</pre>
</div>
</li>
<li>
<div>Open the <strong>MainPage.xaml.cs</strong> file</div>
</li>
<li>
<div>
<p>Add a using statement for the MobileServices namespace</p>
<div>
<div>
<pre class="C#">using Microsoft.WindowsAzure.MobileServices;</pre>
</div>
</div>
</div>
</li>
<li>
<div>
<p> Update method OnBtnMicrosoftAccountClick to call LoginAsync</p>
<pre class="C#">//Call LoginAsync for the given Auth Provider
await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.MicrosoftAccount);

//Log the logged in userId
txtStatus.Text = string.Format("Logged in with: {0}", App.MobileService.CurrentUser.UserId</pre>
</div>
</li>
<li>
<div>
<p> Update method OnBtnFacebookAccountClick to call LoginAsync</p>
<pre class="C#">//Call LoginAsync for the given Auth Provider
await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook);

//Log the logged in userId
txtStatus.Text = string.Format("Logged in with: {0}", App.MobileService.CurrentUser.UserId);</pre>
<div></div>
</div>
</li>
<li>
<pre class="C#"> Update method OnBtnTwitterAccountClick to call LoginAsync</pre>
<div>//Call LoginAsync for the given Auth Provider await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Facebook); //Log the logged in userId txtStatus.Text = string.Format(&#8220;Logged in with: {0}&#8221;, App.MobileService.CurrentUser.UserId);</div>
</li>
<li>
<div>
<p>Update method OnBtnGoogleAccountClick to call LoginAsync</p>
<pre class="C#">//Call LoginAsync for the given Auth Provider
await App.MobileService.LoginAsync(MobileServiceAuthenticationProvider.Google);

//Log the logged in userId
txtStatus.Text = string.Format("Logged in with: {0}", App.MobileService.CurrentUser.UserId);</pre>
</div>
</li>
<li>
<div>
<p>Update OnBtnLogoutClick to perform a logout operation</p>
<pre class="C#">//If there is an authenticated user then logout
if (App.MobileService.CurrentUser != null &amp;&amp; App.MobileService.CurrentUser.UserId != null)
App.MobileService.Logout();</pre>
<div></div>
</div>
</li>
</ol>
<h1 id="Running_the_Sample">Running the Sample</h1>
<ol>
<li>In Visual Studio, press the <strong>F5</strong> key to run the application.</li>
<li>In the start page, Click on the button for the authentication scenario you wish to exercise.</li>
<p><img id="81273" alt="" src="http://i1.code.msdn.s-msft.com/windowsazure/wp-authenticate-account-c7e0ef84/image/file/81273/1/auth.png" width="369" height="663" /></p>
<li> An authentication dialog box will be displayed prompting you to enter the credentials of the selected identity provider.<img id="81274" alt="" src="http://i1.code.msdn.s-msft.com/windowsazure/wp-authenticate-account-c7e0ef84/image/file/81274/1/login.png" width="373" height="667" /></li>
<li>A consent message requesting access to the application is shown the first time you log in to your account.  Click Authoriz</li>
<li>After the user is authenticated, the user id is shown in the output area.<img id="81275" alt="" src="http://i1.code.msdn.s-msft.com/windowsazure/wp-authenticate-account-c7e0ef84/image/file/81275/1/loggedin.png" width="371" height="663" /></li>
<li> Click the Logout button to log the user out before trying out another identity provider.</li>
</ol>
<p>If you cant find a specific Windows Azure Mobile Services scenario using Windows Phone please feel free to reach out to me on Twitter via <a href="http://www.twitter.com/cloudnick" target="_blank">@cloudnick</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2013/05/authenticate-windows-phone-app-users-using-microsoft-account-facebook-twitter-and-google-with-windows-azure-mobile-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Build Websites and Apache Cordova/PhoneGap apps using the new HTML client for Azure Mobile Services</title>
		<link>http://www.nickharris.net/2013/03/build-websites-and-apache-cordovaphonegap-apps-using-the-new-html-client-for-azure-mobile-services/</link>
		<comments>http://www.nickharris.net/2013/03/build-websites-and-apache-cordovaphonegap-apps-using-the-new-html-client-for-azure-mobile-services/#comments</comments>
		<pubDate>Mon, 18 Mar 2013 21:11:35 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[ASP .NET]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[CORS]]></category>
		<category><![CDATA[HTML5/JS]]></category>
		<category><![CDATA[Windows Azure Mobile Services]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1436</guid>
		<description><![CDATA[Today Scott Guthrie announced HTML client support for Windows Azure Mobile Services such that developers can begin using Windows Azure Mobile Services to build both HTML5/JS Websites and Apache Cordova/PhoneGap apps. The two major changes in this update include: New &#8230; <a href="http://www.nickharris.net/2013/03/build-websites-and-apache-cordovaphonegap-apps-using-the-new-html-client-for-azure-mobile-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Today Scott Guthrie announced <a href="http://weblogs.asp.net/scottgu/archive/2013/03/18/windows-azure-new-hadoop-service-html5-js-cors-phonegap-mercurial-and-dropbox-support.aspx">HTML client support for Windows Azure Mobile Services</a> such that developers can begin using Windows Azure Mobile Services to build both HTML5/JS Websites and Apache Cordova/PhoneGap apps.</p>
<p>The two major changes in this update include:</p>
<ul>
<li><b>New Mobile Services HTML client library </b>that supports IE8+ browsers, current versions of Chrome, Firefox, and Safari, plus PhoneGap 2.3.0+.  It provides a simple JavaScript API to enable both the same storage API support we provide in other native SDKs and easy user authentication via any of the four supported identity providers &#8211; Microsoft Account, Google, Facebook, and Twitter.</li>
<li><b>Cross Origin Resource Sharing (CORS) support</b> to enable your Mobile Service to accept cross-domain Ajax requests. You can now configure a whitelist of allowed domains for your Mobile Service using the Windows Azure management portal.</li>
</ul>
<p>With this update Windows Azure Mobile Services now provides a scalable turnkey backend solution for your Windows Store, Windows Phone, iOS, Android and HTML5/JS applications.</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/03/HTMLClient.png"><img class="alignnone size-full wp-image-1437" alt="HTMLClient" src="http://www.nickharris.net/wp-content/uploads/2013/03/HTMLClient.png" width="534" height="102" /></a></p>
<p>To learn more about the new HTML client library for Windows Azure Mobile Services please see checkout the <a href="http://www.windowsazure.com/en-us/develop/mobile/resources-html/">new HTML tutorials on WindowsAzure.com</a> and the following short 4 minute video where Yavor Georgiev demonstrates how to quickly create a new mobile service, download the HTML client quick start app, run the app and store data within the Mobile Service then configure a custom domain with Cross-origin Resource Sharing (CORS) support</p>
<p><video width="320" height="240" poster="http://media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient_512.jpg" controls="controls"><source src="http://media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient_mid.mp4" type="video/mp4" /><source src="http://media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient.webm" type="video/webm" /><object width="320" height="240" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient_mid.mp4&amp;poster=http%3A//media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient_512.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="320" height="240" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient_mid.mp4&amp;poster=http%3A//media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient_512.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video></p>
<p>Watch on <a title="Windows Azure Mobile Services HTML client" href="http://go.microsoft.com/fwlink/?LinkId=287040" target="_blank">Channel9 here</a></p>
<p>If you have any questions please reach out to us via dedicated Windows Azure Mobile Services <a href="http://social.msdn.microsoft.com/Forums/en-US/azuremobile/">our forum</a>.</p>
<p>Enjoy,</p>
<p>Nick Harris</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2013/03/build-websites-and-apache-cordovaphonegap-apps-using-the-new-html-client-for-azure-mobile-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient_mid.mp4" length="35274447" type="video/mp4" />
<enclosure url="http://media.ch9.ms/ch9/886c/9aea26b2-eb7e-44c7-a425-443a0f6f886c/GettingStartedwithMobileServicesHTMLClient.webm" length="8421546" type="application/wordperfect" />
		</item>
		<item>
		<title>Devices + Services:  Near Realtime Sensor Data with Windows Azure Mobile Services, .NET MicroFramework, Pusher and ASP .NET MVC</title>
		<link>http://www.nickharris.net/2013/02/devices-services-near-realtime-sensor-data-with-windows-azure-mobile-services-net-microframework-and-pusher/</link>
		<comments>http://www.nickharris.net/2013/02/devices-services-near-realtime-sensor-data-with-windows-azure-mobile-services-net-microframework-and-pusher/#comments</comments>
		<pubDate>Thu, 14 Feb 2013 04:53:34 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[ASP .NET]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[.net mf]]></category>
		<category><![CDATA[.net microframework]]></category>
		<category><![CDATA[embedded]]></category>
		<category><![CDATA[pusher]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1317</guid>
		<description><![CDATA[It&#8217;s no surprise to people around me that I have a strong desire to code more, so I did just that on a Saturday several weeks back and here is what I built &#8211; a new devices + services scenario &#8230; <a href="http://www.nickharris.net/2013/02/devices-services-near-realtime-sensor-data-with-windows-azure-mobile-services-net-microframework-and-pusher/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s no surprise to people around me that I have a strong desire to code more, so I did just that on a Saturday several weeks back and here is what I built &#8211; a new devices + services scenario using a Gadgeteer, the .NET MicroFramework, <a title="Windows Azure Mobile Services" href="http://www.windowsazure.com/mobile" target="_blank">Windows Azure Mobile Services</a> and <a title="Pusher.com" href="http://pusher.com" target="_blank">Pusher</a> and Windows Azure Web Sites.  </p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/Device1.png"><img class="alignnone size-full wp-image-1385" alt="Device1" src="http://www.nickharris.net/wp-content/uploads/2013/02/Device1.png" width="1053" height="917" /></a></p>
<p>Lets build this:</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/WP_20130213_003.jpg"><img class="alignnone size-full wp-image-1384" alt="WP_20130213_003" src="http://www.nickharris.net/wp-content/uploads/2013/02/WP_20130213_003.jpg" width="1632" height="918" /></a></p>
<p>and get some live graphs that look like this &#8211; note up to you to do some better styling <img src='http://www.nickharris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><a href="http://microframework.azurewebsites.net/" target="_blank"><img src="http://www.nickharris.net/wp-content/uploads/2013/02/graphs2.png" alt="graphs2" width="663" height="981" class="alignnone size-full wp-image-1408" /></a> &#8211; see it <a title="http://microframework.azurewebsites.net/" href="http://microframework.azurewebsites.net/" target="_blank">live here</a></p>
<p>The idea I set out with was to open up the power (and ease) of Windows Azure Mobile Services to embedded devices that can run .NET MicroFramework.  The scenario I come up with was to capture some sensor data, insert it into a Mobile Service to store the data for historical purposes and also provide a near real time stream of data for clients such as your web browser using <a title="Pusher.com" href="http://Pusher.com" target="_blank"><strong>Pusher </strong></a>one of our Windows Azure Store Partners.</p>
<p><strong>Capturing Sensor Data</strong></p>
<p>For this scenario I am using the GHI Gadgeteer FEZ Spider and I have already installed <a href="http://www.ghielectronics.com/support/dotnet-micro-framework" target="_blank">all the pre-req software from GHI</a>   An embedded device that runs the .NET MicroFramework and has a bunch of plug and play sensors for rapid prototyping.  To collect the sensor data is quite straight forward</p>
<p>use the designer to wire up your sensors</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/GadgeteerDesigner.png"><img class=" wp-image-1351 alignnone" alt="GadgeteerDesigner" src="http://www.nickharris.net/wp-content/uploads/2013/02/GadgeteerDesigner.png" width="610" height="524" /></a></p>
<p>The following code block will show how to open the network and capture sensor data in this case light, humidity and temperature &#8211; is quite straight forward and resides within Program.cs.</p>
<p><script type="text/javascript" src="https://gist.github.com/nickharris/4950009.js"></script></p>
<p>With that we have now captured our sensor data which is good, but to be useful to me I wanted to store this data off the device. To do this I decided to use Windows Azure Mobile Services </p>
<p><strong>Storing the Sensor Data in Mobile Services</strong> Ok the first thing that you will need to do is Create a Mobile Service. Within the <a title="Windows Azure Portal" href="https://manage.windowsazure.com" target="_blank">Windows Azure Portal </a> Click New+  </p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/plus-new.png"><img class="size-full wp-image-1371 alignnone" alt="plus-new" src="http://www.nickharris.net/wp-content/uploads/2013/02/plus-new.png" width="133" height="57" /></a> </p>
<p>Select Compute, Mobile Service, Create </p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/Create.png"><img class=" wp-image-1372 alignnone" alt="Create" src="http://www.nickharris.net/wp-content/uploads/2013/02/Create.png" width="1224" height="315" /></a> </p>
<p>Provide a subdomain name for your Mobile Service. This will be the endpoint that your device writes sensor data to and complete the wizard </p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/createMobileService.png"><img class=" wp-image-1373 alignnone" alt="createMobileService" src="http://www.nickharris.net/wp-content/uploads/2013/02/createMobileService.png" width="718" height="477" /></a> </p>
<p>Once your Mobile Service is provisioned.  Click on it and select the Data Tab and click Add a Table <a href="http://www.nickharris.net/wp-content/uploads/2013/02/AddATable.png"><img class="alignnone size-full wp-image-1380" alt="AddATable" src="http://www.nickharris.net/wp-content/uploads/2013/02/AddATable.png" width="1043" height="551" /></a> </p>
<p>Call this table SensorReading and save </p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/SensorReading.png"><img class="alignnone size-full wp-image-1381" alt="SensorReading" src="http://www.nickharris.net/wp-content/uploads/2013/02/SensorReading.png" width="687" height="593" /></a> </p>
<p>Great, with that done we now have a Windows Azure Mobile Service ready to receive our data from our embedded device.  Interestingly Windows Azure Mobile Services already has client SDKs for Windows Store, Windows Phone and iOS apps.  If your an Android dev support for Android coming soon &#8211; giggidy.  </p>
<p>All of these client SDKs consume the REST API that Mobile Services provides for you out of the box.  One of the powerful things that the client SDKs offer is a really simple client API for consuming these services for things like data storage and Auth.  </p>
<p>My goal was to provide something that gives a similar experience to .NET MicroFramework devs because hey if you&#8217;re already writing software for embedded devices which is hard enough why shouldn&#8217;t you get an easy backend too? I invested a Saturday afternoon on this and provided a quick v-slice for the Insert operation.  To do this I took the Windows Phone Client SDK for Mobile Services and started porting it to .NET MicroFramework.  Man I must say I feel for you .NET MicroFramework devs:</p>
<ul>
<li>no&lt;Generics&gt;</li>
<li>no LINQ</li>
<li>no JSON Serialization</li>
<li>limited Reflection capability &#8211; where did the GetProperties method go in .NET MF, I noticed PropertyInfo was there but couldn&#8217;t actually find GetProperties?</li>
</ul>
<p>It was like coding back in <del>the dark ages</del> .NET 1.1 ah yes I remember those days. Quite  a wakeup call of how far we have really come!  So needless to say the Saturday afternoon was longer and not as productive as expected, sort of typical right?  Anyhow I got out a partial port that provides Insert functionality and a quick and pretty dirty JSON Serializer.  So here is what it looks like to use it to insert data to your Mobile Service. First we&#8217;ll need to add a reference to the (unofficial) Microsoft.Azure.Zumo.MicroFramework assembly. You can find the class library for this in the <em>Where’s teh codez </em>section towards the end </p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/References.png"><img class="size-full wp-image-1374 alignnone" alt="References" src="http://www.nickharris.net/wp-content/uploads/2013/02/References.png" width="324" height="244" /></a> </p>
<p>Now create a class SensorReading.cs, this will be the entity you will insert in your Mobile Service</p>
<p><script type="text/javascript" src="https://gist.github.com/nickharris/4949367.js"></script></p>
<p>To interact with our mobile service lets now create a new instance MobileServicesClient in your Program.cs</p>
<p><script type="text/javascript" src="https://gist.github.com/nickharris/4949948.js"></script></p>
<p>One thing you will note here is that I have not looked into how https is handled in the .NET MF so I am just using the http protocol for writing up to the Mobile Service I still need to investigate support for https on .NET MF. Now lets update temperatureHumidity_MeasurementComplete to create a new sensor reading and store insert it into your Windows Azure Mobile Service (backed by a Windows Azure SQL Database)</p>
<p><script type="text/javascript" src="https://gist.github.com/nickharris/4950450.js"></script></p>
<p>That&#8217;s it pretty easy right! You&#8217;ll note from an API consumer perspective that its pretty close to the experience you get for the Win Store and WP client SDKs minus the fact that I didn&#8217;t write a JSON Deserializer yet so I am not currently rehydrating the entity that was passed to the Mobile Service with the updated Id or updated properties&#8230;</p>
<p>So now that I had my sensor readings being stored in Windows Azure Mobile Services I wanted to look at how I could visualize this data.</p>
<p><strong>Sending the sensor data to listening clients using Pusher</strong></p>
<p>This is where things get pretty sweet. I wanted to visualize my sensor data in a graph as it arrived in my Mobile Service. Recently we announced a new Windows Azure Store partner &#8211; <a href="http://pusher.com" title="http://pusher.com" target="_blank">Pusher </a> a  WebSocket Powered Realtime Messaging Service.  Within the Windows Azure Store you can quickly provision a Pusher account and utilize it from Mobile Services within minutes as follows.</p>
<p>Press New+</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/plus-new.png"><img class="alignnone size-full wp-image-1371" alt="plus-new" src="http://www.nickharris.net/wp-content/uploads/2013/02/plus-new.png" width="133" height="57" /></a></p>
<p>Select Store</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/NewStore.png"><img alt="NewStore" src="http://www.nickharris.net/wp-content/uploads/2013/02/NewStore.png" width="1109" height="325" /></a></p>
<p>Select the Pusher add-on</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/StorePusher.png"><img class="alignnone size-full wp-image-1377" alt="StorePusher" src="http://www.nickharris.net/wp-content/uploads/2013/02/StorePusher.png" width="1032" height="677" /></a></p>
<p>Walk through the remainder of the Wizard to select your plan and get your keys</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/PusherPlan.png"><img class="alignnone  wp-image-1379" alt="PusherPlan" src="http://www.nickharris.net/wp-content/uploads/2013/02/PusherPlan.png" width="1029" height="675" /></a></p>
<p>Note: if the Windows Azure Store is currently not available in your region you can sign up directly on <a title="Pusher.com" href="http://pusher.com/" target="_blank">Pusher.com</a></p>
<p>Next in the Windows Azure Portal select your SensorReading table and click the script tab and set the dropdown to Insert. This will allow us to write code, called Server Scripts, that will be executed every time our Gadgeteer inserts data into our SensorReading table in Mobile Service.</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/insertscript.png"><img class="alignleft size-full wp-image-1366" alt="insertscript" src="http://www.nickharris.net/wp-content/uploads/2013/02/insertscript.png" width="1218" height="271" /></a></p>
<p>Next we replace the insert code of our script to do two things save the data to our database and then use Pusher subscription to send our sensor data as it is received to all listening clients.</p>
<p><script type="text/javascript" src="https://gist.github.com/nickharris/4950428.js"></script>  </p>
<p><strong>Graphing the data received via Pusher in a web client running on Windows Azure Web Sites</strong> </p>
<p>So now we had our sensor data collected, inserted and stored in Mobile Services and then <strong>pushed</strong> using pusher to any listening clients.  What I wanted was a web client to visualize the data in a graph as it arrived. You can learn how to create a free Windows Azure Website using ASP.NET MVC and deploy it to Windows Azure here &#8211; <a href="http://www.windowsazure.com/en-us/develop/net/tutorials/get-started/">http://www.windowsazure.com/en-us/develop/net/tutorials/get-started/</a> </p>
<p>The following code shows how you can write a quick, not so pretty code+UI wise,  graph that will receive the sensor data live via Pusher and update the graph.  To do this I am using jqplot and the Pusher JavaScript library. First add your script references to _Layout.cshtml</p>
<p><script type="text/javascript" src="https://gist.github.com/nickharris/4950358.js"></script></p>
<p>Then add your jquery.jqplot.min.css to your /Content folder. Next we need to Update our Home/Index.cshtml view to listen/bind to our Pusher Channel and then redraw our jqplot graph as data is pushed directly from Pusher.</p>
<p><script type="text/javascript" src="https://gist.github.com/nickharris/4950398.js"></script></p>
<p>If you read through the code you will see pretty clearly that the Pusher implementation is 3 lines of code only &#8211; to me this is extremely cool. Itty bitty amount of code, phenomenal cosmic power! </p>
<p>So that&#8217;s it now we have live graphs on our website, you can checkout a running version of this code and it live graphs that I deployed to a Windows Azure Web Site here &#8211; <a href="http://microframework.azurewebsites.net" title="http://microframework.azurewebsites.net" target="_blank">http://microframework.azurewebsites.net</a></p>
<p><strong>How much does it cost</strong> </p>
<p>Everything that I did here can be done for free with <a href="http://www.windowsazure.com/en-us/pricing/free-trial/" target="_blank">Windows Azure Windows Azure Free Trial</a> and/or the great free tier offerings for Windows Azure Web Sites, Windows Azure Mobile Services and Pusher. </p>
<p><strong>Where’s teh codez?</strong> </p>
<p>This is unofficial, is not supported &#8211; I did it in my free time and it Works on my machine! <img src='http://www.nickharris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   disclaimers all being said I really hope that this does open up a lot of doors for you for building out a whole new range of devices + services scenarios using Windows Azure and our Store Partners You can download the .NET MF lib and sample code from <a title="https://github.com/nickharris/Microsoft.Azure.Zumo.MicroFramework" href="https://github.com/nickharris/Microsoft.Azure.Zumo.MicroFramework" target="_blank">this github repo</a> </p>
<p><strong>Summary</strong> </p>
<p>I hope this has opened the door to great new devices+services scenarios you can build out for your .NET MicroFramework solutions.  With few lines of code and powerful services like Windows Azure Web Sites, Windows Azure Mobile Services and Pusher you can make working in the emerging embedded devices + services space a lot easier then it has been in the past.  Please do let me know if you have built something awesome in this space on the Twitterz <a title="http://www.twitter.com/cloudnick" href="http://www.twitter.com/cloudnick" target="_blank">@cloudnick</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2013/02/devices-services-near-realtime-sensor-data-with-windows-azure-mobile-services-net-microframework-and-pusher/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building Mobile Apps with Windows Azure Content from BUILD 2012</title>
		<link>http://www.nickharris.net/2013/02/building-mobile-apps-with-windows-azure-content-from-build-2012/</link>
		<comments>http://www.nickharris.net/2013/02/building-mobile-apps-with-windows-azure-content-from-build-2012/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 21:40:44 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Store]]></category>
		<category><![CDATA[winrt]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1330</guid>
		<description><![CDATA[//BUILD 2012 was an awesome event! this post is a little late.  Although late this content is still extremely relevant if you are building Connected Mobile Apps. Here are a couple of sessions you should watch: Keynote Demo of Windows Azure &#8230; <a href="http://www.nickharris.net/2013/02/building-mobile-apps-with-windows-azure-content-from-build-2012/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>//BUILD 2012 was an awesome event! this post is a little late.  Although late this content is still extremely relevant if you are building Connected Mobile Apps. Here are a couple of sessions you should watch:</p>
<p><strong>Keynote Demo of Windows Azure Mobile Services</strong><br />
During //BUILD 2012 I was fortunate enough to be to be on point for delivering the day 2 Mobile Services keynote demo app Event Buddy.  If you have not watched this keynote demo I would recommend you check it out &#8211; the Mobile Services Demo starts about 10mins 30 seconds in</p>
<p><video width="320" height="240" poster="http://media.ch9.ms/ch9/2816/4362df50-9233-46d2-aa06-7e9887ba2816/Build2012Key02_Custom.jpg" controls="controls"><source src="http://media.ch9.ms/ch9/2816/4362df50-9233-46d2-aa06-7e9887ba2816/Build2012Key02_mid.mp4#time=10m46s" type="video/mp4" /><source src="http://media.ch9.ms/ch9/2816/4362df50-9233-46d2-aa06-7e9887ba2816/Build2012Key02.webm#time=10m46s" type="video/webm" /></video><br />
<a href="http://channel9.msdn.com/Events/Build/2012/1-002#10m46s" target="_blank">Direct Video link on Channel9</a>.  Event Buddy is now also available as a Code Sample that you can download <a title="Event Buddy" href="http://code.msdn.microsoft.com/windowsapps/Event-Buddy-ddafd9b6#time=10m46s" target="_blank">here</a>.</p>
<p><strong>Developing Mobile Solutions on Windows Azure &#8211; Part I</strong></p>
<p>Watch Josh take a Windows Phone 8 + Windows Store application and light it up with cloud services to handle data, authentication and push notifications &#8211; right before your eyes with Windows Azure Mobile Services. Almost all demo and no slides, this session is designed to take you from zero to Mobile Services here in 60 minutes.<br />
<video width="320" height="240" poster="http://video.ch9.ms/sessions/build/2012/3-057-LG.jpg" controls="controls"><source src="http://media.ch9.ms/ch9/d4ba/e958b095-890c-47f2-b235-23cdc09fd4ba/3-057_mid.mp4" type="video/mp4" /><source src="http://media.ch9.ms/ch9/d4ba/e958b095-890c-47f2-b235-23cdc09fd4ba/3-057.webm" type="video/webm" /><object width="320" height="240" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//media.ch9.ms/ch9/d4ba/e958b095-890c-47f2-b235-23cdc09fd4ba/3-057_mid.mp4&amp;poster=http%3A//video.ch9.ms/sessions/build/2012/3-057-LG.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="320" height="240" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//media.ch9.ms/ch9/d4ba/e958b095-890c-47f2-b235-23cdc09fd4ba/3-057_mid.mp4&amp;poster=http%3A//video.ch9.ms/sessions/build/2012/3-057-LG.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video></p>
<p>You can also <a href="http://channel9.msdn.com/Events/Build/2012/3-057">watch this video directly on Channel 9 here.</a><br />
<strong>Developing Mobile Solutions on Windows Azure &#8211; Part I</strong></p>
<p>In addition to this I also presented with fellow baldy &#8211; <a href=" http://chrisrisner.com/Build-2012–Mobile-Solutions-with-Windows-Azure">Chris Risner</a>.  In this session we took the output of Part I  from Josh and demonstrated how you could extend your existing applications to support common scenarios such as geo-location, media, and cloud to device messaging using services from Windows Azure.   Here a summary of the content of this presentation that I humbly grabbed directly from a prior <a href="http://chrisrisner.com/Build-2012–Mobile-Solutions-with-Windows-Azure" target="_blank">post </a>by Chris</p>
<ul>
<li>We took pictures and uploaded them to Blob Storage.  For this we used a web service layer, running in Windows Azure Websites, to get a SAS (Shared Access Signature) which allowed us to securely upload to blob storage.</li>
<li>We then got the location of the device and used that information to geo-tag the pictures we just uploaded.</li>
<li>We added a web page to our web service which allowed a user to select a geographical area on a map and request a push notification be sent to anyone that had taken a picture inside of it (this used the Bing Maps API and Queues from Windows Azure Storage)</li>
<li>We deployed a worker role to Windows Azure Cloud Services which would check the queue and then figure out who should be notified (using Entity Framework’s geospatial support) and sent out the actual push notifications to both the Windows 8 and Windows Phone 8 clients.</li>
</ul>
<p><video width="320" height="240" controls="controls" poster="http://video.ch9.ms/sessions/build/2012/3-039-LG.jpg"><source src="http://media.ch9.ms/ch9/0698/799eaecf-b0b0-4b28-aeba-f8b799d90698/3-039_mid.mp4#time=4m10s" type="video/mp4" /><source src="http://media.ch9.ms/ch9/0698/799eaecf-b0b0-4b28-aeba-f8b799d90698/3-039.webm#time=4m10s" type="video/webm" /></video></p>
<p>Here is the direct link to <a href="http://channel9.msdn.com/Events/Build/2012/3-039" target="_blank">watch on Channel 9</a> and Chris has also made the code available <a href="https://github.com/WindowsAzure-Samples/build-wp8-win8-storage-location-push" target="_blank">here</a><br />
Enjoy,</p>
<p>Nick Harris</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2013/02/building-mobile-apps-with-windows-azure-content-from-build-2012/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.ch9.ms/ch9/2816/4362df50-9233-46d2-aa06-7e9887ba2816/Build2012Key02_mid.mp4#time=10m46s" length="856931034" type="video/mp4" />
<enclosure url="http://media.ch9.ms/ch9/2816/4362df50-9233-46d2-aa06-7e9887ba2816/Build2012Key02.webm#time=10m46s" length="194567934" type="application/wordperfect" />
<enclosure url="http://media.ch9.ms/ch9/d4ba/e958b095-890c-47f2-b235-23cdc09fd4ba/3-057_mid.mp4" length="530348940" type="video/mp4" />
<enclosure url="http://media.ch9.ms/ch9/d4ba/e958b095-890c-47f2-b235-23cdc09fd4ba/3-057.webm" length="111951332" type="application/wordperfect" />
<enclosure url="http://media.ch9.ms/ch9/0698/799eaecf-b0b0-4b28-aeba-f8b799d90698/3-039_mid.mp4#time=4m10s" length="610912834" type="video/mp4" />
<enclosure url="http://media.ch9.ms/ch9/0698/799eaecf-b0b0-4b28-aeba-f8b799d90698/3-039.webm#time=4m10s" length="121020134" type="application/wordperfect" />
		</item>
		<item>
		<title>Top Ten Reasons to Compete in the Imagine Cup Windows Azure Challenge!</title>
		<link>http://www.nickharris.net/2013/02/top-ten-reasons-to-compete-in-the-imagine-cup-windows-azure-challenge/</link>
		<comments>http://www.nickharris.net/2013/02/top-ten-reasons-to-compete-in-the-imagine-cup-windows-azure-challenge/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 21:05:31 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[ImagineCup]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1328</guid>
		<description><![CDATA[Have you checked out the Imagine Cup Windows Azure Challenge? It's not too late! You've got until February 15 for someone on your team to pass the Windows Azure Challenge quiz, which is available from your Dashboard once you've signed up for the challenge and created a team. <a href="http://www.nickharris.net/2013/02/top-ten-reasons-to-compete-in-the-imagine-cup-windows-azure-challenge/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Have you checked out the Imagine Cup <a href="http://www.imaginecup.com/IC13/Competition/WindowsAzure">Windows Azure Challenge</a>? It&#8217;s not too late! You&#8217;ve got until February 15 for someone on your team to pass the Windows Azure Challenge quiz, which is available from your Dashboard once you&#8217;ve signed up for the challenge and created a team.</p>
<p>We&#8217;re spending this week sharing information about the challenge and about developing for Windows Azure. Here&#8217;s my <strong>Top Ten Reasons to Compete in the Windows Azure Challenge</strong>:</p>
<ol>
<li value="10">You get a Windows Azure account to build your submission for FREE!</li>
<li value="9">Much more power than your favorite superhero without the occupational risks!  From the safety of your couch with a click of a button you can quickly build, deploy, and manage applications across a global network of Microsoft-managed data centers.</li>
<li value="8">Born to code? Me too, we already have so much in common <img src='http://www.nickharris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  - <a href="http://www.windowsazure.com/en-us/develop/overview/">Windows, Mac, Linux - .NET, node.js, java, php, python and others</a> you can build applications using any operating system, language or tool. Use what works best for you!</li>
<li value="7">When building your solutions you consider leveraging partners from the <a href="http://www.windowsazure.com/en-us/store/overview/">Windows Azure Store</a> who provide both application and data services.  For example you could use Microsoft Translator to translate text and SendGrid to send an email.</li>
<li value="6">Need a Database? Apply your existing knowledge and hit the ground running using one of the following popular databases including Windows Azure SQL Database, MySQL and MongoDB.</li>
<li value="5">Building a distributed system? Check out <a href="http://www.windowsazure.com/en-us/home/features/messaging/">Service Bus</a> for relayed connectivity between distributed components anywhere in the globe!</li>
<li value="4">Got Video? Build media solutions using <a href="http://www.windowsazure.com/en-us/develop/media-services/">Windows Azure Media Services</a>: Ingest, Encode, Protect and Stream media from the cloud with ease.</li>
<li value="3">Go Web go! With <a href="http://www.windowsazure.com/en-us/home/scenarios/web-sites/">Windows Azure Web Sites</a> there is no easier way to get a web site up and running in seconds. Before you could read a whole paragraph on how to use Web Sites, you could have a site up and running with a database back-end.   Develop with ASP.NET, PHP or Node.js and deploy in seconds with FTP, Git or TFS.</li>
<li value="2">Got Mobile? When competing in a world class challenge every minute counts.  Within seconds you can use <a href="http://www.windowsazure.com/en-us/home/scenarios/mobile-services/">Windows Azure Mobile Services</a> to create a back-end for your Windows Store + Windows Phone apps to incorporate structured storage, user authentication, and push notifications.</li>
</ol>
<p>And the number one reason to compete in the Windows Azure Challenge is . . .</p>
<ol>
<li value="1">Got Job? huh&#8230; wait!, what now? When the competition is all done and dusted, the skills you&#8217;ve gained working with Windows Azure will set you well apart from the rest when it comes to looking for your dream job &#8211; it did for me!</li>
</ol>
<p>Nick Harris | Imagine Cup Windows Azure Challenge Captain | <a href="https://twitter.com/@cloudnick" target="_blank">@cloudnick</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2013/02/top-ten-reasons-to-compete-in-the-imagine-cup-windows-azure-challenge/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Announcing the Windows Azure Boost for Imagine Cup</title>
		<link>http://www.nickharris.net/2013/02/announcing-the-windows-azure-boost-for-imagine-cup/</link>
		<comments>http://www.nickharris.net/2013/02/announcing-the-windows-azure-boost-for-imagine-cup/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 20:58:20 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[ImagineCup]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1320</guid>
		<description><![CDATA[Windows Azure is a suite of powerful cloud services that can help your app projects in a variety of ways. If your Imagine Cup team is thinking about exploring Windows Azure, the decision just got a lot easier thanks to the Windows Azure Boost! Our first boost is for those teams using Windows Azure Cloud Services, Websites, or Virtual Machines. Use any or all of those technologies and your team could win $1,000! Our second Boost is for using Windows Azure Mobile Services. Incorporate that into your project and your team could win $1,000 for it. And best of all, you can go for the double shot: if your team wins both Boosts you'll get $3,000! <a href="http://www.nickharris.net/2013/02/announcing-the-windows-azure-boost-for-imagine-cup/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p><a href="http://www.nickharris.net/wp-content/uploads/2013/02/WinAzure_rgb_Cyan_S.png"><img class=" wp-image-1326 alignnone" alt="WinAzure_rgb_Cyan_S" src="http://www.nickharris.net/wp-content/uploads/2013/02/WinAzure_rgb_Cyan_S.png" width="817" height="196" /></a></p>
<p>Windows Azure is a suite of powerful cloud services that can help your app projects in a variety of ways. If your Imagine Cup team is thinking about exploring Windows Azure, the decision just got a lot easier thanks to the Windows Azure Boost!</p>
<p>At our worldwide finals next July in St. Petersburg, <strong>our first place winners who include Windows Azure in their project can earn an extra $1,000 or $3,000 for their team!</strong></p>
<p>We actually have two Windows Azure Boosts. Our first boost is for those teams using Windows Azure Cloud Services, Websites, or Virtual Machines. Use any or all of those technologies and your team could win $1,000! Our second Boost is for using Windows Azure Mobile Services. Incorporate that into your project and your team could win $1,000 for it. And best of all, you can go for the <strong>double shot</strong>: if your team wins both Boosts you&#8217;ll get <strong>$3,000!</strong></p>
<p>So if you&#8217;re submitting a project to the Windows Phone Challenge, for example, consider using Windows Azure Mobile Services in your project. If you&#8217;re our top winner in that challenge, your team will earn an extra thousand dollars thanks to the Windows Azure Boost. Add Windows Azure Cloud Services, Websites, or Virtual Machines and your winning team would get the double shot of $3,000!</p>
<p>(This is open to all competitions and challenges except the Windows Azure Challenge, since that would be redundant.)</p>
<p>We&#8217;re really looking forward to seeing your great projects in St. Petersburg. And if your project uses Windows Azure, your team could earn the thousand-buck boost or even the double shot for three thousand.</p>
<p>To get you started, here are some links to help you out:</p>
<ul>
<li><strong>Access: </strong>Complete the <a href="http://www.imaginecup.com/IC13/Competition/WindowsAzure#?fbid=UpOzCbT8O2G">Imagine Cup Windows Azure Quiz </a>and we will send you your FREE azure pass!</li>
<li><strong>Developer tools</strong>?
<ul>
<li>If you want to use Visual Studio get it for FREE from <a href="http://www.dreamspark.com/">DreamSpark</a>.</li>
<li>Then grab the SDK for your development language and operating system of choice from<a href="http://www.windowsazure.com/en-us/develop/downloads/">Windows Azure Downloads</a></li>
</ul>
</li>
<li><strong>Tutorials:</strong> Jump in and start doing some step-by-step tutorials in the <a href="http://www.windowsazure.com/en-us/develop/overview/">Windows Azure Developer Center</a> &lt;&#8211; you should really bookmark this link.  Here a couple of top picks in order of what is probably most relevant for you - pick the ones that are most appropriate for you:
<ul>
<li><strong>Windows Azure Mobile Services: </strong>Do the Getting Started Tutorial for <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/">Windows Azure Mobile Services</a>, checkout the <a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services">Video tutorials</a> and <a href="http://www.windowsazure.com/en-us/develop/mobile/windows-store-samples/">Code Samples</a></li>
<li><strong>Windows Azure Web Sites: </strong>Get started with the videos <a href="http://www.windowsazure.com/en-us/home/scenarios/web-sites/">here</a>, <a href="http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/intro-to-aspnet-mvc-4">build your first ASP .NET MVC web site</a> and <a href="http://www.bradygaster.com/solving-real-world-problems-with-windows-azure-web-sites">checkout some real world samples</a></li>
<li><strong>Windows Azure Media Services: </strong>Get started with the tutorials and resources in the <a href="http://www.windowsazure.com/en-us/develop/media-services/">Windows Azure Media Services dev portal</a>, checkout this <a href="http://channel9.msdn.com/Series/Windows-Azure-Media-Services-Tutorials">video series</a> and <a href="http://mingfeiy.com/">this blog</a></li>
<li><strong>Windows Azure SQL Database: </strong>Checkout <a href="http://www.windowsazure.com/en-us/develop/net/data/#header-2">these tutorials,</a><strong> </strong>I would start with this one - <a href="http://www.windowsazure.com/en-us/develop/net/tutorials/web-site-with-sql-database/">Create and deploy an ASP.NET web site and SQL Database with Visual Studio</a></li>
<li><strong>Node.js on Windows Azure:</strong> For a whole bunch of tutorials Checkout the<a href="http://www.windowsazure.com/en-us/develop/nodejs/">node.js developer center</a></li>
<li><strong>Windows Azure Storage: </strong>Checkout the great step-by-step <a href="http://www.windowsazure.com/en-us/develop/net/data/#header-1">tutorials here</a></li>
<li><strong>Windows Azure Service Bus: </strong>Checkout all the great <a href="http://www.windowsazure.com/en-us/develop/net/app-services/#header-4">tutorials here</a> and this <a href="http://channel9.msdn.com/Series/Windows-Azure-Service-Bus-Tutorials">video series</a></li>
<li><strong>Big Data: </strong>Get a jump start with this <a href="http://www.windowsazure.com/en-us/develop/net/data/#header-3">bunch of tutorials</a></li>
</ul>
</li>
<li><strong>Help?</strong>
<ul>
<li>For questions specific to the Imagine Cup competition (e.g passes, challenge rules etc) please use the <a href="http://compete.imaginecup.com/community/windows-azure-challenge">Imagine Cup Forum</a></li>
<li>For technical questions about Windows Azure post in the <a href="http://social.msdn.microsoft.com/Forums/en-US/category/windowsazureplatform">Windows Azure Forums</a> - we have a dedicated team of engineers answering questions from people all around the world!</li>
</ul>
</li>
</ul>
<p>Good luck and happy coding! Official rules for the Windows Azure Boost are <a href="http://compete.imaginecup.com/docs/rules/ic13-windows-azure-boost-award-rules-and-regulations.pdf?sfvrsn=2" target="_blank">here</a>.</p>
<p>Nick Harris | Imagine Cup Windows Azure Challenge Captain | <a href="http://www.twitter.com/cloudnick">@cloudnick</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2013/02/announcing-the-windows-azure-boost-for-imagine-cup/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Windows Azure Mobile Services Getting Started Content</title>
		<link>http://www.nickharris.net/2013/01/new-windows-azure-mobile-services-getting-started-content/</link>
		<comments>http://www.nickharris.net/2013/01/new-windows-azure-mobile-services-getting-started-content/#comments</comments>
		<pubDate>Fri, 11 Jan 2013 01:52:36 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[geolocator]]></category>
		<category><![CDATA[windows store app]]></category>
		<category><![CDATA[winrt]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1307</guid>
		<description><![CDATA[This post is a cross post of my post on the official Windows Azure Blog It’s been less than five months since we introduced the first public preview for Windows Azure Mobile Services and in this short time we have seen continual additions &#8230; <a href="http://www.nickharris.net/2013/01/new-windows-azure-mobile-services-getting-started-content/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This post is a cross post of my post on the official<strong> <a href="http://blogs.msdn.com/b/windowsazure/archive/2013/01/09/new-windows-azure-mobile-services-getting-started-content.aspx" target="_blank">Windows Azure Blog </a></strong></p>
<p>It’s been less than five months since we introduced the first public preview for <a href="http://www.windowsazure.com/mobile" target="_blank"><span>Windows Azure Mobile Services</span></a> and in this short time we have seen continual additions to the Mobile Service offering including:</p>
<ul>
<li>SDKs for Windows Store, Windows Phone 8 and iOS apps</li>
<li>Auth using Microsoft Account, Facebook, Google and Twitter</li>
<li>Push Notification support via WNS, MPNS and APNS</li>
<li>Structured storage</li>
<li>Scheduler to execute tasks on a schedule e.g aggregating feeds, sending notifications, crunching data</li>
<li>Deployment in North Europe, East and West US datacenters</li>
</ul>
<p>This post details wealth of new content we have recently released designed to help you get started with Windows Azure Mobile Services including <a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services" target="_blank"><span style="text-decoration: underline;">Videos</span></a>, <a href="http://www.windowsazure.com/en-us/develop/mobile/windows-store-samples/" target="_blank"><span style="text-decoration: underline;">Code Samples</span></a> and <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/" target="_blank"><span style="text-decoration: underline;">Tutorials</span></a>.</p>
<h1>New Videos</h1>
<p>We recently launched a new Windows Azure Mobile Services <a href="http://channel9.msdn.com/Series/" target="_blank"><span style="text-decoration: underline;">series</span></a> to help people get started with Mobile Services.  Through this series you will learn how Mobile Services can:</p>
<ul>
<li>Provide turnkey backend solutions that connect your mobile apps to the cloud within minutes</li>
<li>Store data off device and read it back into your apps</li>
<li>Add custom business logic utilizing server scripts</li>
<li>Implement user authentication in your apps using popular social identity providers such as Microsoft Account, Facebook, Twitter and Google.</li>
<li>Implement Push Notifications in your apps to keep your users up to date with your latest app content</li>
<li>Execute tasks on a schedule e.g aggregating feeds, sending notifications, crunching data etc.</li>
<li>Accelerate your mobile app development for Windows Store, Windows Phone 8 and iOS</li>
</ul>
<p>Here are some quick links to the current videos within the <a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services" target="_blank"><span style="text-decoration: underline;">series</span></a>:</p>
<table style="width: 520px;" border="0" cellspacing="5" cellpadding="0">
<tbody>
<tr>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Introduction-to-Windows-Azure-Mobile-Services/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Creating-your-first-app-using-the-Windows-Azure-Mobile-Services-Quickstart/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
<td valign="top" width="260"><strong>Scott Guthrie</strong></p>
<p><a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Introduction-to-Windows-Azure-Mobile-Services">Introduction to Windows Azure Mobile Services</a></td>
<td valign="top" width="260"><strong>Nick Harris</strong></p>
<p><a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Creating-your-first-app-using-the-Windows-Azure-Mobile-Services-Quickstart">Creating your first app using the Windows Azure Mobile Services Quick Start</a></td>
</tr>
<tr>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Getting-Started-with-Data-Connecting-your-app-to-Windows-Azure-Mobile-Services/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Validate-and-Modify-Data-with-Server-Scripts-in-Windows-Azure-Mobile-Services/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
<td valign="top" width="260"><strong>Nick Harris</strong></p>
<p><a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Getting-Started-with-Data-Connecting-your-app-to-Windows-Azure-Mobile-Services">Connecting your Windows Store app to Windows Azure Mobile Services</a></td>
<td valign="top" width="260"><strong>Nick Harris</strong></p>
<p><a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Validate-and-Modify-Data-with-Server-Scripts-in-Windows-Azure-Mobile-Services">Validate and Modify Data with Server Scripts in Windows Azure Mobile Services</a></td>
</tr>
<tr>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Getting-Started-with-Authentication-in-Windows-Azure-Mobile-Services/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Authenticate-and-Authorize-users-with-Server-Scripts-in-Windows-Azure-Mobile-Servi/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
<td valign="top" width="260"><strong>Nick Harris</strong></p>
<p><a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Getting-Started-with-Authentication-in-Windows-Azure-Mobile-Services">Getting Started with Authentication in Windows Azure Mobile Services</a></td>
<td valign="top" width="260"><strong>Nick Harris</strong><br />
<a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Authenticate-and-Authorize-users-with-Server-Scripts-in-Windows-Azure-Mobile-Servi">Authenticate and Authorize users with Server Scripts in Windows Azure Mobile Services</a></td>
</tr>
<tr>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Add-Push-Notifications-to-your-apps-with-Windows-Azure-Mobile-Services/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Getting-Started-with-the-Windows-Azure-Mobile-Services-Scheduler/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
<td valign="top" width="260"><strong>Nick Harris</strong><br />
<a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Add-Push-Notifications-to-your-apps-with-Windows-Azure-Mobile-Services">Add Push Notifications to your apps with Windows Azure Mobile Services</a></td>
<td valign="top" width="260"><strong>Nick Harris<br />
</strong><a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Getting-Started-with-the-Windows-Azure-Mobile-Services-Scheduler">Getting Started with the Windows Azure Mobile Services Scheduler</a></td>
</tr>
<tr>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/posts/iOS-Support-in-Windows-Azure-Mobile-Services/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
<td valign="top" width="260"><iframe style="width: 256px; height: 144px;" src="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/iOS-Creating-your-first-app-using-the-Windows-Azure-Mobile-Services-Quickstart/player?w=256&amp;h=144" height="240" width="320" frameborder="0" scrolling="no"></iframe></td>
</tr>
<tr>
<td valign="top" width="260"><strong>Josh Twist<br />
</strong><a href="http://channel9.msdn.com/posts/iOS-Support-in-Windows-Azure-Mobile-Services">iOS Support in Windows Azure Mobile Services</a></td>
<td valign="top" width="260"><strong>Chris Risner</strong><br />
<a href="http://go.microsoft.com/fwlink/?LinkId=275504">Creating your first iOS app with the Windows Azure Mobile Services Quick Start</a></td>
</tr>
</tbody>
</table>
<h1>New Code Samples</h1>
<p>In addition to the video series, we have released a number of code samples to the MSDN Code Gallery.  These samples demonstrate step-by-step how you can use the key functionality available within Windows Azure Mobile Services in your Windows Store apps.  Below is a list of the new code samples:</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/4643.a.png" target="_blank"><img style="vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/4643.a.png" width="321" height="200" /></a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Geolocation-sample-end-to-5d9ee245">Geolocation sample end to end using Windows Azure Mobile Services </a> <strong>(New)</strong></p>
<p>This sample provides an end to end location scenario with a Windows Store app using Bing Maps and a Windows Azure Mobile Services backend. It shows how to add places to the Map, store place coordinates in a Mobile Services table, and how to query for places near your location.</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/1346.a1.png"><img style="margin: 1px 5px; vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/1346.a1.png" width="350" height="233" /></a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Enqueue-and-Dequeue-e9429caa" target="_blank">Enqueue and Dequeue messages with Windows Azure Mobile<span style="text-decoration: underline;"> Services and Services Bus</span></a> <strong>(New)</strong></p>
<p>My Store &#8211; This sample demonstrates how you can enqueue and dequeue messages from your Windows Store apps into a Windows Azure Service Bus Queue via Windows Azure Mobile Services. This code sample builds out an ordering scenario with both a Sales and Storeroom and app.</p>
<p><span style="text-decoration: underline;"><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/7658.a2.png"><img style="margin: 1px 5px; vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/7658.a2.png" width="388" height="250" /></a></span></p>
<p><span style="text-decoration: underline;"> <a href="http://code.msdn.microsoft.com/Capture-Store-and-Email-34005240" target="_blank">Capture, Store and Email app Feedback using Windows Azure Mobile Services</a>  </span><strong>(New)</strong></p>
<p>This sample shows how you can implement a Feedback charm option in your Windows Store application and submit the feedback to be both stored Windows Azure Mobile Services and emailed directly to you.</p>
<p><span style="text-decoration: underline;"><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/2021.a4.png"><img style="margin: 1px 5px; vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/2021.a4.png" width="450" height="155" /></a> </span></p>
<p><span style="text-decoration: underline;"><a href="http://code.msdn.microsoft.com/windowsapps/Upload-File-to-Windows-c9169190" target="_blank">Upload File to Windows Azure Blob Storage using Windows Azure Mobile Services</a>  </span><strong>(New)</strong></p>
<p>This demonstrates how to store your files such as images, videos, docs or any binary data off device in the cloud using Windows Azure Blob Storage. In this example we focus on capturing and uploading images, with the same approach you can upload any binary data to Blob Storage.</p>
<p><span style="text-decoration: underline;"><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/0447.a3.png"><img style="vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/0447.a3.png" width="399" height="250" /></a> </span></p>
<p><span style="text-decoration: underline;"><a href="http://code.msdn.microsoft.com/windowsapps/Adding-a-Leaderboard-to-1f9d216d" target="_blank">Create a Game Leaderboard using Windows Azure Mobile Services</a> </span><strong>(New)</strong></p>
<p>The My Trivia sample demonstrates how you can easily add, update and view a leaderboard from your Windows Store applications using Windows Azure Mobile Services.</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/6014.a5.png"><img style="vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/6014.a5.png" width="446" height="250" /></a></p>
<p><span style="text-decoration: underline;"><a href="http://code.msdn.microsoft.com/windowsapps/Event-Buddy-ddafd9b6">Event Buddy Sample &#8211; Storage, Auth and Push Notifications with Mobile Services</a>  <strong>(New)</strong></span></p>
<p>In this sample you will start with a disconnected Windows Store app that manages events &amp; sessions. You will connect it to Windows Azure Mobile Service to provide structured storage, auth using Twitter or Facebook and push notifications.</p>
<p><span style="text-decoration: underline;"><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/3377.a6.png" target="_blank"><img style="margin: 1px 5px; vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/3377.a6.png" width="400" height="147" /></a> </span></p>
<p><span style="text-decoration: underline;"><a href="http://code.msdn.microsoft.com/windowsapps/Authenticate-Account-827dd37b" target="_blank">Authenticate Microsoft Account, Facebook, Twitter and Google w/ Mobile Services </a></span><strong>(New)</strong></p>
<p>This sample demonstrates how you can easily wire up your Windows Store application to require your users to Authenticate against well know social identity such as Microsoft Account, Facebook, Twitter and Google using Windows Azure Mobile Services.</p>
<p><span style="text-decoration: underline;"><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/8623.a7.jpg" target="_blank"><img style="margin: 1px 5px; vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/8623.a7.jpg" width="370" height="223" /></a> </span></p>
<p><span style="text-decoration: underline;"><a href="http://code.msdn.microsoft.com/Tile-Toast-and-Badge-Push-90ee6ff1" target="_blank">Tile, Toast and Badge Push Notifications using Windows Azure Mobile Services</a></span> <strong>(New)</strong></p>
<p>This sample demonstrates how you can easily register a channel in Windows Azure Mobile Services and then send different types of push notifications such as tile, toast and badge notifications from a server side script to your client application.</p>
<p><span style="text-decoration: underline;"><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/8765.a8.jpg" target="_blank"><img style="margin: 1px 5px; vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/8765.a8.jpg" width="471" height="250" /></a></span></p>
<p><span style="text-decoration: underline;"> <a href="http://code.msdn.microsoft.com/windowsapps/Raw-Notifications-using-adb63a01" target="_blank">Raw Notifications using Windows Azure Mobile Services </a></span><strong>(New)</strong></p>
<p>This sample demonstrates how you can easily send Raw push notifications to your Windows Store apps using Windows Azure Mobile Services.</p>
<p><a href="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/5661.a9.jpg"><img style="margin: 1px 5px; vertical-align: text-bottom;" alt="" src="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-13-25/5661.a9.jpg" width="288" height="250" /></a></p>
<p><a href="http://code.msdn.microsoft.com/windowsapps/Send-Push-Notifications-at-cd0ccd48" target="_blank"><span style="text-decoration: underline;">Send Push Notifications at Periodic Interval with the Mobile Services Scheduler</span></a> <strong>(New)</strong></p>
<p>This sample demonstrates how you can offload work from your Windows Store app to be processed on a scheduled basis using Windows Azure Mobile Services. It shows how to create a Scheduled Script that polls a feed and send a Push Notification to update the tile with latest news.</p>
<p>For a full list please see the new <a href="http://www.windowsazure.com/en-us/develop/mobile/windows-store-samples/" target="_blank"><span style="text-decoration: underline;">Code Sample Page on Windows Azure</span></a></p>
<h1>Tutorials</h1>
<p>There are a number of great step-by-step <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/" target="_blank"><span style="text-decoration: underline;">tutorials</span></a> that cover <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/#header-0" target="_blank"><span style="text-decoration: underline;">Getting Started</span></a>, <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/#header-1"><span style="text-decoration: underline;">Data</span></a>, <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/#header-2" target="_blank"><span style="text-decoration: underline;">Auth</span></a>, <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/#header-3" target="_blank"><span style="text-decoration: underline;">Push Notifications</span></a>, <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/#header-4" target="_blank"><span style="text-decoration: underline;">Services</span></a> and <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/#header-5" target="_blank"><span style="text-decoration: underline;">Tools</span></a>.  We recently added two new tutorials that demonstrate how to:</p>
<ul>
<li><a href="http://www.windowsazure.com/en-us/develop/mobile/tutorials/schedule-backend-tasks/" target="_blank"><span style="text-decoration: underline;">Schedule backend jobs using the Mobile Services Scheduler</span></a></li>
<li><a href="http://www.windowsazure.com/en-us/develop/mobile/tutorials/command-line-administration/" target="_blank"><span style="text-decoration: underline;">Automate mobile services with command-line tools</span></a></li>
</ul>
<p>These tutorials are available for Windows Store, Windows Phone 8, and iOS apps.</p>
<p>I hope this new content combined with our offer of 10 <a href="http://www.windowsazure.com/en-us/pricing/free-trial/" target="_blank"><span style="text-decoration: underline;">FREE</span></a> Mobile Services helps get you off to a flying start!  That’s all from me for now, if there is new content that you would like to see made available please feel free to <a href="http://www.twitter.com/cloudnick" target="_blank"><span style="text-decoration: underline;">reach out to me</span></a> with your suggestions.</p>
<p>As always, please visit our <a href="http://social.msdn.microsoft.com/Forums/en-US/azuremobile/threads" target="_blank">forum</a> if you have any questions and send any feedback to <a href="http://mce_host/controlpanel/blogs/posteditor.aspx/mailtto: mobileservices@microsoft.com" target="_blank">mobileservices@microsoft.com</a>.</p>
<p>Happy Coding!</p>
<p>Nick Harris<br />
<a href="http://www.twitter.com/cloudnick" target="_blank"><span style="text-decoration: underline;">@cloudnick</span></a> | <span style="text-decoration: underline;"><a href="http://www.nickharris.net/" target="_blank">Blog</a></span></p>
<div style="clear: both;"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2013/01/new-windows-azure-mobile-services-getting-started-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Execute Scheduled Scripts with the New Windows Azure Mobile Services Scheduler</title>
		<link>http://www.nickharris.net/2012/12/execute-scheduled-scripts-with-the-new-windows-azure-mobile-services-scheduler/</link>
		<comments>http://www.nickharris.net/2012/12/execute-scheduled-scripts-with-the-new-windows-azure-mobile-services-scheduler/#comments</comments>
		<pubDate>Sat, 22 Dec 2012 03:36:55 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Developers]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows 8 apps]]></category>
		<category><![CDATA[Windows Azure]]></category>
		<category><![CDATA[Windows Azure Mobile Services]]></category>
		<category><![CDATA[Windows Phone 8]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1295</guid>
		<description><![CDATA[In this post I will demonstrate how you can poll twitter on a scheduled basis for tweets directed at an alias and then use this information to send a Push Notification in the form of a Tile update.  But first lets &#8230; <a href="http://www.nickharris.net/2012/12/execute-scheduled-scripts-with-the-new-windows-azure-mobile-services-scheduler/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>In this post I will demonstrate how you can poll twitter on a scheduled basis for tweets directed at an alias and then use this information to send a Push Notification in the form of a Tile update.  But first lets talk about What&#8217;s new for Windows Azure Mobile Services</p>
<h1>What was Announced Today!</h1>
<p>Today, <a href="http://weblogs.asp.net/scottgu/archive/2012/12/21/great-updates-to-windows-azure-mobile-services-web-sites-sql-data-sync-acs-media-more.aspx">Scott Guthrie</a> announced  updates to <a href="http://www.windowsazure.com/en-us/develop/mobile/"><span style="text-decoration: underline;"><span style="color: #0000ff; font-size: medium;"><span style="color: #0000ff; font-size: medium;">Windows Azure Mobile Services</span></span></span></a><span style="font-size: medium;"> which allows developers to take advantage of the cloud to build and deploy modern apps for Windows 8 and iOS.  Whether you are a developer building for the Windows Store, Windows Phone 8, iPhone, or iPad, Mobile Services provides an easy, streamlined process for backend elements like storing structured data, configuring user authentication via Windows Live, Facebook, Twitter, and Google, and incorporating push notifications.</span></p>
<p>If you are building a mobile application Windows Azure Mobile Services can help in the following ways:</p>
<ul>
<li>Rapid Development: configure a straightforward and secure backend for Windows 8 and mobile applications in less than five minutes.</li>
<li>Create modern mobile app with built in support and new added capabilities:</li>
<li><strong>(NEW)</strong>Scheduled Scripts: run a server script on a pre-set schedule or on-demand which enables several key scenarios including:
<ul>
<li>aggregating data from Twitter, RSS feeds, or any external web services</li>
<li>executing background code efficiently, such as process/resize images, performing complex calculations, or sending emails</li>
<li>schedule sending push notifications to customers to ensure they arrive at the right time of day</li>
</ul>
</li>
<li><strong>(NEW)</strong> Command-line support: use the Windows Azure cross platform command line tools to easily create and manage mobile services</li>
<li><strong>(NEW)</strong> Availability in Europe: create Mobile Services in the North Europe region in addition to the US East and US West regions</li>
</ul>
<h1>Getting Started with Scheduled Scripts with the Windows Azure Mobile Services Scheduler</h1>
<p>In this section I will demonstrate how you can poll twitter on a scheduled basis for tweets directed at an alias and then use this information to send a Push Notification in the form of a Tile update.  This is a simplified version of Yavor&#8217;s post <a href="http://hashtagfail.com/post/38488024433/mobile-services-scheduler" target="_blank">here</a> - if you want to see how you can filter tweets and take this a bit further jump over to <a href="http://hashtagfail.com/post/38488024433/mobile-services-scheduler" target="_blank">Yavor&#8217;s blog</a> and check it out.</p>
<ol>
<ol>
<li>Create the scheduler job that will send push notifications to registered clients every 15 minutes with the latest Twitter updates for a particular twitter handle.<br />
<img class="alignnone" title="Mobile Services pic 1" alt="" src=" https://github.com/WindowsAzure-TrainingKit/HOL-Windows8AndMobileServices/blob/master/Images/image-38.png?raw=true" width="637" height="167" /></li>
<li>Specify a name for the job and make sure the schedule frequency is set to <strong>every 15 minutes</strong>. Click the check mark to create the job.</li>
</ol>
</ol>
<p style="padding-left: 30px;"><img class="alignnone" title="Mobile Services 2" alt="" src="https://github.com/WindowsAzure-TrainingKit/HOL-Windows8AndMobileServices/blob/master/Images/image-39.png?raw=true" width="587" height="438" /></p>
<ol>
<ol>
<li>Select the created job from the job list. <img class="alignnone" title="Mobile Services 3" alt="" src="https://github.com/WindowsAzure-TrainingKit/HOL-Windows8AndMobileServices/blob/master/Images/image-40.png?raw=true" width="930" height="141" /></li>
<li>Select the <strong>Script</strong> tab and paste the code snippet below that both polls Twitter and then composes a push notification to update your start screens tile using push.wns.*<br />
<div id="gist4357369" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-js-L1" rel="file-gistfile1-js-L1">1</span>
          <span class="line-number" id="file-gistfile1-js-L2" rel="file-gistfile1-js-L2">2</span>
          <span class="line-number" id="file-gistfile1-js-L3" rel="file-gistfile1-js-L3">3</span>
          <span class="line-number" id="file-gistfile1-js-L4" rel="file-gistfile1-js-L4">4</span>
          <span class="line-number" id="file-gistfile1-js-L5" rel="file-gistfile1-js-L5">5</span>
          <span class="line-number" id="file-gistfile1-js-L6" rel="file-gistfile1-js-L6">6</span>
          <span class="line-number" id="file-gistfile1-js-L7" rel="file-gistfile1-js-L7">7</span>
          <span class="line-number" id="file-gistfile1-js-L8" rel="file-gistfile1-js-L8">8</span>
          <span class="line-number" id="file-gistfile1-js-L9" rel="file-gistfile1-js-L9">9</span>
          <span class="line-number" id="file-gistfile1-js-L10" rel="file-gistfile1-js-L10">10</span>
          <span class="line-number" id="file-gistfile1-js-L11" rel="file-gistfile1-js-L11">11</span>
          <span class="line-number" id="file-gistfile1-js-L12" rel="file-gistfile1-js-L12">12</span>
          <span class="line-number" id="file-gistfile1-js-L13" rel="file-gistfile1-js-L13">13</span>
          <span class="line-number" id="file-gistfile1-js-L14" rel="file-gistfile1-js-L14">14</span>
          <span class="line-number" id="file-gistfile1-js-L15" rel="file-gistfile1-js-L15">15</span>
          <span class="line-number" id="file-gistfile1-js-L16" rel="file-gistfile1-js-L16">16</span>
          <span class="line-number" id="file-gistfile1-js-L17" rel="file-gistfile1-js-L17">17</span>
          <span class="line-number" id="file-gistfile1-js-L18" rel="file-gistfile1-js-L18">18</span>
          <span class="line-number" id="file-gistfile1-js-L19" rel="file-gistfile1-js-L19">19</span>
          <span class="line-number" id="file-gistfile1-js-L20" rel="file-gistfile1-js-L20">20</span>
          <span class="line-number" id="file-gistfile1-js-L21" rel="file-gistfile1-js-L21">21</span>
          <span class="line-number" id="file-gistfile1-js-L22" rel="file-gistfile1-js-L22">22</span>
          <span class="line-number" id="file-gistfile1-js-L23" rel="file-gistfile1-js-L23">23</span>
          <span class="line-number" id="file-gistfile1-js-L24" rel="file-gistfile1-js-L24">24</span>
          <span class="line-number" id="file-gistfile1-js-L25" rel="file-gistfile1-js-L25">25</span>
          <span class="line-number" id="file-gistfile1-js-L26" rel="file-gistfile1-js-L26">26</span>
          <span class="line-number" id="file-gistfile1-js-L27" rel="file-gistfile1-js-L27">27</span>
          <span class="line-number" id="file-gistfile1-js-L28" rel="file-gistfile1-js-L28">28</span>
          <span class="line-number" id="file-gistfile1-js-L29" rel="file-gistfile1-js-L29">29</span>
          <span class="line-number" id="file-gistfile1-js-L30" rel="file-gistfile1-js-L30">30</span>
          <span class="line-number" id="file-gistfile1-js-L31" rel="file-gistfile1-js-L31">31</span>
          <span class="line-number" id="file-gistfile1-js-L32" rel="file-gistfile1-js-L32">32</span>
          <span class="line-number" id="file-gistfile1-js-L33" rel="file-gistfile1-js-L33">33</span>
          <span class="line-number" id="file-gistfile1-js-L34" rel="file-gistfile1-js-L34">34</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-js-LC1"><span class="kd">function</span> <span class="nx">CheckFeed</span><span class="p">()</span> <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC2">     <span class="nx">getUpdatesAndNotify</span><span class="p">();</span></div><div class="line" id="file-gistfile1-js-LC3"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC4">&nbsp;</div><div class="line" id="file-gistfile1-js-LC5"><span class="kd">var</span> <span class="nx">request</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;request&#39;</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC6"><span class="kd">function</span> <span class="nx">getUpdatesAndNotify</span><span class="p">()</span> <span class="p">{</span>  </div><div class="line" id="file-gistfile1-js-LC7">     <span class="nx">request</span><span class="p">(</span><span class="s1">&#39;http://search.twitter.com/search.json?q=@cloudnick&amp;rpp=2&#39;</span><span class="p">,</span> </div><div class="line" id="file-gistfile1-js-LC8">      <span class="kd">function</span> <span class="nx">tweetsLoaded</span> <span class="p">(</span><span class="nx">error</span><span class="p">,</span> <span class="nx">response</span><span class="p">,</span> <span class="nx">body</span><span class="p">)</span> <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC9">          <span class="kd">var</span> <span class="nx">results</span> <span class="o">=</span> <span class="nx">JSON</span><span class="p">.</span><span class="nx">parse</span><span class="p">(</span><span class="nx">body</span><span class="p">).</span><span class="nx">results</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC10">          <span class="k">if</span><span class="p">(</span><span class="nx">results</span><span class="p">){</span></div><div class="line" id="file-gistfile1-js-LC11">                <span class="nx">results</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span> <span class="nx">visitResult</span><span class="p">(</span><span class="nx">tweet</span><span class="p">){</span></div><div class="line" id="file-gistfile1-js-LC12">                 <span class="nx">sendNotifications</span><span class="p">(</span><span class="nx">tweet</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC13">                <span class="p">});</span></div><div class="line" id="file-gistfile1-js-LC14">          <span class="p">}</span>            </div><div class="line" id="file-gistfile1-js-LC15">      <span class="p">});</span></div><div class="line" id="file-gistfile1-js-LC16"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC17">&nbsp;</div><div class="line" id="file-gistfile1-js-LC18"><span class="kd">function</span> <span class="nx">sendNotifications</span><span class="p">(</span><span class="nx">tweet</span><span class="p">){</span>    </div><div class="line" id="file-gistfile1-js-LC19">&nbsp;</div><div class="line" id="file-gistfile1-js-LC20"><span class="kd">var</span> <span class="nx">channelTable</span> <span class="o">=</span> <span class="nx">tables</span><span class="p">.</span><span class="nx">getTable</span><span class="p">(</span><span class="s1">&#39;Channel&#39;</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC21"><span class="nx">channelTable</span><span class="p">.</span><span class="nx">read</span><span class="p">({</span></div><div class="line" id="file-gistfile1-js-LC22">    <span class="nx">success</span><span class="o">:</span> <span class="kd">function</span><span class="p">(</span><span class="nx">channels</span><span class="p">)</span> <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC23">         <span class="nx">channels</span><span class="p">.</span><span class="nx">forEach</span><span class="p">(</span><span class="kd">function</span><span class="p">(</span><span class="nx">channel</span><span class="p">)</span> <span class="p">{</span>   </div><div class="line" id="file-gistfile1-js-LC24">&nbsp;</div><div class="line" id="file-gistfile1-js-LC25">              <span class="nx">push</span><span class="p">.</span><span class="nx">wns</span><span class="p">.</span><span class="nx">sendTileWideSmallImageAndText04</span><span class="p">(</span><span class="nx">channel</span><span class="p">.</span><span class="nx">uri</span><span class="p">,</span> <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC26">                    <span class="nx">image1src</span><span class="o">:</span> <span class="nx">tweet</span><span class="p">.</span><span class="nx">profile_image_url</span><span class="p">,</span>                            </div><div class="line" id="file-gistfile1-js-LC27">                    <span class="nx">text1</span><span class="o">:</span> <span class="s1">&#39;@&#39;</span> <span class="o">+</span> <span class="nx">tweet</span><span class="p">.</span><span class="nx">from_user</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC28">                    <span class="nx">text2</span><span class="o">:</span> <span class="nx">tweet</span><span class="p">.</span><span class="nx">text</span></div><div class="line" id="file-gistfile1-js-LC29">              <span class="p">});</span>                  </div><div class="line" id="file-gistfile1-js-LC30">&nbsp;</div><div class="line" id="file-gistfile1-js-LC31">         <span class="p">});</span></div><div class="line" id="file-gistfile1-js-LC32">    <span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC33"> <span class="p">});</span></div><div class="line" id="file-gistfile1-js-LC34"><span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/4357369/raw/a8a74943ada15e8c1e3a5483ffb4fc372af88cea/gistfile1.js" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/4357369#file-gistfile1-js" style="float:right; margin-right:10px; color:#666;">gistfile1.js</a>
          <a href="https://gist.github.com/nickharris/4357369">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>
</li>
<li>Once you paste the script into the editor, click the <strong>Save</strong> button to store the changes to the script. <img class="alignnone" title="Mobile Services 3" alt="" src="https://github.com/WindowsAzure-TrainingKit/HOL-Windows8AndMobileServices/blob/master/Images/image-41.png?raw=true" width="555" height="81" /></li>
<li>In Visual Studio, press <strong>F5</strong> to build and run the application.  This will ensure your channel URI is up to date and will ensure the Default Wide tile is now on your Start screen</li>
<li>Go back to the Windows Azure Management Portal, select the <strong>Scheduler</strong> tab of your mobile service, and then click <strong>Enable</strong> in the command bar to allow the job to run</li>
</ol>
</ol>
<p style="padding-left: 30px;">.<img class="alignnone" title="Mobile services 4" alt="" src="https://github.com/WindowsAzure-TrainingKit/HOL-Windows8AndMobileServices/blob/master/Images/image-42.png?raw=true" width="366" height="77" /></p>
<ol>
<li>To test your script immediately rather than wait 15 minutes for it to be scheduled, click <strong>Run Once</strong> in the command bar. <img class="alignnone" title="Mobile services 5" alt="" src="https://github.com/WindowsAzure-TrainingKit/HOL-Windows8AndMobileServices/blob/master/Images/image-43.png?raw=true" width="366" height="77" /></li>
<li>Return to the start screen and see the latest update on your application tile <img class="alignnone" title="Mobile Services 6" alt="" src="https://github.com/WindowsAzure-TrainingKit/HOL-Windows8AndMobileServices/blob/master/Images/image-44.png?raw=true" width="753" height="501" /></li>
</ol>
<h1>Summary</h1>
<p>In this post you learnt how you can use the Windows Azure Mobile Services Scheduler to execute scripts on a scheduled basis.  We used scheduled scripts to poll twitter every 15 minutes and send a push notification in the form of a Live Tile to our windows store apps with the latest tweets at an alias.</p>
<p>Here are some related resources you should checkout:</p>
<ul>
<li>Video: <a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Add-Push-Notifications-to-your-apps-with-Windows-Azure-Mobile-Services" target="_blank">Configuring Push Notifications in your Windows Store apps and Mobile Services</a></li>
<li>Video: <a href="http://channel9.msdn.com/Series/Windows-Azure-Mobile-Services/Windows-Store-app-Getting-Started-with-the-Windows-Azure-Mobile-Services-Scheduler" target="_blank">Getting Started with Scheduled Scripts using the Windows Azure Mobile Services Scheduler</a></li>
<li>Code Sample: <a href="http://code.msdn.microsoft.com/windowsapps/Send-Push-Notifications-at-cd0ccd48" target="_blank">Send Push Notifications at Periodic Interval with the Mobile Services Scheduler </a></li>
<li>This is a simplified version of Yavor&#8217;s post check out his more detailed scenario <a href="http://hashtagfail.com/post/38488024433/mobile-services-scheduler" target="_blank">here</a></li>
</ul>
<p>You can get started today with 10 Mobile Services for <a href="http://www.windowsazure.com/en-us/pricing/free-trial/">FREE</a></p>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/12/execute-scheduled-scripts-with-the-new-windows-azure-mobile-services-scheduler/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to upload an Image to Windows Azure Storage using Mobile Services</title>
		<link>http://www.nickharris.net/2012/11/how-to-upload-an-image-to-windows-azure-storage-using-mobile-services/</link>
		<comments>http://www.nickharris.net/2012/11/how-to-upload-an-image-to-windows-azure-storage-using-mobile-services/#comments</comments>
		<pubDate>Tue, 13 Nov 2012 02:25:46 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[CameraCaptureUI]]></category>
		<category><![CDATA[SAS]]></category>
		<category><![CDATA[Shared Access Signature]]></category>
		<category><![CDATA[Storage]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1256</guid>
		<description><![CDATA[This post details how to use the Windows Azure SDK for Node from Windows Azure Mobile Services to generate a Shared Access Signature (SAS) and then how to upload your Image (or any file) to Blob Storage directly from your Windows &#8230; <a href="http://www.nickharris.net/2012/11/how-to-upload-an-image-to-windows-azure-storage-using-mobile-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>This post details how to use the <a href="https://github.com/WindowsAzure/azure-sdk-for-node" target="_blank">Windows Azure SDK for Node</a> from <a href="http://www.windowsazure.com/mobile" target="_blank">Windows Azure Mobile Services</a> to generate a Shared Access Signature (SAS) and then how to upload your Image (or any file) to Blob Storage directly from your Windows Store App using the <a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2012/11/05/windows-azure-storage-client-library-for-windows-runtime.aspx" target="_blank">Windows Azure Storage Client Library 2.0 for Windows Runtime</a> (CTP)</p>
<p><strong>Background</strong></p>
<p>In my previous post <a href="http://www.nickharris.net/2012/09/windows-8-how-to-upload-an-image-using-a-blob-storage-sas-generated-by-windows-azure-mobile-services/">How to Upload an Image using a Blob Storage SAS generated by Windows Azure Mobile Services</a> I detailed:</p>
<ol>
<li>Why you should use a SAS to upload any binary data from client devices</li>
<li>How you could generate your own SAS using Mobile Services Server Side scripts</li>
<li>How you could use the HttpClient from a Windows Store app to upload your image using the SAS</li>
</ol>
<p>With the recent inclusion of the <a href="https://github.com/WindowsAzure/azure-sdk-for-node" target="_blank">Windows Azure SDK for Node</a> in Mobile Services and the announcement of the <a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2012/11/05/windows-azure-storage-client-library-for-windows-runtime.aspx" target="_blank">Windows Azure Storage Client Library 2.0 for Windows Runtime</a> (CTP) the process for performing Steps 2 and 3 are much easier.  This post will detail the updated approach.</p>
<h2>Creating your Mobile Service</h2>
<p>In this post I will extend the Mobile Services quick start sample. Before proceeding to the next section create a mobile service and download the quickstart as detailed in the tutorial <a title="here" href="http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started/" target="_blank">here</a></p>
<h2>Capturing the Image|Media</h2>
<p>Our first task is to capture the media we wish to upload. To do this follow the following steps.</p>
<ul>
<li>Add an AppBar to MainPage.xaml with a take photo button to allow us to capture the image</li>
</ul>
<div id="gist3785382" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1"><span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC2">    <span class="p">&lt;/</span><span class="n">Grid</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC3"><span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC4">    <span class="p">&lt;</span><span class="n">Page</span><span class="p">.</span><span class="n">BottomAppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC5">        <span class="p">&lt;</span><span class="n">AppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC6">            <span class="p">&lt;</span><span class="n">Button</span> <span class="n">Name</span><span class="p">=</span><span class="s">&quot;btnTakePhoto&quot;</span> <span class="n">Style</span><span class="p">=</span><span class="s">&quot;{StaticResource PhotoAppBarButtonStyle}&quot;</span></div><div class="line" id="file-gistfile1-cs-LC7">                    <span class="n">Click</span><span class="p">=</span><span class="s">&quot;OnTakePhotoClick&quot;</span> <span class="p">/&gt;</span></div><div class="line" id="file-gistfile1-cs-LC8">        <span class="p">&lt;/</span><span class="n">AppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC9">    <span class="p">&lt;/</span><span class="n">Page</span><span class="p">.</span><span class="n">BottomAppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC10"><span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC11"><span class="p">&lt;/</span><span class="n">Page</span><span class="p">&gt;</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/3785382/raw/d600a7efa466ed07162a844d74fe88e4ca754d91/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/3785382#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/3785382">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<ul>
<li>Add the OnTakePhotoClick handler and use the CameraCaptureUI class for taking photo and video</li>
</ul>
<div id="gist3785387" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1"><span class="k">using</span> <span class="nn">Windows.Media.Capture</span><span class="p">;</span></div><div class="line" id="file-gistfile1-cs-LC2">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC3">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC4"><span class="k">private</span> <span class="k">async</span> <span class="k">void</span> <span class="nf">OnTakePhotoClick</span><span class="p">(</span><span class="kt">object</span> <span class="n">sender</span><span class="p">,</span> <span class="n">RoutedEventArgs</span> <span class="n">e</span><span class="p">)</span></div><div class="line" id="file-gistfile1-cs-LC5"> <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC6"> <span class="c1">//Take photo or video</span></div><div class="line" id="file-gistfile1-cs-LC7"> <span class="n">CameraCaptureUI</span> <span class="n">cameraCapture</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CameraCaptureUI</span><span class="p">();</span></div><div class="line" id="file-gistfile1-cs-LC8"> <span class="n">StorageFile</span> <span class="n">media</span> <span class="p">=</span> <span class="k">await</span> <span class="n">cameraCapture</span><span class="p">.</span><span class="n">CaptureFileAsync</span><span class="p">(</span><span class="n">CameraCaptureUIMode</span><span class="p">.</span><span class="n">PhotoOrVideo</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC9">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC10">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC11"><span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/3785387/raw/e85da47e929910e45bfd03895c0563ee738b326e/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/3785387#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/3785387">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<ul>
<li>Update the TodoItem class with some properties that will be required to generate the SAS</li>
</ul>
<div id="gist4058313" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
          <span class="line-number" id="file-gistfile1-cs-L12" rel="file-gistfile1-cs-L12">12</span>
          <span class="line-number" id="file-gistfile1-cs-L13" rel="file-gistfile1-cs-L13">13</span>
          <span class="line-number" id="file-gistfile1-cs-L14" rel="file-gistfile1-cs-L14">14</span>
          <span class="line-number" id="file-gistfile1-cs-L15" rel="file-gistfile1-cs-L15">15</span>
          <span class="line-number" id="file-gistfile1-cs-L16" rel="file-gistfile1-cs-L16">16</span>
          <span class="line-number" id="file-gistfile1-cs-L17" rel="file-gistfile1-cs-L17">17</span>
          <span class="line-number" id="file-gistfile1-cs-L18" rel="file-gistfile1-cs-L18">18</span>
          <span class="line-number" id="file-gistfile1-cs-L19" rel="file-gistfile1-cs-L19">19</span>
          <span class="line-number" id="file-gistfile1-cs-L20" rel="file-gistfile1-cs-L20">20</span>
          <span class="line-number" id="file-gistfile1-cs-L21" rel="file-gistfile1-cs-L21">21</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1">    <span class="k">public</span> <span class="k">class</span> <span class="nc">TodoItem</span></div><div class="line" id="file-gistfile1-cs-LC2">    <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC3">        <span class="k">public</span> <span class="kt">int</span> <span class="n">Id</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC4">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC5"><span class="na">        [DataMember(Name = &quot;text&quot;)]</span></div><div class="line" id="file-gistfile1-cs-LC6">        <span class="k">public</span> <span class="kt">string</span> <span class="n">Text</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC7">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC8"><span class="na">        [DataMember(Name = &quot;complete&quot;)]</span></div><div class="line" id="file-gistfile1-cs-LC9">        <span class="k">public</span> <span class="kt">bool</span> <span class="n">Complete</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC10">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC11">        <span class="c1">//Added below for blob sas generation in Mobile Services</span></div><div class="line" id="file-gistfile1-cs-LC12">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC13"><span class="na">        [DataMember(Name = &quot;containerName&quot;)]</span></div><div class="line" id="file-gistfile1-cs-LC14">        <span class="k">public</span> <span class="kt">string</span> <span class="n">ContainerName</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC15">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC16"><span class="na">        [DataMember(Name = &quot;resourceName&quot;)]</span></div><div class="line" id="file-gistfile1-cs-LC17">        <span class="k">public</span> <span class="kt">string</span> <span class="n">ResourceName</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC18">        </div><div class="line" id="file-gistfile1-cs-LC19">        <span class="k">public</span> <span class="kt">string</span> <span class="n">SAS</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC20">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC21">    <span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/4058313/raw/03657de545f566a4c4ce74c68db72ed3c6f31996/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/4058313#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/4058313">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<ul>
<li>Update the OnTakePhotoClick handler to insert the todoitem setting the ContainerName and resourceName for which we want a SAS generated </li>
</ul>
<div id="gist4058358" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
          <span class="line-number" id="file-gistfile1-cs-L12" rel="file-gistfile1-cs-L12">12</span>
          <span class="line-number" id="file-gistfile1-cs-L13" rel="file-gistfile1-cs-L13">13</span>
          <span class="line-number" id="file-gistfile1-cs-L14" rel="file-gistfile1-cs-L14">14</span>
          <span class="line-number" id="file-gistfile1-cs-L15" rel="file-gistfile1-cs-L15">15</span>
          <span class="line-number" id="file-gistfile1-cs-L16" rel="file-gistfile1-cs-L16">16</span>
          <span class="line-number" id="file-gistfile1-cs-L17" rel="file-gistfile1-cs-L17">17</span>
          <span class="line-number" id="file-gistfile1-cs-L18" rel="file-gistfile1-cs-L18">18</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1"><span class="k">private</span> <span class="k">async</span> <span class="k">void</span> <span class="nf">OnTakePhotoClick</span><span class="p">(</span><span class="kt">object</span> <span class="n">sender</span><span class="p">,</span> <span class="n">RoutedEventArgs</span> <span class="n">e</span><span class="p">)</span></div><div class="line" id="file-gistfile1-cs-LC2"><span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC3">    <span class="c1">//Take photo or video</span></div><div class="line" id="file-gistfile1-cs-LC4">    <span class="n">CameraCaptureUI</span> <span class="n">cameraCapture</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CameraCaptureUI</span><span class="p">();</span></div><div class="line" id="file-gistfile1-cs-LC5">    <span class="n">StorageFile</span> <span class="n">media</span> <span class="p">=</span> <span class="k">await</span> <span class="n">cameraCapture</span><span class="p">.</span><span class="n">CaptureFileAsync</span><span class="p">(</span><span class="n">CameraCaptureUIMode</span><span class="p">.</span><span class="n">PhotoOrVideo</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC6">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC7">    <span class="c1">//add todo item to trigger insert operation which returns item.SAS</span></div><div class="line" id="file-gistfile1-cs-LC8">    <span class="kt">var</span> <span class="n">todoItem</span> <span class="p">=</span> <span class="k">new</span> <span class="n">TodoItem</span><span class="p">()</span> <span class="p">{</span>                     </div><div class="line" id="file-gistfile1-cs-LC9">            <span class="n">ContainerName</span> <span class="p">=</span> <span class="s">&quot;mypics&quot;</span><span class="p">,</span> </div><div class="line" id="file-gistfile1-cs-LC10">            <span class="n">ResourceName</span><span class="p">=</span> <span class="n">media</span><span class="p">.</span><span class="n">Name</span><span class="p">,</span></div><div class="line" id="file-gistfile1-cs-LC11">            <span class="n">Text</span> <span class="p">=</span> <span class="s">&quot;NA&quot;</span><span class="p">,</span> </div><div class="line" id="file-gistfile1-cs-LC12">    <span class="p">};</span></div><div class="line" id="file-gistfile1-cs-LC13">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC14">    <span class="k">await</span> <span class="n">todoTable</span><span class="p">.</span><span class="n">InsertAsync</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC15">    <span class="n">items</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC16">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC17">    <span class="c1">//TODO: Upload image direct to blob storage using SAS</span></div><div class="line" id="file-gistfile1-cs-LC18"><span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/4058358/raw/c5fbbb813e8225781ff9e3268e8acf0bcd52060b/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/4058358#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/4058358">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<h2>Generating a Shared Access Signature (SAS) using Mobile Services server-side script</h2>
<p>In this step we add sever-side script to generate a SAS on insert operation of the TodoItem table.</p>
<p>To do this perform the following steps:</p>
<ul>
<li>Navigate to your Mobile Service and select the Data Tab, then click on Todoitem</li>
</ul>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices1.png"><img class="alignleft size-full wp-image-1210" title="MobileServices1" src="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices1.png" alt="" width="961" height="308" /></a></p>
<ul>
<li>Select Script, then the Insert drop down</li>
</ul>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices2.png"><img class="alignleft size-full wp-image-1211" title="MobileServices2" src="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices2.png" alt="" width="962" height="322" /></a></p>
<ul>
<li>Add the following server side script to create the containerName and generate a blob SAS for the resourceName</li>
</ul>
<div id="gist4063605" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-js-L1" rel="file-gistfile1-js-L1">1</span>
          <span class="line-number" id="file-gistfile1-js-L2" rel="file-gistfile1-js-L2">2</span>
          <span class="line-number" id="file-gistfile1-js-L3" rel="file-gistfile1-js-L3">3</span>
          <span class="line-number" id="file-gistfile1-js-L4" rel="file-gistfile1-js-L4">4</span>
          <span class="line-number" id="file-gistfile1-js-L5" rel="file-gistfile1-js-L5">5</span>
          <span class="line-number" id="file-gistfile1-js-L6" rel="file-gistfile1-js-L6">6</span>
          <span class="line-number" id="file-gistfile1-js-L7" rel="file-gistfile1-js-L7">7</span>
          <span class="line-number" id="file-gistfile1-js-L8" rel="file-gistfile1-js-L8">8</span>
          <span class="line-number" id="file-gistfile1-js-L9" rel="file-gistfile1-js-L9">9</span>
          <span class="line-number" id="file-gistfile1-js-L10" rel="file-gistfile1-js-L10">10</span>
          <span class="line-number" id="file-gistfile1-js-L11" rel="file-gistfile1-js-L11">11</span>
          <span class="line-number" id="file-gistfile1-js-L12" rel="file-gistfile1-js-L12">12</span>
          <span class="line-number" id="file-gistfile1-js-L13" rel="file-gistfile1-js-L13">13</span>
          <span class="line-number" id="file-gistfile1-js-L14" rel="file-gistfile1-js-L14">14</span>
          <span class="line-number" id="file-gistfile1-js-L15" rel="file-gistfile1-js-L15">15</span>
          <span class="line-number" id="file-gistfile1-js-L16" rel="file-gistfile1-js-L16">16</span>
          <span class="line-number" id="file-gistfile1-js-L17" rel="file-gistfile1-js-L17">17</span>
          <span class="line-number" id="file-gistfile1-js-L18" rel="file-gistfile1-js-L18">18</span>
          <span class="line-number" id="file-gistfile1-js-L19" rel="file-gistfile1-js-L19">19</span>
          <span class="line-number" id="file-gistfile1-js-L20" rel="file-gistfile1-js-L20">20</span>
          <span class="line-number" id="file-gistfile1-js-L21" rel="file-gistfile1-js-L21">21</span>
          <span class="line-number" id="file-gistfile1-js-L22" rel="file-gistfile1-js-L22">22</span>
          <span class="line-number" id="file-gistfile1-js-L23" rel="file-gistfile1-js-L23">23</span>
          <span class="line-number" id="file-gistfile1-js-L24" rel="file-gistfile1-js-L24">24</span>
          <span class="line-number" id="file-gistfile1-js-L25" rel="file-gistfile1-js-L25">25</span>
          <span class="line-number" id="file-gistfile1-js-L26" rel="file-gistfile1-js-L26">26</span>
          <span class="line-number" id="file-gistfile1-js-L27" rel="file-gistfile1-js-L27">27</span>
          <span class="line-number" id="file-gistfile1-js-L28" rel="file-gistfile1-js-L28">28</span>
          <span class="line-number" id="file-gistfile1-js-L29" rel="file-gistfile1-js-L29">29</span>
          <span class="line-number" id="file-gistfile1-js-L30" rel="file-gistfile1-js-L30">30</span>
          <span class="line-number" id="file-gistfile1-js-L31" rel="file-gistfile1-js-L31">31</span>
          <span class="line-number" id="file-gistfile1-js-L32" rel="file-gistfile1-js-L32">32</span>
          <span class="line-number" id="file-gistfile1-js-L33" rel="file-gistfile1-js-L33">33</span>
          <span class="line-number" id="file-gistfile1-js-L34" rel="file-gistfile1-js-L34">34</span>
          <span class="line-number" id="file-gistfile1-js-L35" rel="file-gistfile1-js-L35">35</span>
          <span class="line-number" id="file-gistfile1-js-L36" rel="file-gistfile1-js-L36">36</span>
          <span class="line-number" id="file-gistfile1-js-L37" rel="file-gistfile1-js-L37">37</span>
          <span class="line-number" id="file-gistfile1-js-L38" rel="file-gistfile1-js-L38">38</span>
          <span class="line-number" id="file-gistfile1-js-L39" rel="file-gistfile1-js-L39">39</span>
          <span class="line-number" id="file-gistfile1-js-L40" rel="file-gistfile1-js-L40">40</span>
          <span class="line-number" id="file-gistfile1-js-L41" rel="file-gistfile1-js-L41">41</span>
          <span class="line-number" id="file-gistfile1-js-L42" rel="file-gistfile1-js-L42">42</span>
          <span class="line-number" id="file-gistfile1-js-L43" rel="file-gistfile1-js-L43">43</span>
          <span class="line-number" id="file-gistfile1-js-L44" rel="file-gistfile1-js-L44">44</span>
          <span class="line-number" id="file-gistfile1-js-L45" rel="file-gistfile1-js-L45">45</span>
          <span class="line-number" id="file-gistfile1-js-L46" rel="file-gistfile1-js-L46">46</span>
          <span class="line-number" id="file-gistfile1-js-L47" rel="file-gistfile1-js-L47">47</span>
          <span class="line-number" id="file-gistfile1-js-L48" rel="file-gistfile1-js-L48">48</span>
          <span class="line-number" id="file-gistfile1-js-L49" rel="file-gistfile1-js-L49">49</span>
          <span class="line-number" id="file-gistfile1-js-L50" rel="file-gistfile1-js-L50">50</span>
          <span class="line-number" id="file-gistfile1-js-L51" rel="file-gistfile1-js-L51">51</span>
          <span class="line-number" id="file-gistfile1-js-L52" rel="file-gistfile1-js-L52">52</span>
          <span class="line-number" id="file-gistfile1-js-L53" rel="file-gistfile1-js-L53">53</span>
          <span class="line-number" id="file-gistfile1-js-L54" rel="file-gistfile1-js-L54">54</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-js-LC1"><span class="kd">var</span> <span class="nx">azure</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;azure&#39;</span><span class="p">);</span> </div><div class="line" id="file-gistfile1-js-LC2"><span class="kd">var</span> <span class="nx">qs</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;querystring&#39;</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC3">&nbsp;</div><div class="line" id="file-gistfile1-js-LC4"><span class="kd">function</span> <span class="nx">insert</span><span class="p">(</span><span class="nx">item</span><span class="p">,</span> <span class="nx">user</span><span class="p">,</span> <span class="nx">request</span><span class="p">)</span> <span class="p">{</span>  </div><div class="line" id="file-gistfile1-js-LC5">        <span class="kd">var</span> <span class="nx">accountName</span> <span class="o">=</span> <span class="s1">&#39;&lt;replace with your storage account name&gt;&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC6">        <span class="kd">var</span> <span class="nx">accountKey</span> <span class="o">=</span> <span class="s1">&#39;&lt;replace with your storage account key&gt;&#39;</span><span class="p">;</span>         </div><div class="line" id="file-gistfile1-js-LC7">        <span class="kd">var</span> <span class="nx">host</span> <span class="o">=</span>   <span class="nx">accountName</span> <span class="o">+</span> <span class="s1">&#39;.blob.core.windows.net&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC8">        <span class="kd">var</span> <span class="nx">canonicalizedResource</span> <span class="o">=</span> <span class="s1">&#39;/&#39;</span> <span class="o">+</span>  <span class="nx">item</span><span class="p">.</span><span class="nx">containerName</span> <span class="o">+</span> <span class="s1">&#39;/&#39;</span> <span class="o">+</span> <span class="nx">item</span><span class="p">.</span><span class="nx">resourceName</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC9">        <span class="c1">//Must be lowercase</span></div><div class="line" id="file-gistfile1-js-LC10">        <span class="nx">item</span><span class="p">.</span><span class="nx">containerName</span> <span class="o">=</span> <span class="nx">item</span><span class="p">.</span><span class="nx">containerName</span><span class="p">.</span><span class="nx">toLowerCase</span><span class="p">();</span></div><div class="line" id="file-gistfile1-js-LC11">        </div><div class="line" id="file-gistfile1-js-LC12">        <span class="c1">//Create the container if it does not exist</span></div><div class="line" id="file-gistfile1-js-LC13">        <span class="c1">//we will use public read access for the blobs and will use a SAS to upload        </span></div><div class="line" id="file-gistfile1-js-LC14">        <span class="kd">var</span> <span class="nx">blobService</span> <span class="o">=</span> <span class="nx">azure</span><span class="p">.</span><span class="nx">createBlobService</span><span class="p">(</span><span class="nx">accountName</span><span class="p">,</span> <span class="nx">accountKey</span><span class="p">,</span> <span class="nx">host</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC15">        <span class="nx">blobService</span><span class="p">.</span><span class="nx">createContainerIfNotExists</span><span class="p">(</span><span class="nx">item</span><span class="p">.</span><span class="nx">containerName</span><span class="p">,</span> <span class="p">{</span><span class="nx">publicAccessLevel</span> <span class="o">:</span> <span class="s1">&#39;blob&#39;</span><span class="p">},</span> <span class="kd">function</span><span class="p">(</span><span class="nx">error</span><span class="p">){</span>            </div><div class="line" id="file-gistfile1-js-LC16">            <span class="k">if</span><span class="p">(</span><span class="o">!</span><span class="nx">error</span><span class="p">){</span></div><div class="line" id="file-gistfile1-js-LC17">                <span class="c1">// Container exists now define a policy that provides write access                      </span></div><div class="line" id="file-gistfile1-js-LC18">                <span class="c1">// that starts immediately and expires in 5 mins        </span></div><div class="line" id="file-gistfile1-js-LC19">                <span class="kd">var</span> <span class="nx">sharedAccessPolicy</span> <span class="o">=</span> <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC20">                  <span class="nx">AccessPolicy</span><span class="o">:</span><span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC21">                        <span class="nx">Permissions</span><span class="o">:</span> <span class="nx">azure</span><span class="p">.</span><span class="nx">Constants</span><span class="p">.</span><span class="nx">BlobConstants</span><span class="p">.</span><span class="nx">SharedAccessPermissions</span><span class="p">.</span><span class="nx">WRITE</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC22">                        <span class="c1">//Start: //use for start time in future, beware of server time skew </span></div><div class="line" id="file-gistfile1-js-LC23">                        <span class="nx">Expiry</span><span class="o">:</span> <span class="nx">formatDate</span><span class="p">(</span><span class="k">new</span> <span class="nb">Date</span><span class="p">(</span><span class="k">new</span> <span class="nb">Date</span><span class="p">().</span><span class="nx">getTime</span><span class="p">()</span> <span class="o">+</span> <span class="mi">5</span> <span class="o">*</span> <span class="mi">60</span> <span class="o">*</span> <span class="mi">1000</span><span class="p">))</span> <span class="c1">//5 minutes from now</span></div><div class="line" id="file-gistfile1-js-LC24">                    <span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC25">                <span class="p">};</span></div><div class="line" id="file-gistfile1-js-LC26">                </div><div class="line" id="file-gistfile1-js-LC27">                <span class="c1">//Generate the SAS for your BLOB</span></div><div class="line" id="file-gistfile1-js-LC28">                <span class="kd">var</span> <span class="nx">sasQueryString</span> <span class="o">=</span> <span class="nx">getSAS</span><span class="p">(</span><span class="nx">accountName</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC29">                                  <span class="nx">accountKey</span><span class="p">,</span> </div><div class="line" id="file-gistfile1-js-LC30">                                  <span class="nx">canonicalizedResource</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC31">                                  <span class="nx">azure</span><span class="p">.</span><span class="nx">Constants</span><span class="p">.</span><span class="nx">BlobConstants</span><span class="p">.</span><span class="nx">ResourceTypes</span><span class="p">.</span><span class="nx">BLOB</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC32">                                  <span class="nx">sharedAccessPolicy</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC33">                </div><div class="line" id="file-gistfile1-js-LC34">                <span class="c1">//full path for resource with sas</span></div><div class="line" id="file-gistfile1-js-LC35">                <span class="nx">item</span><span class="p">.</span><span class="nx">sas</span> <span class="o">=</span>  <span class="s1">&#39;https://&#39;</span> <span class="o">+</span> <span class="nx">host</span> <span class="o">+</span> <span class="nx">canonicalizedResource</span> <span class="o">+</span> <span class="s1">&#39;?&#39;</span> <span class="o">+</span> <span class="nx">sasQueryString</span><span class="p">;</span>                                         </div><div class="line" id="file-gistfile1-js-LC36">            <span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC37">            <span class="k">else</span><span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC38">                <span class="nx">console</span><span class="p">.</span><span class="nx">error</span><span class="p">(</span><span class="nx">error</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC39">            <span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC40">            </div><div class="line" id="file-gistfile1-js-LC41">            <span class="nx">request</span><span class="p">.</span><span class="nx">execute</span><span class="p">();</span></div><div class="line" id="file-gistfile1-js-LC42">        <span class="p">});</span>                       </div><div class="line" id="file-gistfile1-js-LC43"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC44">&nbsp;</div><div class="line" id="file-gistfile1-js-LC45"><span class="kd">function</span> <span class="nx">getSAS</span><span class="p">(</span><span class="nx">accountName</span><span class="p">,</span> <span class="nx">accountKey</span><span class="p">,</span> <span class="nx">path</span><span class="p">,</span> <span class="nx">resourceType</span><span class="p">,</span> <span class="nx">sharedAccessPolicy</span><span class="p">)</span> <span class="p">{</span>                         </div><div class="line" id="file-gistfile1-js-LC46">     <span class="k">return</span> <span class="nx">qs</span><span class="p">.</span><span class="nx">encode</span><span class="p">(</span><span class="k">new</span> <span class="nx">azure</span><span class="p">.</span><span class="nx">SharedAccessSignature</span><span class="p">(</span><span class="nx">accountName</span><span class="p">,</span> <span class="nx">accountKey</span><span class="p">)</span></div><div class="line" id="file-gistfile1-js-LC47">                                    <span class="p">.</span><span class="nx">generateSignedQueryString</span><span class="p">(</span><span class="nx">path</span><span class="p">,</span> <span class="p">{},</span> <span class="nx">resourceType</span><span class="p">,</span> <span class="nx">sharedAccessPolicy</span><span class="p">));</span>                           </div><div class="line" id="file-gistfile1-js-LC48"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC49">&nbsp;</div><div class="line" id="file-gistfile1-js-LC50"><span class="kd">function</span> <span class="nx">formatDate</span><span class="p">(</span><span class="nx">date</span><span class="p">){</span> </div><div class="line" id="file-gistfile1-js-LC51">        <span class="kd">var</span> <span class="nx">raw</span> <span class="o">=</span> <span class="nx">date</span><span class="p">.</span><span class="nx">toJSON</span><span class="p">();</span></div><div class="line" id="file-gistfile1-js-LC52">        <span class="c1">//blob service does not like milliseconds on the end of the time so strip</span></div><div class="line" id="file-gistfile1-js-LC53">        <span class="k">return</span> <span class="nx">raw</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">raw</span><span class="p">.</span><span class="nx">lastIndexOf</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">))</span> <span class="o">+</span> <span class="s1">&#39;Z&#39;</span><span class="p">;</span> </div><div class="line" id="file-gistfile1-js-LC54"><span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/4063605/raw/d825fbea00932683000fa71dbd159ca4f1225eb1/gistfile1.js" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/4063605#file-gistfile1-js" style="float:right; margin-right:10px; color:#666;">gistfile1.js</a>
          <a href="https://gist.github.com/nickharris/4063605">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<h2>Using the <a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2012/11/05/windows-azure-storage-client-library-for-windows-runtime.aspx" target="_blank">Windows Azure Storage Client Library 2.0 for Windows Runtime</a> (CTP) to upload the Image directly to storage using the SAS</h2>
<ul>
<li>Download the Storage Client libraries for Windows 8 click <a href="https://github.com/downloads/WindowsAzure/azure-sdk-downloads/Microsoft.WindowsAzure.Storage-for-win8.v1.8.zip" target="_blank">here</a>.</li>
<li>Extract and add a reference to Microsoft.WindowsAzure.Storage.winmd your client project</li>
<li>Update OnTakePhotoClick handler to update the image directly to blob storage using the CloudBlockBlob,UploadFromStreamAsync and the generated todoitem.SAS</li>
</ul>
<div id="gist4063407" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
          <span class="line-number" id="file-gistfile1-cs-L12" rel="file-gistfile1-cs-L12">12</span>
          <span class="line-number" id="file-gistfile1-cs-L13" rel="file-gistfile1-cs-L13">13</span>
          <span class="line-number" id="file-gistfile1-cs-L14" rel="file-gistfile1-cs-L14">14</span>
          <span class="line-number" id="file-gistfile1-cs-L15" rel="file-gistfile1-cs-L15">15</span>
          <span class="line-number" id="file-gistfile1-cs-L16" rel="file-gistfile1-cs-L16">16</span>
          <span class="line-number" id="file-gistfile1-cs-L17" rel="file-gistfile1-cs-L17">17</span>
          <span class="line-number" id="file-gistfile1-cs-L18" rel="file-gistfile1-cs-L18">18</span>
          <span class="line-number" id="file-gistfile1-cs-L19" rel="file-gistfile1-cs-L19">19</span>
          <span class="line-number" id="file-gistfile1-cs-L20" rel="file-gistfile1-cs-L20">20</span>
          <span class="line-number" id="file-gistfile1-cs-L21" rel="file-gistfile1-cs-L21">21</span>
          <span class="line-number" id="file-gistfile1-cs-L22" rel="file-gistfile1-cs-L22">22</span>
          <span class="line-number" id="file-gistfile1-cs-L23" rel="file-gistfile1-cs-L23">23</span>
          <span class="line-number" id="file-gistfile1-cs-L24" rel="file-gistfile1-cs-L24">24</span>
          <span class="line-number" id="file-gistfile1-cs-L25" rel="file-gistfile1-cs-L25">25</span>
          <span class="line-number" id="file-gistfile1-cs-L26" rel="file-gistfile1-cs-L26">26</span>
          <span class="line-number" id="file-gistfile1-cs-L27" rel="file-gistfile1-cs-L27">27</span>
          <span class="line-number" id="file-gistfile1-cs-L28" rel="file-gistfile1-cs-L28">28</span>
          <span class="line-number" id="file-gistfile1-cs-L29" rel="file-gistfile1-cs-L29">29</span>
          <span class="line-number" id="file-gistfile1-cs-L30" rel="file-gistfile1-cs-L30">30</span>
          <span class="line-number" id="file-gistfile1-cs-L31" rel="file-gistfile1-cs-L31">31</span>
          <span class="line-number" id="file-gistfile1-cs-L32" rel="file-gistfile1-cs-L32">32</span>
          <span class="line-number" id="file-gistfile1-cs-L33" rel="file-gistfile1-cs-L33">33</span>
          <span class="line-number" id="file-gistfile1-cs-L34" rel="file-gistfile1-cs-L34">34</span>
          <span class="line-number" id="file-gistfile1-cs-L35" rel="file-gistfile1-cs-L35">35</span>
          <span class="line-number" id="file-gistfile1-cs-L36" rel="file-gistfile1-cs-L36">36</span>
          <span class="line-number" id="file-gistfile1-cs-L37" rel="file-gistfile1-cs-L37">37</span>
          <span class="line-number" id="file-gistfile1-cs-L38" rel="file-gistfile1-cs-L38">38</span>
          <span class="line-number" id="file-gistfile1-cs-L39" rel="file-gistfile1-cs-L39">39</span>
          <span class="line-number" id="file-gistfile1-cs-L40" rel="file-gistfile1-cs-L40">40</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1">        <span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC2">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC3">        <span class="k">using</span> <span class="nn">Microsoft.WindowsAzure.Storage.Auth</span><span class="p">;</span></div><div class="line" id="file-gistfile1-cs-LC4">        <span class="k">using</span> <span class="nn">Microsoft.WindowsAzure.Storage.Blob</span><span class="p">;</span>               </div><div class="line" id="file-gistfile1-cs-LC5">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC6">        <span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC7">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC8">        <span class="k">private</span> <span class="k">async</span> <span class="k">void</span> <span class="nf">OnTakePhotoClick</span><span class="p">(</span><span class="kt">object</span> <span class="n">sender</span><span class="p">,</span> <span class="n">RoutedEventArgs</span> <span class="n">e</span><span class="p">)</span></div><div class="line" id="file-gistfile1-cs-LC9">        <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC10">            <span class="c1">//Take photo or video</span></div><div class="line" id="file-gistfile1-cs-LC11">            <span class="n">CameraCaptureUI</span> <span class="n">cameraCapture</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CameraCaptureUI</span><span class="p">();</span></div><div class="line" id="file-gistfile1-cs-LC12">            <span class="n">StorageFile</span> <span class="n">media</span> <span class="p">=</span> <span class="k">await</span> <span class="n">cameraCapture</span><span class="p">.</span><span class="n">CaptureFileAsync</span><span class="p">(</span><span class="n">CameraCaptureUIMode</span><span class="p">.</span><span class="n">PhotoOrVideo</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC13">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC14">            <span class="k">if</span> <span class="p">(</span><span class="n">media</span> <span class="p">!=</span> <span class="k">null</span><span class="p">)</span></div><div class="line" id="file-gistfile1-cs-LC15">            <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC16">                <span class="c1">//add todo item to trigger insert operation which returns item.SAS</span></div><div class="line" id="file-gistfile1-cs-LC17">                <span class="kt">var</span> <span class="n">todoItem</span> <span class="p">=</span> <span class="k">new</span> <span class="n">TodoItem</span><span class="p">()</span></div><div class="line" id="file-gistfile1-cs-LC18">                <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC19">                    <span class="n">ContainerName</span> <span class="p">=</span> <span class="s">&quot;mypics&quot;</span><span class="p">,</span></div><div class="line" id="file-gistfile1-cs-LC20">                    <span class="n">ResourceName</span> <span class="p">=</span> <span class="n">media</span><span class="p">.</span><span class="n">Name</span><span class="p">,</span></div><div class="line" id="file-gistfile1-cs-LC21">                    <span class="n">Text</span> <span class="p">=</span> <span class="s">&quot;NA&quot;</span><span class="p">,</span></div><div class="line" id="file-gistfile1-cs-LC22">                <span class="p">};</span></div><div class="line" id="file-gistfile1-cs-LC23">                <span class="k">await</span> <span class="n">todoTable</span><span class="p">.</span><span class="n">InsertAsync</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC24">                <span class="n">items</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC25">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC26">                <span class="c1">//Upload image direct to blob storage using SAS and the Storage Client library for Windows CTP</span></div><div class="line" id="file-gistfile1-cs-LC27">                <span class="c1">//Get a stream of the image just taken</span></div><div class="line" id="file-gistfile1-cs-LC28">                <span class="k">using</span> <span class="p">(</span><span class="kt">var</span> <span class="n">fileStream</span> <span class="p">=</span> <span class="k">await</span> <span class="n">media</span><span class="p">.</span><span class="n">OpenStreamForReadAsync</span><span class="p">())</span></div><div class="line" id="file-gistfile1-cs-LC29">                <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC30">                    <span class="kt">var</span> <span class="n">sasUri</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Uri</span><span class="p">(</span><span class="n">todoItem</span><span class="p">.</span><span class="n">SAS</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC31">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC32">                    <span class="c1">//Our credential for the upload is our SAS token</span></div><div class="line" id="file-gistfile1-cs-LC33">                    <span class="n">StorageCredentials</span> <span class="n">cred</span> <span class="p">=</span> <span class="k">new</span> <span class="n">StorageCredentials</span><span class="p">(</span><span class="n">sasUri</span><span class="p">.</span><span class="n">Query</span><span class="p">.</span><span class="n">Substring</span><span class="p">(</span><span class="m">1</span><span class="p">));</span></div><div class="line" id="file-gistfile1-cs-LC34"> </div><div class="line" id="file-gistfile1-cs-LC35">                    <span class="n">CloudBlobContainer</span> <span class="n">container</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CloudBlobContainer</span><span class="p">(</span><span class="k">new</span> <span class="n">Uri</span><span class="p">(</span><span class="kt">string</span><span class="p">.</span><span class="n">Format</span><span class="p">(</span><span class="s">&quot;https://{0}/{1}&quot;</span><span class="p">,</span> <span class="n">sasUri</span><span class="p">.</span><span class="n">Host</span><span class="p">,</span> <span class="n">todoItem</span><span class="p">.</span><span class="n">ContainerName</span><span class="p">)),</span> <span class="n">cred</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC36">                    <span class="n">CloudBlockBlob</span> <span class="n">blobFromSASCredential</span> <span class="p">=</span> <span class="n">container</span><span class="p">.</span><span class="n">GetBlockBlobReference</span><span class="p">(</span><span class="n">todoItem</span><span class="p">.</span><span class="n">ResourceName</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC37">                    <span class="k">await</span> <span class="n">blobFromSASCredential</span><span class="p">.</span><span class="n">UploadFromStreamAsync</span><span class="p">(</span><span class="n">fileStream</span><span class="p">.</span><span class="n">AsInputStream</span><span class="p">());</span></div><div class="line" id="file-gistfile1-cs-LC38">                <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC39">            <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC40">        <span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/4063407/raw/00786d688cfce6c6d7f5352f74cfa00963c714f2/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/4063407#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/4063407">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<h2>Run the application</h2>
<ul>
<li>Hit F5 on the application and right click with your mouse to show the app bar</li>
<li>Press the Take Photo button</li>
<li>Observe that the SAS is returned from your Mobile Service</li>
</ul>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/11/sas.png"><img src="http://www.nickharris.net/wp-content/uploads/2012/11/sas-1024x492.png" alt="" title="sas" width="584" height="280" class="alignleft size-large wp-image-1267" /></a> </p>
<ul>
<li>Check your storage account now has a great picture of a fully polished chrome dome capable of reflecting light far better then your average mirror <img src='http://www.nickharris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ul>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/11/chromedome.png"><img src="http://www.nickharris.net/wp-content/uploads/2012/11/chromedome-1024x486.png" alt="" title="chromedome" width="584" height="277" class="alignleft size-large wp-image-1268" /></a></p>
<p>Enjoy,<br />
Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/11/how-to-upload-an-image-to-windows-azure-storage-using-mobile-services/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Blog Series: Sending Windows 8 Push Notifications using Windows Azure Mobile Services</title>
		<link>http://www.nickharris.net/2012/10/blog-series-sending-windows-8-push-notifications-using-windows-azure-mobile-services/</link>
		<comments>http://www.nickharris.net/2012/10/blog-series-sending-windows-8-push-notifications-using-windows-azure-mobile-services/#comments</comments>
		<pubDate>Thu, 04 Oct 2012 23:01:09 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[notifications]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1240</guid>
		<description><![CDATA[Sending Windows 8 Push Notifications using Windows Azure Mobile Services Recently we announced the preview of Windows Azure Mobile Services. In this blog series I will detail how to build a Windows Azure Mobile Service to send push notifications of varying types to &#8230; <a href="http://www.nickharris.net/2012/10/blog-series-sending-windows-8-push-notifications-using-windows-azure-mobile-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<h1>Sending Windows 8 Push Notifications using Windows Azure Mobile Services</h1>
<p>Recently we announced the preview of <a href="http://www.windowsazure.com/mobile">Windows Azure Mobile Services.</a> In this blog series I will detail how to build a Windows Azure Mobile Service to send push notifications of varying types to your Windows 8 applications.</p>
<p>This series will walk through creating a push notification scenario using WNS and Windows Azure Mobile Services.</p>
<ul>
<li><a href="http://www.nickharris.net/2012/10/blog-series-sending-windows-8-push-notifications-using-windows-azure-mobile-services">Part 1: Windows Azure Mobile Services and Push Notifications an Overview</a></li>
<li>Part 2: Setup: Create and configure your Mobile Service and Windows Store app for Push Notifications</li>
<li>Part 3: Request a Channel and Register with your Mobile Service</li>
<li>Part 4: Sending a Toast, Tile or Badge Notification</li>
<li>Part 5: Efficiency tips and tricks for Push Notification scenarios</li>
</ul>
<p>As I post each part I will update the links below and <a href="http://www.twitter.com/cloudnick" target="_blank">tweet</a> as the post is available. So lets get started with Part 1 - Azure Mobile Services and Push Notifications an Overview</p>
<h1>Part 1: Windows Azure Mobile Services and Push Notifications an Overview</h1>
<h1>What is Windows Azure Mobile Services?</h1>
<p>Here is an info-graphic on the current Windows Azure Mobile Services stack I pulled together as part of a presentation I recently gave at TechEd.  It’s important to note that this info-graphic captures Mobile Services today and over time you will see the feature set of Mobile Services grow exponentially with subsequent releases.</p>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/10/MobileServiceDiagram.png"><img class="alignleft size-full wp-image-1241" title="MobileServiceDiagram" src="http://www.nickharris.net/wp-content/uploads/2012/10/MobileServiceDiagram.png" alt="" width="510" height="414" /></a></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>The goal of Windows Azure Mobile Services is to make it incredibly easy for developers to add a cloud backend to their client apps be it a Windows 8, Windows Phone, iOS or Android application. To do this we provide a number of turn key features baked right into the Mobile Services experience. As the diagram depicts Mobile Services today provides:</p>
<ul>
<li>Structured Storage
<ul>
<li>ability to store structured data to a SQL Database using dynamic schema without being concerned with writing underlying T-SQL.</li>
<li>If using single database apps are automatically partitioned by schema e.g AppX.Todoitem, AppY.Todoitem</li>
<li>If you want access to your data you are not locked out and can manage it in a number of ways including the Mobile Service Portal, SQL Portal, SQL Management Studio, REST API etc.</li>
</ul>
</li>
<li>Server Logic
<ul>
<li>Service API: Mobile services automatically generates a REST API to allow you to perform CRUD operations from your client application on your structured storage</li>
<li>With Dynamic Schema (enabled by default), your Mobile Service will automatically add columns to tables as necessary to store incoming data.</li>
<li>Ability to author server side business logic directly in the portal that is executed directly within the CRUD operation pipeline</li>
</ul>
</li>
<li>Auth
<ul>
<li>Makes it easy for your users to Authenticate against Windows Live. Other major identity providers are coming soon.</li>
<li>The REST API can be locked down using table level permissions using a simple drop down.  No complex code required.  Available permissions levels include: <em>Everyone, Anyone with an Application Key, Only Authenticated Users, Only Scripts and Admins</em>.  These permissions can be set individually on each table and can granularly control each CRUD operation of each table.</li>
<li>More granular control can be added using server side scripts and the <em>user</em> object</li>
</ul>
</li>
<li>Push Notifications
<ul>
<li>Integrates with WNS to provide Toast, Tile and Badge Notifications.</li>
<li>WNS auth is made easy with the portal captures your WNS client secret and package SID</li>
<li>the server side script push.wns.* namespace  performs WNS auth for you and provides a clean and easy object model to compose notifications</li>
</ul>
</li>
<li>Common tenants of Windows Azure Services
<ul>
<li>Scale
<ul>
<li>Compute - scale between shared and reserved mode, increase/decrease your instance count</li>
<li>Storage - ability to scale out your mobile service tenant(s) to a dedicated SQL DB. Ability to scale up your SQL DB from web through business to 150GB.</li>
</ul>
</li>
<li>Diagnostics
<ul>
<li>View diagnostics directly in the portal including API calls, CPU time and Data Out</li>
</ul>
</li>
<li>Logging
<ul>
<li>Console.* operations like console.log and console.error provide an easy means to debug your server side scripts.</li>
</ul>
</li>
</ul>
</li>
</ul>
<p>Today we provide client libraries for Windows 8 to make consuming mobile services easy.  For more details on what client libraries (Windows 8, Windows Phone, iOS and Android) are supported at the time of reading please see: <a href="http://www.windowsazure.com/mobile">Mobile Services</a> and <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj554228">Mobile Service Reference</a>.</p>
<h1>What are Push Notifications?</h1>
<p>The Windows Push Notification Services (WNS) enables you to send toast, tile, badge and raw notifications from the cloud to your Windows Store applications even when your app is not running. Push notifications are ideal for scenarios when you need to target a specific user with personalized content.</p>
<p>The following diagram depicts the general Lifecycle of a push notifications via the Windows Azure Notification Service (WNS).  We&#8217;ll walk through the steps shortly but before doing so I thought it would be important to call out that as a developer implementing a push notification scenario all you need to do is implement those interactions in grey and the applications/services in blue.  Fortunately Mobile Services makes a great deal of this easy for you as you will see throughout the reset of this series.  <a href="http://www.nickharris.net/wp-content/uploads/2012/10/PushNotificationsOverview.png"><img class="alignleft size-full wp-image-1242" title="PushNotificationsOverview" src="http://www.nickharris.net/wp-content/uploads/2012/10/PushNotificationsOverview.png" alt="" width="1110" height="627" /></a></p>
<p>The process of sending a push notification boils down to three basic steps:</p>
<ul>
<li><strong>1. Request a channel</strong>. Utilize the WinRT API to request a Channel Uri from WNS.  The Channel Uri will be the unique identifier you use to send notifications to your application.</li>
<li><strong>2. Register the channel</strong> with your Windows Azure Mobile Service.  Once you have your channel you can then store your channel and associate it with any application specific data (e.g user profiles and such) until your services decide that it’s time to send a notification to the given channel.</li>
<li><strong>3. Authenticate and Push Notification to WNS</strong>. To send notifications to your channel URI you are first required to Authenticate against WNS using OAuth2 to retrieve a token to be used for each subsequent notification that you push to WNS once you have this you can compose and push the notification to the channel recipient. The push.wns.* methods make this task exceptionally quick to accomplish compared to writing it all from scratch yourself.</li>
</ul>
<p>All in all Windows Azure Mobile Services makes all these concepts and steps and incredibly simple to implement though its structured storage and push notifications features.  This series will walk through creating a push notification scenario using WNS and Windows Azure Mobile Services.</p>
<ul>
<li><a href="http://www.nickharris.net/2012/10/blog-series-sending-windows-8-push-notifications-using-windows-azure-mobile-services">Part 1: Windows Azure Mobile Services and Push Notifications an Overview</a></li>
<li>Part 2: Setup: Create and configure your Mobile Service and Windows Store app for Push Notifications</li>
<li>Part 3: Request a Channel and Register with your Mobile Service</li>
<li>Part 4: Sending a Toast, Tile or Badge Notification</li>
<li>Part 5: Efficiency tips and tricks for Push Notification scenarios</li>
</ul>
<p>As I post each part I will update the links below and <a href="http://www.twitter.com/cloudnick" target="_blank">tweet</a> as the post is available</p>
<p>Enjoy,</p>
<p>Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/10/blog-series-sending-windows-8-push-notifications-using-windows-azure-mobile-services/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Localized Windows Azure Mobile Services Deck, HOL and Demo script</title>
		<link>http://www.nickharris.net/2012/10/localized-windows-azure-mobile-services-deck-hol-and-demo-script/</link>
		<comments>http://www.nickharris.net/2012/10/localized-windows-azure-mobile-services-deck-hol-and-demo-script/#comments</comments>
		<pubDate>Thu, 04 Oct 2012 16:51:04 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1235</guid>
		<description><![CDATA[For those of you looking for localized content be it to help you get started with learning about Windows Azure Mobile Services or even if you want to go out and present about it in your local community we have &#8230; <a href="http://www.nickharris.net/2012/10/localized-windows-azure-mobile-services-deck-hol-and-demo-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>For those of you looking for localized content be it to help you get started with learning about Windows Azure Mobile Services or even if you want to go out and present about it in your local community we have made available a localized hands on labs, powerpoint decks and demo scripts</p>
<p>As a preview here is a screenshot of one of the Agenda slide from the Chinese zh-TW poser point deck<a href="http://www.nickharris.net/wp-content/uploads/2012/10/LocalizedContent.png"><img title="LocalizedContent" src="http://www.nickharris.net/wp-content/uploads/2012/10/LocalizedContent.png" alt="" width="548" height="322" /></a></p>
<p>We have localized the content into the following languages thus far.  You can click on the link to get access to the content directly</p>
<p>· <a href="https://github.com/WindowsAzure-TrainingKit-TW">Chinese zh-TW</a><br />
· <a href="https://github.com/WindowsAzure-TrainingKit/Presentation-Windows8AndWindowsAzureMobileServices">English en-US</a><br />
· <a href="https://github.com/WindowsAzure-TrainingKit-DE/">German de-DE</a><br />
· <a href="https://github.com/WindowsAzure-TrainingKit-FR">French fr-FR</a><br />
· <a href="https://github.com/WindowsAzure-TrainingKit-IT">Italian it-IT</a><br />
· <a href="https://github.com/WindowsAzure-TrainingKit-JP">Japanese ja-JP</a><br />
· <a href="https://github.com/WindowsAzure-TrainingKit-KR">Korean ko-KR</a><br />
· <a href="https://github.com/WindowsAzure-TrainingKit-BR/">Portuguese pt-BR</a></p>
<p>Coming soon:<br />
· Spanish<br />
· Russian</p>
<p>&nbsp;</p>
<p>Enjoy,<br />
Nick Harris</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/10/localized-windows-azure-mobile-services-deck-hol-and-demo-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows 8 How to upload an Image using a Blob Storage SAS generated by Windows Azure Mobile Services</title>
		<link>http://www.nickharris.net/2012/09/windows-8-how-to-upload-an-image-using-a-blob-storage-sas-generated-by-windows-azure-mobile-services/</link>
		<comments>http://www.nickharris.net/2012/09/windows-8-how-to-upload-an-image-using-a-blob-storage-sas-generated-by-windows-azure-mobile-services/#comments</comments>
		<pubDate>Wed, 26 Sep 2012 01:11:43 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Mobile Services]]></category>
		<category><![CDATA[Windows 8]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1200</guid>
		<description><![CDATA[Updated: Please read the Background on Shared Access Signatures from this post then move to this updated post &#8211; How to upload an Image to Windows Azure Storage using Mobile Services &#8211; that will show you how to make use &#8230; <a href="http://www.nickharris.net/2012/09/windows-8-how-to-upload-an-image-using-a-blob-storage-sas-generated-by-windows-azure-mobile-services/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Updated:  Please read the Background on Shared Access Signatures from this post then move to this updated post &#8211; <a href="http://www.nickharris.net/2012/11/how-to-upload-an-image-to-windows-azure-storage-using-mobile-services/" target="_blank">How to upload an Image to Windows Azure Storage using Mobile Services</a> &#8211; that will show you how to make use of the Windows Azure Storage SDK for Node.</p>
<h1>Windows 8 How to upload an Image using Blob Storage SAS generated by Windows Azure Mobile Services</h1>
<p>This post details the specific scenario on how to capture an image on windows 8 and upload it directly to Windows Azure Blob Storage using a Shared Access Signature (SAS) generated within Windows Azure Mobile Services.  It demonstrates and alternative approach suited for larger scale implementations (i.e using a SAS) when contrasted with the following article <a href="http://chrisrisner.com/Storing-Images-from-Android-in-Windows-Azure-Mobile-Services" title="Storing Images from Android in Windows Azure Mobile Services" target="_blank">Storing Images from Android in Windows Azure Mobile Services</a></p>
<p><strong>Note:</strong> This topic is advanced and assumes that you have a good knowledge of the Windows Azure Blob REST API and Windows Azure Mobile Services.  I would suggest you check out the following <a href="http://www.windowsazure.com/en-us/develop/mobile/resources/">tutorials </a> and <a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh508996.aspx">Blob Storage REST API </a>prior to starting<br />
<strong>Note:</strong> that although this is specifically an image example you could upload any media/binary data to blob storage using the same approach.</p>
<h2>Background &#8211; Shared Access Signature</h2>
<h3>What Are Shared Access Signatures?</h3>
<p>A Shared Access Signature is a URL that grants access rights to containers, blobs, queues, and tables. By specifying a Shared Access Signature, you can grant users who have the URL access to a specific resource for a specified period of time. You can also specify what operations can be performed on a resource that&#8217;s accessed via a Shared Access Signature. In the case of Blobs operations include:</p>
<ul>
<li>Reading and writing page or block blob content, block lists, properties, and metadata</li>
<li>Deleting, leasing, and creating a snapshot of a blob</li>
<li>Listing the blobs within a container</li>
</ul>
<h3>Why not just use the storage account name and key directly?</h3>
<p>There are a few standout reasons:</p>
<ul>
<li>Security &#8211; When building device applications you should not store your storage account name and key within the device app.  The reason is that it makes your storage account susceptible to being misused.  If someone were to reverse engineer your application take your storage account key then they would essentially have access to 100TB of cloud based storage until such a time that you realized and reset the key.  The safer approach is to use a SAS as it provides a time boxed token with defined permissions to a defined resource.  With policies the token can also be invalidated/revoked</li>
<li>Scale Out (and associated costs)- A common approach I see is uploading an image directly through their web tier e.g a Web API or Mobile Service unfortunate consequence of this at scale is that you are unnecessarily loading your web tier.  Consider that each of your instances on your web tier has a limited network I/O.  Uploading images directly through this will result in maxing out that I/O and the need to scale out (add more instances) much sooner then alternative approaches.  Now consider a scenario where your application requests only a SAS from your web tier you have now moved MBs or image load off your web tier and instead replaced it with a small ~ 100 &#8211; 200 byte SAS.  This essentially means a single instance now will provide much more throughput and your upload I/O now directly hits the Blob storage service </li>
</ul>
<h3>What is the general workflow for uploading a blob using a SAS?</h3>
<p>The four basic steps required when uploading an image using the SAS approach depicted are as follows:<br />
<a href="http://www.nickharris.net/wp-content/uploads/2012/09/SASWorkflow.png"><img src="http://www.nickharris.net/wp-content/uploads/2012/09/SASWorkflow.png" alt="" title="SASWorkflow" width="738" height="692" class="alignleft size-full wp-image-1223" /></a></p>
<ol>
<li>Request a SAS from your service</li>
<li>SAS returned from your service</li>
<li>Upload blob (image/video/binary data) directly to Blob Storage using the SAS</li>
<li>Storage service returns response</li>
</ol>
<p>For this post we will focus specifically on how to write/upload a blob using a shared access signature that is generated in the mobile service insert trigger.</p>
<h2>Creating your Mobile Service</h2>
<p>In this post I will extend the Mobile Services quick start sample.  Before proceeding to the next section create a mobile service and download the quickstart as detailed in the tutorial <a title="here" href="http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started/" target="_blank">here</a></p>
<h2>Capturing the Image|Media</h2>
<p>Our first task is to capture the media we wish to upload.  To do this follow the following steps.</p>
<ol>
<li>Add an AppBar to MainPage.xaml with a take photo button to allow us to capture the image</li>
<div id="gist3785382" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1"><span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC2">    <span class="p">&lt;/</span><span class="n">Grid</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC3"><span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC4">    <span class="p">&lt;</span><span class="n">Page</span><span class="p">.</span><span class="n">BottomAppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC5">        <span class="p">&lt;</span><span class="n">AppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC6">            <span class="p">&lt;</span><span class="n">Button</span> <span class="n">Name</span><span class="p">=</span><span class="s">&quot;btnTakePhoto&quot;</span> <span class="n">Style</span><span class="p">=</span><span class="s">&quot;{StaticResource PhotoAppBarButtonStyle}&quot;</span></div><div class="line" id="file-gistfile1-cs-LC7">                    <span class="n">Click</span><span class="p">=</span><span class="s">&quot;OnTakePhotoClick&quot;</span> <span class="p">/&gt;</span></div><div class="line" id="file-gistfile1-cs-LC8">        <span class="p">&lt;/</span><span class="n">AppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC9">    <span class="p">&lt;/</span><span class="n">Page</span><span class="p">.</span><span class="n">BottomAppBar</span><span class="p">&gt;</span></div><div class="line" id="file-gistfile1-cs-LC10"><span class="p">...</span></div><div class="line" id="file-gistfile1-cs-LC11"><span class="p">&lt;/</span><span class="n">Page</span><span class="p">&gt;</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/3785382/raw/d600a7efa466ed07162a844d74fe88e4ca754d91/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/3785382#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/3785382">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<li>Add the OnTakePhotoClick handler and use the CameraCaptureUI class for taking photo and video</li>
<p><div id="gist3785387" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1"><span class="k">using</span> <span class="nn">Windows.Media.Capture</span><span class="p">;</span></div><div class="line" id="file-gistfile1-cs-LC2">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC3">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC4"><span class="k">private</span> <span class="k">async</span> <span class="k">void</span> <span class="nf">OnTakePhotoClick</span><span class="p">(</span><span class="kt">object</span> <span class="n">sender</span><span class="p">,</span> <span class="n">RoutedEventArgs</span> <span class="n">e</span><span class="p">)</span></div><div class="line" id="file-gistfile1-cs-LC5"> <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC6"> <span class="c1">//Take photo or video</span></div><div class="line" id="file-gistfile1-cs-LC7"> <span class="n">CameraCaptureUI</span> <span class="n">cameraCapture</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CameraCaptureUI</span><span class="p">();</span></div><div class="line" id="file-gistfile1-cs-LC8"> <span class="n">StorageFile</span> <span class="n">media</span> <span class="p">=</span> <span class="k">await</span> <span class="n">cameraCapture</span><span class="p">.</span><span class="n">CaptureFileAsync</span><span class="p">(</span><span class="n">CameraCaptureUIMode</span><span class="p">.</span><span class="n">PhotoOrVideo</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC9">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC10">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC11"><span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/3785387/raw/e85da47e929910e45bfd03895c0563ee738b326e/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/3785387#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/3785387">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

</ol>
<h2>Generating a Shared Access Signature (SAS) using Mobile Services server-side script</h2>
<p>In this step we add sever-side script to generate a SAS on insert operation of the TodoItem table.</p>
<p>To do this perform the following steps:</p>
<ol>
<li>Navigate to your Mobile Service and select the Data Tab, then click on Todoitem</li>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices1.png"><img class="alignleft size-full wp-image-1210" title="MobileServices1" src="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices1.png" alt="" width="961" height="308" /></a></p>
<li>Select Script, then the Insert drop down</li>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices2.png"><img class="alignleft size-full wp-image-1211" title="MobileServices2" src="http://www.nickharris.net/wp-content/uploads/2012/09/MobileServices2.png" alt="" width="962" height="322" /></a></p>
<li>Add the following server side script to generate the SAS</li>
<p><strong>Note:</strong> this code assumes there is already a public container called test.<br />
<strong>Note:</strong>Simple example of Generating a Windows Azure blob SAS in Node created using the guidance <a href="http://msdn.microsoft.com/en-us/library/windowsazure/hh508996.aspx" title="here" target="_blank">here</a>.  </p>
<div id="gist3785378" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-js-L1" rel="file-gistfile1-js-L1">1</span>
          <span class="line-number" id="file-gistfile1-js-L2" rel="file-gistfile1-js-L2">2</span>
          <span class="line-number" id="file-gistfile1-js-L3" rel="file-gistfile1-js-L3">3</span>
          <span class="line-number" id="file-gistfile1-js-L4" rel="file-gistfile1-js-L4">4</span>
          <span class="line-number" id="file-gistfile1-js-L5" rel="file-gistfile1-js-L5">5</span>
          <span class="line-number" id="file-gistfile1-js-L6" rel="file-gistfile1-js-L6">6</span>
          <span class="line-number" id="file-gistfile1-js-L7" rel="file-gistfile1-js-L7">7</span>
          <span class="line-number" id="file-gistfile1-js-L8" rel="file-gistfile1-js-L8">8</span>
          <span class="line-number" id="file-gistfile1-js-L9" rel="file-gistfile1-js-L9">9</span>
          <span class="line-number" id="file-gistfile1-js-L10" rel="file-gistfile1-js-L10">10</span>
          <span class="line-number" id="file-gistfile1-js-L11" rel="file-gistfile1-js-L11">11</span>
          <span class="line-number" id="file-gistfile1-js-L12" rel="file-gistfile1-js-L12">12</span>
          <span class="line-number" id="file-gistfile1-js-L13" rel="file-gistfile1-js-L13">13</span>
          <span class="line-number" id="file-gistfile1-js-L14" rel="file-gistfile1-js-L14">14</span>
          <span class="line-number" id="file-gistfile1-js-L15" rel="file-gistfile1-js-L15">15</span>
          <span class="line-number" id="file-gistfile1-js-L16" rel="file-gistfile1-js-L16">16</span>
          <span class="line-number" id="file-gistfile1-js-L17" rel="file-gistfile1-js-L17">17</span>
          <span class="line-number" id="file-gistfile1-js-L18" rel="file-gistfile1-js-L18">18</span>
          <span class="line-number" id="file-gistfile1-js-L19" rel="file-gistfile1-js-L19">19</span>
          <span class="line-number" id="file-gistfile1-js-L20" rel="file-gistfile1-js-L20">20</span>
          <span class="line-number" id="file-gistfile1-js-L21" rel="file-gistfile1-js-L21">21</span>
          <span class="line-number" id="file-gistfile1-js-L22" rel="file-gistfile1-js-L22">22</span>
          <span class="line-number" id="file-gistfile1-js-L23" rel="file-gistfile1-js-L23">23</span>
          <span class="line-number" id="file-gistfile1-js-L24" rel="file-gistfile1-js-L24">24</span>
          <span class="line-number" id="file-gistfile1-js-L25" rel="file-gistfile1-js-L25">25</span>
          <span class="line-number" id="file-gistfile1-js-L26" rel="file-gistfile1-js-L26">26</span>
          <span class="line-number" id="file-gistfile1-js-L27" rel="file-gistfile1-js-L27">27</span>
          <span class="line-number" id="file-gistfile1-js-L28" rel="file-gistfile1-js-L28">28</span>
          <span class="line-number" id="file-gistfile1-js-L29" rel="file-gistfile1-js-L29">29</span>
          <span class="line-number" id="file-gistfile1-js-L30" rel="file-gistfile1-js-L30">30</span>
          <span class="line-number" id="file-gistfile1-js-L31" rel="file-gistfile1-js-L31">31</span>
          <span class="line-number" id="file-gistfile1-js-L32" rel="file-gistfile1-js-L32">32</span>
          <span class="line-number" id="file-gistfile1-js-L33" rel="file-gistfile1-js-L33">33</span>
          <span class="line-number" id="file-gistfile1-js-L34" rel="file-gistfile1-js-L34">34</span>
          <span class="line-number" id="file-gistfile1-js-L35" rel="file-gistfile1-js-L35">35</span>
          <span class="line-number" id="file-gistfile1-js-L36" rel="file-gistfile1-js-L36">36</span>
          <span class="line-number" id="file-gistfile1-js-L37" rel="file-gistfile1-js-L37">37</span>
          <span class="line-number" id="file-gistfile1-js-L38" rel="file-gistfile1-js-L38">38</span>
          <span class="line-number" id="file-gistfile1-js-L39" rel="file-gistfile1-js-L39">39</span>
          <span class="line-number" id="file-gistfile1-js-L40" rel="file-gistfile1-js-L40">40</span>
          <span class="line-number" id="file-gistfile1-js-L41" rel="file-gistfile1-js-L41">41</span>
          <span class="line-number" id="file-gistfile1-js-L42" rel="file-gistfile1-js-L42">42</span>
          <span class="line-number" id="file-gistfile1-js-L43" rel="file-gistfile1-js-L43">43</span>
          <span class="line-number" id="file-gistfile1-js-L44" rel="file-gistfile1-js-L44">44</span>
          <span class="line-number" id="file-gistfile1-js-L45" rel="file-gistfile1-js-L45">45</span>
          <span class="line-number" id="file-gistfile1-js-L46" rel="file-gistfile1-js-L46">46</span>
          <span class="line-number" id="file-gistfile1-js-L47" rel="file-gistfile1-js-L47">47</span>
          <span class="line-number" id="file-gistfile1-js-L48" rel="file-gistfile1-js-L48">48</span>
          <span class="line-number" id="file-gistfile1-js-L49" rel="file-gistfile1-js-L49">49</span>
          <span class="line-number" id="file-gistfile1-js-L50" rel="file-gistfile1-js-L50">50</span>
          <span class="line-number" id="file-gistfile1-js-L51" rel="file-gistfile1-js-L51">51</span>
          <span class="line-number" id="file-gistfile1-js-L52" rel="file-gistfile1-js-L52">52</span>
          <span class="line-number" id="file-gistfile1-js-L53" rel="file-gistfile1-js-L53">53</span>
          <span class="line-number" id="file-gistfile1-js-L54" rel="file-gistfile1-js-L54">54</span>
          <span class="line-number" id="file-gistfile1-js-L55" rel="file-gistfile1-js-L55">55</span>
          <span class="line-number" id="file-gistfile1-js-L56" rel="file-gistfile1-js-L56">56</span>
          <span class="line-number" id="file-gistfile1-js-L57" rel="file-gistfile1-js-L57">57</span>
          <span class="line-number" id="file-gistfile1-js-L58" rel="file-gistfile1-js-L58">58</span>
          <span class="line-number" id="file-gistfile1-js-L59" rel="file-gistfile1-js-L59">59</span>
          <span class="line-number" id="file-gistfile1-js-L60" rel="file-gistfile1-js-L60">60</span>
          <span class="line-number" id="file-gistfile1-js-L61" rel="file-gistfile1-js-L61">61</span>
          <span class="line-number" id="file-gistfile1-js-L62" rel="file-gistfile1-js-L62">62</span>
          <span class="line-number" id="file-gistfile1-js-L63" rel="file-gistfile1-js-L63">63</span>
          <span class="line-number" id="file-gistfile1-js-L64" rel="file-gistfile1-js-L64">64</span>
          <span class="line-number" id="file-gistfile1-js-L65" rel="file-gistfile1-js-L65">65</span>
          <span class="line-number" id="file-gistfile1-js-L66" rel="file-gistfile1-js-L66">66</span>
          <span class="line-number" id="file-gistfile1-js-L67" rel="file-gistfile1-js-L67">67</span>
          <span class="line-number" id="file-gistfile1-js-L68" rel="file-gistfile1-js-L68">68</span>
          <span class="line-number" id="file-gistfile1-js-L69" rel="file-gistfile1-js-L69">69</span>
          <span class="line-number" id="file-gistfile1-js-L70" rel="file-gistfile1-js-L70">70</span>
          <span class="line-number" id="file-gistfile1-js-L71" rel="file-gistfile1-js-L71">71</span>
          <span class="line-number" id="file-gistfile1-js-L72" rel="file-gistfile1-js-L72">72</span>
          <span class="line-number" id="file-gistfile1-js-L73" rel="file-gistfile1-js-L73">73</span>
          <span class="line-number" id="file-gistfile1-js-L74" rel="file-gistfile1-js-L74">74</span>
          <span class="line-number" id="file-gistfile1-js-L75" rel="file-gistfile1-js-L75">75</span>
          <span class="line-number" id="file-gistfile1-js-L76" rel="file-gistfile1-js-L76">76</span>
          <span class="line-number" id="file-gistfile1-js-L77" rel="file-gistfile1-js-L77">77</span>
          <span class="line-number" id="file-gistfile1-js-L78" rel="file-gistfile1-js-L78">78</span>
          <span class="line-number" id="file-gistfile1-js-L79" rel="file-gistfile1-js-L79">79</span>
          <span class="line-number" id="file-gistfile1-js-L80" rel="file-gistfile1-js-L80">80</span>
          <span class="line-number" id="file-gistfile1-js-L81" rel="file-gistfile1-js-L81">81</span>
          <span class="line-number" id="file-gistfile1-js-L82" rel="file-gistfile1-js-L82">82</span>
          <span class="line-number" id="file-gistfile1-js-L83" rel="file-gistfile1-js-L83">83</span>
          <span class="line-number" id="file-gistfile1-js-L84" rel="file-gistfile1-js-L84">84</span>
          <span class="line-number" id="file-gistfile1-js-L85" rel="file-gistfile1-js-L85">85</span>
          <span class="line-number" id="file-gistfile1-js-L86" rel="file-gistfile1-js-L86">86</span>
          <span class="line-number" id="file-gistfile1-js-L87" rel="file-gistfile1-js-L87">87</span>
          <span class="line-number" id="file-gistfile1-js-L88" rel="file-gistfile1-js-L88">88</span>
          <span class="line-number" id="file-gistfile1-js-L89" rel="file-gistfile1-js-L89">89</span>
          <span class="line-number" id="file-gistfile1-js-L90" rel="file-gistfile1-js-L90">90</span>
          <span class="line-number" id="file-gistfile1-js-L91" rel="file-gistfile1-js-L91">91</span>
          <span class="line-number" id="file-gistfile1-js-L92" rel="file-gistfile1-js-L92">92</span>
          <span class="line-number" id="file-gistfile1-js-L93" rel="file-gistfile1-js-L93">93</span>
          <span class="line-number" id="file-gistfile1-js-L94" rel="file-gistfile1-js-L94">94</span>
          <span class="line-number" id="file-gistfile1-js-L95" rel="file-gistfile1-js-L95">95</span>
          <span class="line-number" id="file-gistfile1-js-L96" rel="file-gistfile1-js-L96">96</span>
          <span class="line-number" id="file-gistfile1-js-L97" rel="file-gistfile1-js-L97">97</span>
          <span class="line-number" id="file-gistfile1-js-L98" rel="file-gistfile1-js-L98">98</span>
          <span class="line-number" id="file-gistfile1-js-L99" rel="file-gistfile1-js-L99">99</span>
          <span class="line-number" id="file-gistfile1-js-L100" rel="file-gistfile1-js-L100">100</span>
          <span class="line-number" id="file-gistfile1-js-L101" rel="file-gistfile1-js-L101">101</span>
          <span class="line-number" id="file-gistfile1-js-L102" rel="file-gistfile1-js-L102">102</span>
          <span class="line-number" id="file-gistfile1-js-L103" rel="file-gistfile1-js-L103">103</span>
          <span class="line-number" id="file-gistfile1-js-L104" rel="file-gistfile1-js-L104">104</span>
          <span class="line-number" id="file-gistfile1-js-L105" rel="file-gistfile1-js-L105">105</span>
          <span class="line-number" id="file-gistfile1-js-L106" rel="file-gistfile1-js-L106">106</span>
          <span class="line-number" id="file-gistfile1-js-L107" rel="file-gistfile1-js-L107">107</span>
          <span class="line-number" id="file-gistfile1-js-L108" rel="file-gistfile1-js-L108">108</span>
          <span class="line-number" id="file-gistfile1-js-L109" rel="file-gistfile1-js-L109">109</span>
          <span class="line-number" id="file-gistfile1-js-L110" rel="file-gistfile1-js-L110">110</span>
          <span class="line-number" id="file-gistfile1-js-L111" rel="file-gistfile1-js-L111">111</span>
          <span class="line-number" id="file-gistfile1-js-L112" rel="file-gistfile1-js-L112">112</span>
          <span class="line-number" id="file-gistfile1-js-L113" rel="file-gistfile1-js-L113">113</span>
          <span class="line-number" id="file-gistfile1-js-L114" rel="file-gistfile1-js-L114">114</span>
          <span class="line-number" id="file-gistfile1-js-L115" rel="file-gistfile1-js-L115">115</span>
          <span class="line-number" id="file-gistfile1-js-L116" rel="file-gistfile1-js-L116">116</span>
          <span class="line-number" id="file-gistfile1-js-L117" rel="file-gistfile1-js-L117">117</span>
          <span class="line-number" id="file-gistfile1-js-L118" rel="file-gistfile1-js-L118">118</span>
          <span class="line-number" id="file-gistfile1-js-L119" rel="file-gistfile1-js-L119">119</span>
          <span class="line-number" id="file-gistfile1-js-L120" rel="file-gistfile1-js-L120">120</span>
          <span class="line-number" id="file-gistfile1-js-L121" rel="file-gistfile1-js-L121">121</span>
          <span class="line-number" id="file-gistfile1-js-L122" rel="file-gistfile1-js-L122">122</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-js-LC1"><span class="c1">//Simple example of Generating a Windows Azure blob SAS in Node created using the guidance at http://msdn.microsoft.com/en-us/library/windowsazure/hh508996.aspx.  </span></div><div class="line" id="file-gistfile1-js-LC2"><span class="c1">//If your environment has access to the Windows Azure SDK for Node (https://github.com/WindowsAzure/azure-sdk-for-node) then you should use that instead.</span></div><div class="line" id="file-gistfile1-js-LC3">&nbsp;</div><div class="line" id="file-gistfile1-js-LC4">&nbsp;</div><div class="line" id="file-gistfile1-js-LC5"><span class="kd">function</span> <span class="nx">insert</span><span class="p">(</span><span class="nx">item</span><span class="p">,</span> <span class="nx">user</span><span class="p">,</span> <span class="nx">request</span><span class="p">)</span> <span class="p">{</span>         </div><div class="line" id="file-gistfile1-js-LC6">        <span class="kd">var</span> <span class="nx">accountName</span> <span class="o">=</span> <span class="s1">&#39;&lt;Your Account Name&gt;&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC7">        <span class="kd">var</span> <span class="nx">accountKey</span> <span class="o">=</span>  <span class="s1">&#39;&lt;Your Account Key&gt;&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC8">        </div><div class="line" id="file-gistfile1-js-LC9">        <span class="c1">//Note: this code assumes the container already exists in blob storage.</span></div><div class="line" id="file-gistfile1-js-LC10">        <span class="c1">// If you wish to dynamically create the container then implement guidance here - http://msdn.microsoft.com/en-us/library/windowsazure/dd179468.aspx</span></div><div class="line" id="file-gistfile1-js-LC11">        <span class="kd">var</span> <span class="nx">container</span> <span class="o">=</span> <span class="s1">&#39;test&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC12">        <span class="kd">var</span> <span class="nx">imageName</span> <span class="o">=</span> <span class="nx">item</span><span class="p">.</span><span class="nx">ImageName</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC13">                         </div><div class="line" id="file-gistfile1-js-LC14">        <span class="nx">item</span><span class="p">.</span><span class="nx">SAS</span> <span class="o">=</span> <span class="nx">getBlobSharedAccessSignature</span><span class="p">(</span><span class="nx">accountName</span><span class="p">,</span> <span class="nx">accountKey</span><span class="p">,</span> <span class="nx">container</span><span class="p">,</span> <span class="nx">imageName</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC15">        <span class="nx">request</span><span class="p">.</span><span class="nx">execute</span><span class="p">();</span></div><div class="line" id="file-gistfile1-js-LC16"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC17">&nbsp;</div><div class="line" id="file-gistfile1-js-LC18">&nbsp;</div><div class="line" id="file-gistfile1-js-LC19"><span class="kd">function</span> <span class="nx">getBlobSharedAccessSignature</span><span class="p">(</span><span class="nx">accountName</span><span class="p">,</span> <span class="nx">accountKey</span><span class="p">,</span> <span class="nx">container</span><span class="p">,</span> <span class="nx">fileName</span><span class="p">){</span></div><div class="line" id="file-gistfile1-js-LC20">    <span class="nx">signedExpiry</span> <span class="o">=</span> <span class="k">new</span> <span class="nb">Date</span><span class="p">();</span>	</div><div class="line" id="file-gistfile1-js-LC21">	<span class="nx">signedExpiry</span><span class="p">.</span><span class="nx">setMinutes</span><span class="p">(</span><span class="nx">signedExpiry</span><span class="p">.</span><span class="nx">getMinutes</span><span class="p">()</span> <span class="o">+</span> <span class="mi">30</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC22">          </div><div class="line" id="file-gistfile1-js-LC23">	<span class="nx">canonicalizedResource</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">format</span><span class="p">(</span><span class="nx">canonicalizedResource</span><span class="p">,</span> <span class="nx">accountName</span><span class="p">,</span> <span class="nx">container</span><span class="p">,</span> <span class="nx">fileName</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC24">	<span class="nx">signature</span> <span class="o">=</span> <span class="nx">getSignature</span><span class="p">(</span><span class="nx">accountKey</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC25">    <span class="kd">var</span> <span class="nx">queryString</span> <span class="o">=</span> <span class="nx">getQueryString</span><span class="p">();</span>    </div><div class="line" id="file-gistfile1-js-LC26">	<span class="k">return</span> <span class="nx">util</span><span class="p">.</span><span class="nx">format</span><span class="p">(</span><span class="nx">resource</span><span class="p">,</span> <span class="nx">accountName</span><span class="p">,</span> <span class="nx">container</span><span class="p">,</span> <span class="nx">fileName</span><span class="p">,</span> <span class="nx">queryString</span><span class="p">);</span> </div><div class="line" id="file-gistfile1-js-LC27"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC28">&nbsp;</div><div class="line" id="file-gistfile1-js-LC29">&nbsp;</div><div class="line" id="file-gistfile1-js-LC30"><span class="kd">function</span> <span class="nx">getSignature</span><span class="p">(</span><span class="nx">accountKey</span><span class="p">){</span>              </div><div class="line" id="file-gistfile1-js-LC31">    <span class="kd">var</span> <span class="nx">decodedKey</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Buffer</span><span class="p">(</span><span class="nx">accountKey</span><span class="p">,</span> <span class="s1">&#39;base64&#39;</span><span class="p">);</span>    </div><div class="line" id="file-gistfile1-js-LC32">    <span class="kd">var</span> <span class="nx">stringToSign</span> <span class="o">=</span> <span class="nx">signedPermissions</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span> <span class="o">+</span> <span class="nx">signedStart</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span> <span class="o">+</span> <span class="nx">getISO8601NoMilliSeconds</span><span class="p">(</span><span class="nx">signedExpiry</span><span class="p">)</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span> <span class="o">+</span> <span class="nx">canonicalizedResource</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span> <span class="o">+</span> <span class="nx">signedIdentifier</span> <span class="o">+</span> <span class="s2">&quot;\n&quot;</span> <span class="o">+</span> <span class="nx">signedVersion</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC33">    <span class="nx">stringToSign</span> <span class="o">=</span> <span class="nx">stringToSign</span><span class="p">.</span><span class="nx">toString</span><span class="p">(</span><span class="s1">&#39;UTF8&#39;</span><span class="p">);</span>     </div><div class="line" id="file-gistfile1-js-LC34">    </div><div class="line" id="file-gistfile1-js-LC35">    <span class="k">return</span> <span class="nx">crypto</span><span class="p">.</span><span class="nx">createHmac</span><span class="p">(</span><span class="s1">&#39;sha256&#39;</span><span class="p">,</span> <span class="nx">decodedKey</span><span class="p">).</span><span class="nx">update</span><span class="p">(</span><span class="nx">stringToSign</span><span class="p">).</span><span class="nx">digest</span><span class="p">(</span><span class="s1">&#39;base64&#39;</span><span class="p">);</span>    </div><div class="line" id="file-gistfile1-js-LC36"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC37">&nbsp;</div><div class="line" id="file-gistfile1-js-LC38">&nbsp;</div><div class="line" id="file-gistfile1-js-LC39"><span class="kd">function</span> <span class="nx">getQueryString</span><span class="p">(){</span></div><div class="line" id="file-gistfile1-js-LC40">    <span class="kd">var</span> <span class="nx">queryString</span> <span class="o">=</span> <span class="s2">&quot;?&quot;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC41">    <span class="nx">queryString</span> <span class="o">+=</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">Constants</span><span class="p">.</span><span class="nx">SIGNED_VERSION</span><span class="p">,</span> <span class="s1">&#39;2012-02-12&#39;</span><span class="p">);</span>   </div><div class="line" id="file-gistfile1-js-LC42">    <span class="nx">queryString</span> <span class="o">+=</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">Constants</span><span class="p">.</span><span class="nx">SIGNED_RESOURCE</span><span class="p">,</span> <span class="nx">signedResource</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC43">    <span class="nx">queryString</span> <span class="o">+=</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">Constants</span><span class="p">.</span><span class="nx">SIGNED_START</span><span class="p">,</span> <span class="nx">getISO8601NoMilliSeconds</span><span class="p">(</span><span class="nx">signedStart</span><span class="p">));</span></div><div class="line" id="file-gistfile1-js-LC44">    <span class="nx">queryString</span> <span class="o">+=</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">Constants</span><span class="p">.</span><span class="nx">SIGNED_EXPIRY</span><span class="p">,</span> <span class="nx">getISO8601NoMilliSeconds</span><span class="p">(</span><span class="nx">signedExpiry</span><span class="p">));</span></div><div class="line" id="file-gistfile1-js-LC45">    <span class="nx">queryString</span> <span class="o">+=</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">Constants</span><span class="p">.</span><span class="nx">SIGNED_PERMISSIONS</span><span class="p">,</span> <span class="nx">signedPermissions</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC46">    <span class="nx">queryString</span> <span class="o">+=</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">Constants</span><span class="p">.</span><span class="nx">SIGNATURE</span><span class="p">,</span> <span class="nx">signature</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC47">    <span class="nx">queryString</span> <span class="o">+=</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">Constants</span><span class="p">.</span><span class="nx">SIGNED_IDENTIFIER</span><span class="p">,</span> <span class="nx">signedIdentifier</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC48">    </div><div class="line" id="file-gistfile1-js-LC49">    <span class="k">return</span> <span class="nx">queryString</span><span class="p">;</span>                 </div><div class="line" id="file-gistfile1-js-LC50"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC51">&nbsp;</div><div class="line" id="file-gistfile1-js-LC52">&nbsp;</div><div class="line" id="file-gistfile1-js-LC53"><span class="kd">function</span> <span class="nx">addEscapedIfNotNull</span><span class="p">(</span><span class="nx">queryString</span><span class="p">,</span> <span class="nx">name</span><span class="p">,</span> <span class="nx">val</span><span class="p">){</span>    </div><div class="line" id="file-gistfile1-js-LC54">  <span class="kd">var</span> <span class="nx">result</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC55">  <span class="k">if</span><span class="p">(</span><span class="nx">val</span><span class="p">)</span></div><div class="line" id="file-gistfile1-js-LC56">  <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC57">      <span class="kd">var</span> <span class="nx">delimiter</span> <span class="o">=</span> <span class="p">(</span><span class="nx">queryString</span><span class="p">.</span><span class="nx">length</span> <span class="o">&gt;</span> <span class="mi">1</span><span class="p">)</span> <span class="o">?</span> <span class="s1">&#39;&amp;&#39;</span> <span class="o">:</span> <span class="s1">&#39;&#39;</span> <span class="p">;</span>              </div><div class="line" id="file-gistfile1-js-LC58">      <span class="nx">result</span> <span class="o">=</span> <span class="nx">util</span><span class="p">.</span><span class="nx">format</span><span class="p">(</span><span class="s1">&#39;%s%s=%s&#39;</span><span class="p">,</span> <span class="nx">delimiter</span><span class="p">,</span> <span class="nx">name</span><span class="p">,</span> <span class="nb">encodeURIComponent</span><span class="p">(</span><span class="nx">val</span><span class="p">));</span>          </div><div class="line" id="file-gistfile1-js-LC59">   <span class="p">}</span>  </div><div class="line" id="file-gistfile1-js-LC60">   </div><div class="line" id="file-gistfile1-js-LC61">   <span class="k">return</span> <span class="nx">result</span><span class="p">;</span>   </div><div class="line" id="file-gistfile1-js-LC62"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC63">&nbsp;</div><div class="line" id="file-gistfile1-js-LC64">&nbsp;</div><div class="line" id="file-gistfile1-js-LC65"><span class="kd">function</span> <span class="nx">getISO8601NoMilliSeconds</span><span class="p">(</span><span class="nx">date</span><span class="p">){</span></div><div class="line" id="file-gistfile1-js-LC66">    <span class="k">if</span><span class="p">(</span><span class="nx">date</span><span class="p">)</span> </div><div class="line" id="file-gistfile1-js-LC67">    <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC68">        <span class="kd">var</span> <span class="nx">raw</span> <span class="o">=</span> <span class="nx">date</span><span class="p">.</span><span class="nx">toJSON</span><span class="p">();</span></div><div class="line" id="file-gistfile1-js-LC69">        <span class="c1">//blob service does not like milliseconds on the end of the time so strip</span></div><div class="line" id="file-gistfile1-js-LC70">        <span class="k">return</span> <span class="nx">raw</span><span class="p">.</span><span class="nx">substr</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="nx">raw</span><span class="p">.</span><span class="nx">lastIndexOf</span><span class="p">(</span><span class="s1">&#39;.&#39;</span><span class="p">))</span> <span class="o">+</span> <span class="s1">&#39;Z&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC71">    <span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC72"><span class="p">}</span></div><div class="line" id="file-gistfile1-js-LC73">&nbsp;</div><div class="line" id="file-gistfile1-js-LC74">&nbsp;</div><div class="line" id="file-gistfile1-js-LC75"><span class="kd">var</span> <span class="nx">Constants</span> <span class="o">=</span> <span class="p">{</span></div><div class="line" id="file-gistfile1-js-LC76">    <span class="nx">SIGNED_VERSION</span><span class="o">:</span> <span class="s1">&#39;sv&#39;</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC77">    <span class="nx">SIGNED_RESOURCE</span><span class="o">:</span> <span class="s1">&#39;sr&#39;</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC78">    <span class="nx">SIGNED_START</span><span class="o">:</span> <span class="s1">&#39;st&#39;</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC79">    <span class="nx">SIGNED_EXPIRY</span><span class="o">:</span> <span class="s1">&#39;se&#39;</span><span class="p">,</span>    </div><div class="line" id="file-gistfile1-js-LC80">    <span class="nx">SIGNED_PERMISSIONS</span><span class="o">:</span> <span class="s1">&#39;sp&#39;</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC81">    <span class="nx">SIGNED_IDENTIFIER</span><span class="o">:</span> <span class="s1">&#39;si&#39;</span><span class="p">,</span></div><div class="line" id="file-gistfile1-js-LC82">    <span class="nx">SIGNATURE</span><span class="o">:</span> <span class="s1">&#39;sig&#39;</span><span class="p">,</span>      </div><div class="line" id="file-gistfile1-js-LC83"><span class="p">};</span></div><div class="line" id="file-gistfile1-js-LC84">&nbsp;</div><div class="line" id="file-gistfile1-js-LC85">&nbsp;</div><div class="line" id="file-gistfile1-js-LC86"><span class="kd">var</span> <span class="nx">crypto</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;crypto&#39;</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC87"><span class="kd">var</span> <span class="nx">util</span> <span class="o">=</span> <span class="nx">require</span><span class="p">(</span><span class="s1">&#39;util&#39;</span><span class="p">);</span></div><div class="line" id="file-gistfile1-js-LC88">&nbsp;</div><div class="line" id="file-gistfile1-js-LC89">&nbsp;</div><div class="line" id="file-gistfile1-js-LC90"><span class="c1">//http://msdn.microsoft.com/en-us/library/windowsazure/hh508996.aspx</span></div><div class="line" id="file-gistfile1-js-LC91"><span class="kd">var</span> <span class="nx">resource</span> <span class="o">=</span> <span class="s1">&#39;https://%s.blob.core.windows.net/%s/%s%s&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC92">&nbsp;</div><div class="line" id="file-gistfile1-js-LC93">&nbsp;</div><div class="line" id="file-gistfile1-js-LC94"><span class="c1">//Version of the storage rest API</span></div><div class="line" id="file-gistfile1-js-LC95"><span class="kd">var</span> <span class="nx">signedVersion</span> <span class="o">=</span> <span class="s1">&#39;2012-02-12&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC96">&nbsp;</div><div class="line" id="file-gistfile1-js-LC97">&nbsp;</div><div class="line" id="file-gistfile1-js-LC98"><span class="c1">//signedResource. use b for blob, c for container</span></div><div class="line" id="file-gistfile1-js-LC99"><span class="kd">var</span> <span class="nx">signedResource</span> <span class="o">=</span> <span class="s1">&#39;b&#39;</span><span class="p">;</span> <span class="c1">//</span></div><div class="line" id="file-gistfile1-js-LC100">&nbsp;</div><div class="line" id="file-gistfile1-js-LC101">&nbsp;</div><div class="line" id="file-gistfile1-js-LC102"><span class="c1">// The signedpermission portion of the string must include the permission designations in a fixed order that is specific to each resource type. Any combination of these permissions is acceptable, but the order of permission letters must match the order in the following table.</span></div><div class="line" id="file-gistfile1-js-LC103"><span class="kd">var</span> <span class="nx">signedPermissions</span> <span class="o">=</span> <span class="s1">&#39;rw&#39;</span><span class="p">;</span> <span class="c1">//blob perms must be in this order rwd</span></div><div class="line" id="file-gistfile1-js-LC104">&nbsp;</div><div class="line" id="file-gistfile1-js-LC105">&nbsp;</div><div class="line" id="file-gistfile1-js-LC106"><span class="c1">// Example - Use ISO 8061 format</span></div><div class="line" id="file-gistfile1-js-LC107"><span class="kd">var</span> <span class="nx">signedStart</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC108"><span class="kd">var</span> <span class="nx">signedExpiry</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC109">&nbsp;</div><div class="line" id="file-gistfile1-js-LC110">&nbsp;</div><div class="line" id="file-gistfile1-js-LC111"><span class="c1">// Eample Blob</span></div><div class="line" id="file-gistfile1-js-LC112"><span class="c1">//	URL = https://myaccount.blob.core.windows.net/music/intro.mp3</span></div><div class="line" id="file-gistfile1-js-LC113"><span class="c1">//	canonicalizedresource = &quot;/myaccount/music/intro.mp3&quot;</span></div><div class="line" id="file-gistfile1-js-LC114"><span class="kd">var</span> <span class="nx">canonicalizedResource</span> <span class="o">=</span> <span class="s1">&#39;/%s/%s/%s&#39;</span><span class="p">;</span></div><div class="line" id="file-gistfile1-js-LC115">&nbsp;</div><div class="line" id="file-gistfile1-js-LC116">&nbsp;</div><div class="line" id="file-gistfile1-js-LC117"><span class="c1">//The string-to-sign is a unique string constructed from the fields that must be verified in order to authenticate the request. The signature is an HMAC computed over the string-to-sign and key using the SHA256 algorithm, and then encoded using Base64 encoding.</span></div><div class="line" id="file-gistfile1-js-LC118"><span class="kd">var</span> <span class="nx">signature</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span> </div><div class="line" id="file-gistfile1-js-LC119">&nbsp;</div><div class="line" id="file-gistfile1-js-LC120">&nbsp;</div><div class="line" id="file-gistfile1-js-LC121"><span class="c1">//Optional. A unique value up to 64 characters in length that correlates to an access policy specified for the container, queue, or table. </span></div><div class="line" id="file-gistfile1-js-LC122"><span class="kd">var</span> <span class="nx">signedIdentifier</span> <span class="o">=</span> <span class="s1">&#39;&#39;</span><span class="p">;</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/3785378/raw/5621ecf936ea22a09a6f820e9787bf5aa0e882c6/gistfile1.js" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/3785378#file-gistfile1-js" style="float:right; margin-right:10px; color:#666;">gistfile1.js</a>
          <a href="https://gist.github.com/nickharris/3785378">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<h2> Uploading the Image directly to storage using the SAS</h2>
<li>To generate the sas we must insert a todoItem. which will now return the SAS property for the image.  Thus update the OnTakePhotoClick handler to insert an item.</li>
<div id="gist3785391" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
          <span class="line-number" id="file-gistfile1-cs-L12" rel="file-gistfile1-cs-L12">12</span>
          <span class="line-number" id="file-gistfile1-cs-L13" rel="file-gistfile1-cs-L13">13</span>
          <span class="line-number" id="file-gistfile1-cs-L14" rel="file-gistfile1-cs-L14">14</span>
          <span class="line-number" id="file-gistfile1-cs-L15" rel="file-gistfile1-cs-L15">15</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1"><span class="k">private</span> <span class="k">async</span> <span class="k">void</span> <span class="nf">OnTakePhotoClick</span><span class="p">(</span><span class="kt">object</span> <span class="n">sender</span><span class="p">,</span> <span class="n">RoutedEventArgs</span> <span class="n">e</span><span class="p">)</span></div><div class="line" id="file-gistfile1-cs-LC2"><span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC3">    <span class="c1">//Take photo or video</span></div><div class="line" id="file-gistfile1-cs-LC4">    <span class="n">CameraCaptureUI</span> <span class="n">cameraCapture</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CameraCaptureUI</span><span class="p">();</span>          </div><div class="line" id="file-gistfile1-cs-LC5">    <span class="n">StorageFile</span> <span class="n">media</span> <span class="p">=</span> <span class="k">await</span> <span class="n">cameraCapture</span><span class="p">.</span><span class="n">CaptureFileAsync</span><span class="p">(</span><span class="n">CameraCaptureUIMode</span><span class="p">.</span><span class="n">PhotoOrVideo</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC6">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC7">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC8">    <span class="c1">//add todo item to trigger insert operation which returns item.SAS</span></div><div class="line" id="file-gistfile1-cs-LC9">    <span class="kt">var</span> <span class="n">todoItem</span> <span class="p">=</span> <span class="k">new</span> <span class="n">TodoItem</span><span class="p">()</span> <span class="p">{</span> <span class="n">Text</span> <span class="p">=</span> <span class="s">&quot;test image&quot;</span><span class="p">,</span> <span class="n">ImageName</span> <span class="p">=</span> <span class="n">media</span><span class="p">.</span><span class="n">Name</span> <span class="p">};</span></div><div class="line" id="file-gistfile1-cs-LC10">    <span class="k">await</span> <span class="n">todoTable</span><span class="p">.</span><span class="n">InsertAsync</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC11">    <span class="n">items</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC12">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC13">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC14">    <span class="c1">//TODO: Upload image direct to blob storage using SAS</span></div><div class="line" id="file-gistfile1-cs-LC15"><span class="p">}</span></div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/3785391/raw/28dde1365a6b3ae1a441895970669c58418ac35c/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/3785391#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/3785391">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<li>Update OnTakePhotoClick handler to update the image directly to blob storage using the HttpClient and the generated item.SAS</li>
</ol>
<div id="gist3785397" class="gist">
      <div class="gist-file">
        <div class="gist-data gist-syntax">



  <div class="file-data">
    <table cellpadding="0" cellspacing="0" class="lines highlight">
      <tr>
        <td class="line-numbers">
          <span class="line-number" id="file-gistfile1-cs-L1" rel="file-gistfile1-cs-L1">1</span>
          <span class="line-number" id="file-gistfile1-cs-L2" rel="file-gistfile1-cs-L2">2</span>
          <span class="line-number" id="file-gistfile1-cs-L3" rel="file-gistfile1-cs-L3">3</span>
          <span class="line-number" id="file-gistfile1-cs-L4" rel="file-gistfile1-cs-L4">4</span>
          <span class="line-number" id="file-gistfile1-cs-L5" rel="file-gistfile1-cs-L5">5</span>
          <span class="line-number" id="file-gistfile1-cs-L6" rel="file-gistfile1-cs-L6">6</span>
          <span class="line-number" id="file-gistfile1-cs-L7" rel="file-gistfile1-cs-L7">7</span>
          <span class="line-number" id="file-gistfile1-cs-L8" rel="file-gistfile1-cs-L8">8</span>
          <span class="line-number" id="file-gistfile1-cs-L9" rel="file-gistfile1-cs-L9">9</span>
          <span class="line-number" id="file-gistfile1-cs-L10" rel="file-gistfile1-cs-L10">10</span>
          <span class="line-number" id="file-gistfile1-cs-L11" rel="file-gistfile1-cs-L11">11</span>
          <span class="line-number" id="file-gistfile1-cs-L12" rel="file-gistfile1-cs-L12">12</span>
          <span class="line-number" id="file-gistfile1-cs-L13" rel="file-gistfile1-cs-L13">13</span>
          <span class="line-number" id="file-gistfile1-cs-L14" rel="file-gistfile1-cs-L14">14</span>
          <span class="line-number" id="file-gistfile1-cs-L15" rel="file-gistfile1-cs-L15">15</span>
          <span class="line-number" id="file-gistfile1-cs-L16" rel="file-gistfile1-cs-L16">16</span>
          <span class="line-number" id="file-gistfile1-cs-L17" rel="file-gistfile1-cs-L17">17</span>
          <span class="line-number" id="file-gistfile1-cs-L18" rel="file-gistfile1-cs-L18">18</span>
          <span class="line-number" id="file-gistfile1-cs-L19" rel="file-gistfile1-cs-L19">19</span>
          <span class="line-number" id="file-gistfile1-cs-L20" rel="file-gistfile1-cs-L20">20</span>
          <span class="line-number" id="file-gistfile1-cs-L21" rel="file-gistfile1-cs-L21">21</span>
          <span class="line-number" id="file-gistfile1-cs-L22" rel="file-gistfile1-cs-L22">22</span>
          <span class="line-number" id="file-gistfile1-cs-L23" rel="file-gistfile1-cs-L23">23</span>
          <span class="line-number" id="file-gistfile1-cs-L24" rel="file-gistfile1-cs-L24">24</span>
          <span class="line-number" id="file-gistfile1-cs-L25" rel="file-gistfile1-cs-L25">25</span>
          <span class="line-number" id="file-gistfile1-cs-L26" rel="file-gistfile1-cs-L26">26</span>
          <span class="line-number" id="file-gistfile1-cs-L27" rel="file-gistfile1-cs-L27">27</span>
          <span class="line-number" id="file-gistfile1-cs-L28" rel="file-gistfile1-cs-L28">28</span>
          <span class="line-number" id="file-gistfile1-cs-L29" rel="file-gistfile1-cs-L29">29</span>
          <span class="line-number" id="file-gistfile1-cs-L30" rel="file-gistfile1-cs-L30">30</span>
        </td>
        <td class="line-data">
          <pre class="line-pre"><div class="line" id="file-gistfile1-cs-LC1"><span class="k">private</span> <span class="k">async</span> <span class="k">void</span> <span class="nf">OnTakePhotoClick</span><span class="p">(</span><span class="kt">object</span> <span class="n">sender</span><span class="p">,</span> <span class="n">RoutedEventArgs</span> <span class="n">e</span><span class="p">)</span></div><div class="line" id="file-gistfile1-cs-LC2"><span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC3">    <span class="c1">//Take photo or video</span></div><div class="line" id="file-gistfile1-cs-LC4">    <span class="n">CameraCaptureUI</span> <span class="n">cameraCapture</span> <span class="p">=</span> <span class="k">new</span> <span class="n">CameraCaptureUI</span><span class="p">();</span>          </div><div class="line" id="file-gistfile1-cs-LC5">    <span class="n">StorageFile</span> <span class="n">media</span> <span class="p">=</span> <span class="k">await</span> <span class="n">cameraCapture</span><span class="p">.</span><span class="n">CaptureFileAsync</span><span class="p">(</span><span class="n">CameraCaptureUIMode</span><span class="p">.</span><span class="n">PhotoOrVideo</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC6">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC7">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC8">    <span class="c1">//add todo item</span></div><div class="line" id="file-gistfile1-cs-LC9">    <span class="kt">var</span> <span class="n">todoItem</span> <span class="p">=</span> <span class="k">new</span> <span class="n">TodoItem</span><span class="p">()</span> <span class="p">{</span> <span class="n">Text</span> <span class="p">=</span> <span class="s">&quot;test image&quot;</span><span class="p">,</span> <span class="n">ImageName</span> <span class="p">=</span> <span class="n">media</span><span class="p">.</span><span class="n">Name</span> <span class="p">};</span></div><div class="line" id="file-gistfile1-cs-LC10">    <span class="k">await</span> <span class="n">todoTable</span><span class="p">.</span><span class="n">InsertAsync</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC11">    <span class="n">items</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="n">todoItem</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC12">  </div><div class="line" id="file-gistfile1-cs-LC13">    <span class="c1">//Upload image with HttpClient to the blob service using the generated item.SAS</span></div><div class="line" id="file-gistfile1-cs-LC14">    <span class="k">using</span> <span class="p">(</span><span class="kt">var</span> <span class="n">client</span> <span class="p">=</span> <span class="k">new</span> <span class="n">HttpClient</span><span class="p">())</span></div><div class="line" id="file-gistfile1-cs-LC15">    <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC16">        <span class="c1">//Get a stream of the media just captured</span></div><div class="line" id="file-gistfile1-cs-LC17">        <span class="k">using</span> <span class="p">(</span><span class="kt">var</span> <span class="n">fileStream</span> <span class="p">=</span> <span class="k">await</span> <span class="n">media</span><span class="p">.</span><span class="n">OpenStreamForReadAsync</span><span class="p">())</span></div><div class="line" id="file-gistfile1-cs-LC18">        <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC19">            <span class="kt">var</span> <span class="n">content</span> <span class="p">=</span> <span class="k">new</span> <span class="n">StreamContent</span><span class="p">(</span><span class="n">fileStream</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC20">            <span class="n">content</span><span class="p">.</span><span class="n">Headers</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;Content-Type&quot;</span><span class="p">,</span> <span class="n">media</span><span class="p">.</span><span class="n">ContentType</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC21">            <span class="n">content</span><span class="p">.</span><span class="n">Headers</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">&quot;x-ms-blob-type&quot;</span><span class="p">,</span> <span class="s">&quot;BlockBlob&quot;</span><span class="p">);</span></div><div class="line" id="file-gistfile1-cs-LC22">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC23">&nbsp;</div><div class="line" id="file-gistfile1-cs-LC24">            <span class="k">using</span> <span class="p">(</span><span class="kt">var</span> <span class="n">uploadResponse</span> <span class="p">=</span> <span class="k">await</span> <span class="n">client</span><span class="p">.</span><span class="n">PutAsync</span><span class="p">(</span><span class="k">new</span> <span class="n">Uri</span><span class="p">(</span><span class="n">todoItem</span><span class="p">.</span><span class="n">SAS</span><span class="p">),</span> <span class="n">content</span><span class="p">))</span></div><div class="line" id="file-gistfile1-cs-LC25">            <span class="p">{</span></div><div class="line" id="file-gistfile1-cs-LC26">                <span class="c1">//TODO: any post processing</span></div><div class="line" id="file-gistfile1-cs-LC27">            <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC28">        <span class="p">}</span></div><div class="line" id="file-gistfile1-cs-LC29">    <span class="p">}</span>           </div><div class="line" id="file-gistfile1-cs-LC30"><span class="p">}</span>  </div></pre>
        </td>
      </tr>
    </table>
  </div>

        </div>

        <div class="gist-meta">
          <a href="https://gist.github.com/nickharris/3785397/raw/0434ac46c0ff27d5689ff0528d0a411060c02c07/gistfile1.cs" style="float:right">view raw</a>
          <a href="https://gist.github.com/nickharris/3785397#file-gistfile1-cs" style="float:right; margin-right:10px; color:#666;">gistfile1.cs</a>
          <a href="https://gist.github.com/nickharris/3785397">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
</div>

<h2> Run the application</h2>
<ol>
<li>Hit F5 on the application and right click with your mouse to show the app bar</li>
<li>Press the Take Photo button</li>
<li>Observe that the SAS is returned from your Mobile Service</li>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/09/SAS.png"><img class="alignleft  wp-image-1212" title="SAS" src="http://www.nickharris.net/wp-content/uploads/2012/09/SAS.png" alt="" width="625" height="321" /></a></p>
<li> Check your storage account now has the captured virtual High Five photo/video <img src='http://www.nickharris.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </li>
</ol>
<p><a href="http://www.nickharris.net/wp-content/uploads/2012/09/VirtualHighFive.png"><img class="alignleft size-full wp-image-1213" title="VirtualHighFive" src="http://www.nickharris.net/wp-content/uploads/2012/09/VirtualHighFive.png" alt="" width="982" height="677" /></a></p>
<p>Enjoy,<br />
Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/09/windows-8-how-to-upload-an-image-using-a-blob-storage-sas-generated-by-windows-azure-mobile-services/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Building Connected Windows 8 Apps with Windows Azure</title>
		<link>http://www.nickharris.net/2012/06/building-connected-windows-8-apps-with-windows-azure/</link>
		<comments>http://www.nickharris.net/2012/06/building-connected-windows-8-apps-with-windows-azure/#comments</comments>
		<pubDate>Thu, 14 Jun 2012 19:30:34 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[windows8]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1185</guid>
		<description><![CDATA[Hey &#8211; I thought I would share this video, deck and completed demo for all of you who attended my TechEd North America + Europe sessions Are you building a connected Windows Metro style app? This session introduces you to &#8230; <a href="http://www.nickharris.net/2012/06/building-connected-windows-8-apps-with-windows-azure/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Hey &#8211;  I thought I would share this video, deck and completed demo for all of you who attended my TechEd North America + Europe sessions</p>
<p>Are you building a connected Windows Metro style app? This session introduces you to Windows Azure and demonstrates how you can build connected experiences for your Windows 8 Metro style apps. After walking the through the fundamentals of both platforms, we take a deep dive as we demonstrate how you can use Windows Azure to support common geo-location, multimedia, data and push notification scenarios. At the end of this session, you will be empowered to begin building and deploying your own Windows 8 client applications that are powered by Windows Azure</p>
<p><video poster="http://media.ch9.ms/ch9/59d0/a10ad29e-c563-46ea-8803-5213635859d0/AZR310_Custom.jpg" controls width="576" height="432"><><source src="http://media.ch9.ms/ch9/59d0/a10ad29e-c563-46ea-8803-5213635859d0/AZR310_mid.mp4" type="video/mp4" width="576" height="432">< /><source src="http://media.ch9.ms/ch9/59d0/a10ad29e-c563-46ea-8803-5213635859d0/AZR310.webm" type="video/webm" width="576" height="432">< /></video></p>
<p>You can download the full video in high res from channel 9 <a href="http://channel9.msdn.com/Events/TechEd/Europe/2012/AZR310" title="Link to download the video" target="_blank">here</a></p>
<p>Download the deck <a href="https://winrt.blob.core.windows.net/resources/Win8_TechEdNA2012_2.pptx" target="_blank">Here</a><br />
Download the source <a href="https://winrt.blob.core.windows.net/resources/MediaLocationPushNotifications.zip" target="_blank">Here</a> Note I have removed the connection strings for SQL + Windows Azure storage + Bing Maps. You will find all places that you need to replace these by doing a search for TODO-REPLACE.  Enjoy!</p>
<p>Kind Regards,<br />
Nick </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/06/building-connected-windows-8-apps-with-windows-azure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.ch9.ms/ch9/59d0/a10ad29e-c563-46ea-8803-5213635859d0/AZR310_mid.mp4" length="658591803" type="video/mp4" />
<enclosure url="http://media.ch9.ms/ch9/59d0/a10ad29e-c563-46ea-8803-5213635859d0/AZR310.webm" length="138509183" type="video/webm" />
		</item>
		<item>
		<title>Join the Learn Windows Azure Track at TechEd North America</title>
		<link>http://www.nickharris.net/2012/06/join-the-learn-windows-azure-track-at-teched-north-america/</link>
		<comments>http://www.nickharris.net/2012/06/join-the-learn-windows-azure-track-at-teched-north-america/#comments</comments>
		<pubDate>Sat, 09 Jun 2012 17:45:34 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[TechEd]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1178</guid>
		<description><![CDATA[Come and Join us at TechEd North America in the Learn Windows Azure Track this Monday in the room N310 to learn about the latest from Windows Azure Engineering Leadership. For those of you who are attending in person click &#8230; <a href="http://www.nickharris.net/2012/06/join-the-learn-windows-azure-track-at-teched-north-america/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Come and Join us at TechEd North America in the Learn Windows Azure Track this Monday in the room N310 to learn about the latest from Windows Azure Engineering Leadership. For those of you who are attending in person click the links below to add to your TechEd Agenda.  For those of you who are not attending TechEd we will be streaming it Live &#8211; <a href="http://channel9.msdn.com/Events/windowsazure/Learn-2012TechEd-NA" target="_blank">register here</a>  </p>
<p>Note times below are shown in Eastern Time (for those on PDT we kick off 8am)</p>
<p><strong><a href="http://northamerica.msteched.com/topic/details/2012/FDN05" target="_blank">11:00 &#8211; 12:00 pm &#8211; Windows Azure Today &amp; Tomorrow (Scott Guthrie)</a></strong>Windows Azure is a flexible and open cloud platform for a wide variety of applications ranging from web sites to enterprise and mobile applications.  In this foundation session Scott Guthrie will demonstrate how to quickly build and deploy applications using the new Windows Azure features and services including Windows Azure Web Sites, Virtual Machines, and new developer tools and SDKs.</p>
<p><a href="http://northamerica.msteched.com/topic/details/2012/AZR209" target="_blank"><strong>1:15 &#8211; 2:30 pm &#8211; Windows Azure Applications and Workloads (Mark Russinovich)</strong> </a>Join Technical Fellow Mark Russinovich as he demonstrates new functionality in Windows Azure that allows for easy application migration, simple provisioning of new compute resources and advanced enterprise data center scenarios. Learn how you can use this new functionality to on-ramp applications as-is to the cloud or extend your data center to create true hybrid solutions.</p>
<p><strong><a href="http://northamerica.msteched.com/topic/details/2012/AZR210"  target="_blank">3:00 &#8211; 4:15 pm &#8211; Web Sites on Windows Azure (Bill Staples)</a></strong> Join Windows Azure General Manager Bill Staples as he introduces the newest features and services for building web applications on Windows Azure. Learn how Windows Azure makes it easy for you to easily build and rapidly deploy everything from content management systems to high-scale ASP.NET web applications.</p>
<p><strong><a href="http://northamerica.msteched.com/topic/details/2012/AZR208" target="_blank">4:45 &#8211; 6:00 pm &#8211; Cloud-Ready Data Services (Quentin Clark)</a></strong> Windows Azure includes a complete set of enterprise-ready data services, including Windows Azure Storage and SQL Databases. In this demo-filled session developers will see how to can effectively use these services to develop and migrate data-centric applications to Windows Azure, while using familiar tools.</p>
<p>I look forward to seeing you there!</p>
<p>Nick </p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/06/join-the-learn-windows-azure-track-at-teched-north-america/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sending Language specific Push Notifications to Windows 8 using the WnsRecipe</title>
		<link>http://www.nickharris.net/2012/06/sending-language-specific-push-notifications-to-windows-8-using-the-wnsrecipe/</link>
		<comments>http://www.nickharris.net/2012/06/sending-language-specific-push-notifications-to-windows-8-using-the-wnsrecipe/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 00:16:08 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[Push Notifications]]></category>
		<category><![CDATA[WNS]]></category>
		<category><![CDATA[WnsRecipe]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1164</guid>
		<description><![CDATA[I was recently asked to help out with a MSDN forum post on how the WnsRecipe NuGet package can be used to send Push Notifications via WNS to Windows 8 Metro app clients.  Essentially here are the steps. Note: This &#8230; <a href="http://www.nickharris.net/2012/06/sending-language-specific-push-notifications-to-windows-8-using-the-wnsrecipe/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I was recently asked to help out with a MSDN forum <a href="http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/69b07a86-88d6-4a87-8dde-35f1df1d1af3?prof=required">post </a>on how the WnsRecipe NuGet package can be used to send Push Notifications via WNS to Windows 8 Metro app clients.  Essentially here are the steps.</p>
<p>Note: This post assumes you have already created a client app, requested test credentials for WNS and received a notification channel in your cloud service.  If you have not yet done this I would recommend you watch this episode of cloud cover where I demonstrate the setup:<br />
<video width="576" height="432" poster="http://media.ch9.ms/ch9/97e3/0da29222-9422-4d95-8760-406720a497e3/CloudCover79_512.jpg" controls><source src="http://media.ch9.ms/ch9/97e3/0da29222-9422-4d95-8760-406720a497e3/CloudCover79_mid.mp4" type="video/mp4" /><source src="http://media.ch9.ms/ch9/97e3/0da29222-9422-4d95-8760-406720a497e3/CloudCover79.webm" type="video/webm" /></video></p>
<p>If you want to download the hi def version here is the <a href="http://channel9.msdn.com/Shows/Cloud+Cover/Episode-73-Nick-Harris-on-Push-Notifications-for-Windows-8" target="_blank">direct link to Channel 9 for this episode </a>.</p>
<p>Now that you have watched the pre-req the rest is really quite simple.</p>
<p>Install the <a href="http://nuget.org/packages/wnsrecipe" title="WnsRecipe NuGet" target="_blank">WnsRecipe NuGet </a>into your solution using the NuGet Package Manager</p>
<ul>
<li>Right click on your project and select &#8216;Manage NuGet Packages&#8217;</li>
<li>Select Online and search for WnsRecipe and press Install
<pre name="code" class="csharp">
using NotificationsExtensions; 
using NotificationsExtensions.TileContent;
</pre>
</li>
<li>Use the recipe as per normal but recall to set the appropriate BCP 47 language code  for your wideTile.Lang and squareTile.Lang properties
<pre name="code" class="csharp">
//new up an access token provider with your credentials
IAccessTokenProvider tokenProvider = new WnsAccessTokenProvider("&lt;your package sid&gt;", "&lt;your client secret&gt;");     
var uri = new Uri("&lt;your endpoint uri&gt;");

//Create the wide tile
ITileWideText09 wideTile = TileContentFactory.CreateTileWideText09();     
wideTile.Lang = "de-DE";     
wideTile.TextHeading.Text = "Test-Paket";     
wideTile.TextBodyWrap.Text = "ä";

// new up a square tile to send down with the wide tile
// as you do not know if the user has pinned the tile to small or wide
ITileSquareText02 squareTile = TileContentFactory.CreateTileSquareText02();     
squareTile.Lang = "de-DE";     
squareTile.TextHeading.Text = "Test-Paket";     
squareTile.TextBodyWrap.Text = "ä";     

// set the square tile content
wideTile.SquareContent = squareTile;

//Send notification - note you should pay attention to the Status codes coming back from the 
//send operation in the result variable.
var result = wideTile.Send(uri, tokenProvider);
</pre>
</li>
<li> And that&#8217;s basically it as mentioned above this is a somewhat fragment sample.  Please do watch the Cloud Cover episode if you require more detail</li>
</ul>
<p>For a full list with screenshots of the different tile template types please see this <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.notifications.tiletemplatetype.aspx" title="MSDN reference" target="_blank">MSDN reference<br />
</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/06/sending-language-specific-push-notifications-to-windows-8-using-the-wnsrecipe/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://media.ch9.ms/ch9/97e3/0da29222-9422-4d95-8760-406720a497e3/CloudCover79.webm" length="4953" type="video/webm" />
<enclosure url="http://media.ch9.ms/ch9/97e3/0da29222-9422-4d95-8760-406720a497e3/CloudCover79_mid.mp4" length="407740308" type="video/mp4" />
		</item>
		<item>
		<title>Updated Windows Azure Toolkit for Windows 8 Consumer Preview</title>
		<link>http://www.nickharris.net/2012/04/updated-windows-azure-toolkit-for-windows-8-consumer-preview/</link>
		<comments>http://www.nickharris.net/2012/04/updated-windows-azure-toolkit-for-windows-8-consumer-preview/#comments</comments>
		<pubDate>Thu, 12 Apr 2012 18:07:43 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Announcement]]></category>
		<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[notifications]]></category>
		<category><![CDATA[Service Bus]]></category>
		<category><![CDATA[WNS]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1156</guid>
		<description><![CDATA[On Friday we released the an update to the Windows Azure Toolkit for Windows 8 Consumer Preview. This version of the toolkit adds a Service Bus sample, Raw Notification sample and Diagnostics to the WnsRecipe NuGet. You can download the self-extracting &#8230; <a href="http://www.nickharris.net/2012/04/updated-windows-azure-toolkit-for-windows-8-consumer-preview/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>On Friday we released the an update to the <a href="http://watwindows8.codeplex.com/" target="_blank">Windows Azure Toolkit for Windows 8 Consumer Preview</a>. This version of the toolkit adds a Service Bus sample, Raw Notification sample and Diagnostics to the WnsRecipe NuGet. You can download the self-extracting package on Codeplex from <a href="http://watwindows8.codeplex.com/">here</a>.</p>
<p>If you are building Windows 8 Metro Style applications with Windows Azure and have not yet downloaded the toolkit I would encourage you to do so.  Why?, as a quick demonstration the following video shows how you can use the toolkit to build a Windows 8 Metro Style application that uses Windows Azure and the Windows Push Notification Service (WNS) to send Toast, Tile and Badge notifications to your Windows 8 Consumer Preview apps in under 4 minutes.</p>
<p><video width="576" height="432" poster="http://ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS_512.jpg" controls="controls"><source src="http://ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS_mid.mp4" type="video/mp4" /><source src="http://ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS.webm" type="video/webm" /><object width="576" height="432" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS_mid.mp4&amp;poster=http%3A//ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS_512.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="576" height="432" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS_mid.mp4&amp;poster=http%3A//ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS_512.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video><br />
You can view/download the hi-def version of the video <a href="http://channel9.msdn.com/posts/How-to-Send-Push-Notifications-using-the-Windows-Push-Notification-Service-and-Windows-Azure" target="_blank">on channel 9 here</a></p>
<h1>What’s in it?</h1>
<ul>
<li><strong>Automated Install</strong> – Scripted install of all dependencies including Visual Studio 2010 Express and the Windows Azure SDK on Windows 8 Consumer Preview.</li>
<li><strong>Project Templates</strong> – Client project templates for Windows 8 Metro Style apps in Dev 11 for both XAML/C# and HTML5/JS with a supporting server-side Windows Azure Project for Visual Studio 2010.</li>
<li><strong>NuGet Packages</strong> – Throughout the development of the project templates we have extracted the functionality into NuGet Packages for example the WNSRecipe NuGet provides a simple managed API for authenticating against WNS, constructing notification payloads and posting the notification to WNS. This reduces the effort to send a Toast, Tile, Badge or Raw notification to about three lines of code. You can find a full list of the other packages created support Push Notifications and the sample ACS scenarios <a href="http://www.nuget.org/profiles/nickharris">here</a> and full source in the toolkit under /Libraries.</li>
<li><strong>Samples </strong> – Five sample applications demonstrating different ways Windows 8 Metro Style apps can use Push Notifications, ACS and Service Bus</li>
<li><strong>Documentation</strong> – Extensive documentation including install, file new project walkthrough, samples and deployment to Windows Azure.</li>
</ul>
<h1></h1>
<h1>Want More?</h1>
<p>If you would like to learn more about the Windows Push Notification Service and the Windows Azure Toolkit for Windows 8 check out the following videos.</p>
<h2>Building Metro Style apps that use Windows Azure Service Bus</h2>
<p><video width="576" height="432" poster="http://ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_512.jpg" controls="controls"><source src="http://ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4" type="video/mp4" /><source src="http://ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75.webm" type="video/webm" /><object width="576" height="432" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4&amp;poster=http%3A//ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_512.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="576" height="432" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4&amp;poster=http%3A//ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_512.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video>You can view/download the hi-def version of the video <a href="http://channel9.msdn.com/Shows/Cloud+Cover/Episode-75-Building-Windows-8-Metro-Apps-using-Windows-Azure-Service-Bus" target="_blank">on channel 9 here</a></p>
<h2>Sending Push Notifications to Windows 8 and Windows Phone 7 Devices using Windows Azure</h2>
<p><video width="576" height="432" poster="http://ch9files.blob.core.windows.net/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_custom_ch9.jpg" controls="controls"><source src="http://ak.channel9.msdn.com/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_med_ch9.mp4" type="video/mp4" /><source src="http://ak.channel9.msdn.com/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_ch9.webm" type="video/webm" /><object width="576" height="432" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//ak.channel9.msdn.com/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_med_ch9.mp4&amp;poster=http%3A//ch9files.blob.core.windows.net/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_custom_ch9.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="576" height="432" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//ak.channel9.msdn.com/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_med_ch9.mp4&amp;poster=http%3A//ch9files.blob.core.windows.net/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_custom_ch9.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video>You can view/download the hi-def version of the video <a href="http://channel9.msdn.com/Events/TechDays/TechDays-2012-Belgium/272" target="_blank">on channel 9 here</a></p>
<h2>Building Metro Style apps that use Push Notifications</h2>
<p><video width="576" height="432" poster="http://files.channel9.msdn.com/thumbnail/8462b6a7-c3b1-4ab8-9789-b7b69f8ee0ef.jpg" controls="controls"><source src="http://ak.channel9.msdn.com/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_med_ch9.mp4" type="video/mp4" /><source src="http://ak.channel9.msdn.com/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_ch9.webm" type="video/webm" /><object width="576" height="432" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//ak.channel9.msdn.com/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_med_ch9.mp4&amp;poster=http%3A//files.channel9.msdn.com/thumbnail/8462b6a7-c3b1-4ab8-9789-b7b69f8ee0ef.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="576" height="432" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//ak.channel9.msdn.com/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_med_ch9.mp4&amp;poster=http%3A//files.channel9.msdn.com/thumbnail/8462b6a7-c3b1-4ab8-9789-b7b69f8ee0ef.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video>You can view/download the hi-def version of the video <a href="http://channel9.msdn.com/Shows/Cloud+Cover/Episode-73-Nick-Harris-on-Push-Notifications-for-Windows-8" target="_blank">on channel 9 here</a></p>
<h2>Building Metro Style apps that use the Access Control Service</h2>
<p><video width="576" height="432" poster="http://ch9files.blob.core.windows.net/build/2011/thumbs/858_LG.jpg" controls="controls"><source src="http://ak.channel9.msdn.com/build/2011/mp4/858.mp4" type="video/mp4" /><object width="576" height="432" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//ak.channel9.msdn.com/build/2011/mp4/858.mp4&amp;poster=http%3A//ch9files.blob.core.windows.net/build/2011/thumbs/858_LG.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="576" height="432" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//ak.channel9.msdn.com/build/2011/mp4/858.mp4&amp;poster=http%3A//ch9files.blob.core.windows.net/build/2011/thumbs/858_LG.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video>You can view/download the hi-def version of the video <a href="http://channel9.msdn.com/events/BUILD/BUILD2011/SAC-858T" target="_blank">on channel 9 here</a></p>
<p>For more details, please refer to the following posts:</p>
<ul>
<li><a href="http://watwindows8.codeplex.com/wikipage?title=Creating%20a%20New%20Windows%208%20Cloud%20Application&amp;referringTitle=Home" target="_blank">Documentation and Download at Codeplex</a></li>
<li>Vittorio Bertocci’s Blog: <a href="http://blogs.msdn.com/b/vbertocci/archive/2011/09/14/using-acs-in-metro-style-applications.aspx" target="_blank">Using ACS in Metro Style Applications</a></li>
<li>Wade Wegner’s Blog: <a href="http://www.wadewegner.com/2011/09/metro-style-apps-with-windows-azure/" target="_blank">Metro Style Apps with Windows Azure</a></li>
<li>Nick Harris’s Blog: <a href="http://go.microsoft.com/fwlink/?LinkId=246279" target="_blank">How to Send Push Notifications with the Windows Push Notification Service and Windows Azure</a></li>
</ul>
<p>Please ping me on twitter to let me know if you have any feedback or questions <a href="http://www.twitter.com/cloudnick" target="_blank">@cloudnick</a></p>
<p>Enjoy,<br />
Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/04/updated-windows-azure-toolkit-for-windows-8-consumer-preview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS_mid.mp4" length="30325563" type="video/mp4" />
<enclosure url="http://ak.channel9.msdn.com/ch9/3eee/29f1f6e0-3ebd-425e-919a-2d4a48443eee/Windows8PushNotificationsWithWindowsAzureAndWNS.webm" length="5975880" type="video/webm" />
<enclosure url="http://ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4" length="406332539" type="video/mp4" />
<enclosure url="http://ak.channel9.msdn.com/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75.webm" length="103153222" type="video/webm" />
<enclosure url="http://ak.channel9.msdn.com/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_med_ch9.mp4" length="485325039" type="video/mp4" />
<enclosure url="http://ak.channel9.msdn.com/ch9/9fa5/84829aab-34be-4b10-a85a-9ff700be9fa5/sendingpushnots_ch9.webm" length="196699155" type="video/webm" />
<enclosure url="http://ak.channel9.msdn.com/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_med_ch9.mp4" length="468054828" type="video/mp4" />
<enclosure url="http://ak.channel9.msdn.com/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_ch9.webm" length="187093894" type="video/webm" />
<enclosure url="http://ak.channel9.msdn.com/build/2011/mp4/858.mp4" length="288535455" type="video/mp4" />
		</item>
		<item>
		<title>Sample using Windows Azure Service Bus from a Windows 8 Metro Style App</title>
		<link>http://www.nickharris.net/2012/04/sample-using-windows-azure-service-bus-from-a-windows-8-metro-style-app/</link>
		<comments>http://www.nickharris.net/2012/04/sample-using-windows-azure-service-bus-from-a-windows-8-metro-style-app/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 23:12:57 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Service Bus]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1139</guid>
		<description><![CDATA[I wanted to showcase a Sample application we recently distributed in the Windows Azure Toolkit for Windows 8.  I will post a more detailed code based blog in the near future but for now I wanted to share with you how &#8230; <a href="http://www.nickharris.net/2012/04/sample-using-windows-azure-service-bus-from-a-windows-8-metro-style-app/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>I wanted to showcase a Sample application we recently distributed in the <a href="http://watwindows8.codeplex.com" target="_blank">Windows Azure Toolkit for Windows 8</a>.  I will post a more detailed code based blog in the near future but for now I wanted to share with you how to get up and running with the Sample application.  Special thanks to <a href="http://willperry.net/" target="_blank">Will Perry</a> and the Windows Azure Service Bus  team for putting the sample together.</p>
<p>The Windows Azure Service Bus Sample browser application demonstrates how to send and receive messages from a Windows 8 Metro style application via Windows Azure Service Bus Queues, Topics and Subscriptions.</p>
<p>Windows Azure Service Bus Messaging provides cloud-based, message-oriented-middleware technologies including a full featured Message Queue with support for arbitrary content types, rich message properties, correlation, reliable binary transfer, and grouping. Service Bus Topics provide a set of new publish-and-subscribe capabilities and are based on the same backend infrastructure as Service Bus Queues. A Topic consists of a sequential message store just like a Queue, but allows for many concurrent and durable Subscriptions that can independently yield copies of the published messages to consumers. Each Subscription can define a set of rules with simple expressions that specify which messages from the published sequence are selected into the Subscription.</p>
<p>This sample consists of a sample library that creates an easy to use abstraction on top of the Windows Azure Service Bus REST APIs and a sample to demonstrate the usage of the Windows Azure Service Bus from a Windows 8 metro style using this sample library.</p>
<p><strong>Important: Setting up the Windows Azure Service Bus Sample</strong></p>
<p>Before running the application, you must first configure a Service Bus namespace and then configure the sample application to use this namespace. You can do this as follows.</p>
<ol>
<li>Navigate to the <a href="https://windows.azure.com/">Windows Azure portal</a>. You will be prompted for your Windows Live ID credentials if you are not already signed in.</li>
<li>Click <strong>Service Bus, Access Control &amp; Caching </strong>link in the left pane, and then select the <strong>Service Bus</strong> item under the <strong>Services</strong>element. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/1.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/1.png" alt="Service Bus" width="624" height="469" border="0" /></a></li>
<li>Add a Service Namespace. A service namespace provides an application boundary for each application exposed through the Service Bus and is used to construct Service Bus endpoints for the application. To add a service namespace, click the <strong>New </strong>button on the upper ribbon bar. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/2.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/2.png" alt="Service Bus" width="534" height="301" border="0" /></a></li>
<li>On the left list, check all the available services. Enter a name<strong> </strong>for your service<strong> Namespace</strong>, select a <strong>Region</strong> for your service to run in, choose the <strong>Subscription</strong> and a <strong>Cache Size </strong>a<strong> </strong>click <strong>Create Namespace</strong>. Make sure to validate the availability of the name first. Service names must be globally unique as they are hosted in the cloud and accessible by whomever you decide to grant access. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/3.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/3.png" alt="Service Bus" width="624" height="258" border="0" /></a>Record the Value of your <strong>Service</strong><strong>Namespace</strong> as you will later use this to configure the sample application.</li>
<li>Once the namespace is active, click its name in the list of available namespaces to display the Service Namespace information page. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/4.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/4.png" alt="Service Bus" width="624" height="314" border="0" /></a></li>
<li>In the <strong>Properties</strong> right pane, locate the <strong>Service Bus</strong> section and click the Default Key <strong>View</strong>button. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/5.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/5.png" alt="Service Bus" width="281" height="111" border="0" /></a>Record the value shown for <strong>Default Issuer </strong>a<strong> Default Key, </strong>and click <strong>OK</strong>. You will need these values later when configuring your Web Role settings. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/60.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/60.png" alt="Service Bus" width="494" height="181" border="0" /></a>Now that you have your <strong>Service Namespace, Default Issuer and Default Key </strong>you are ready to<strong> </strong>configure the application.</li>
<li>Open Visual Studio 11.</li>
<li>Open the <strong>Microsoft.Samples.ServiceBus.Metro.sln</strong> solution located in the <strong>Samples\ServiceBus</strong>folder.</li>
<li>Open<strong> App.xaml.cs</strong>, in the <strong>Microsoft.Samples.ServiceBus.SampleBrowser</strong> project and set the values<strong> </strong>for the <strong>Service Namespace, Default Issuer and Default Key </strong>where indicated in the following image. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/6.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/6.png" alt="Service Bus" width="658" height="319" border="0" /></a></li>
<li>Make sure that the start-up project of the solution is the Metro style app project. To set the startup Project right-click on the <strong>Microsoft.Samples.ServiceBus.SampleBrowser </strong>project<strong> </strong>in<strong> Solution Explorer </strong>and select<strong> Set as StartUp Project</strong>.</li>
<li>Press<strong> F5</strong>to run the application. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/7.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/7.png" alt="Service Bus" width="658" height="468" border="0" /></a></li>
<li>Select one of the three options and follow the steps within the application to learn about using Service Bus from within a Windows 8 metro app. The following options are available:
<ol>
<li><strong>Simple Queues</strong>: Explore the basic functionality of a Service Bus Queue, including Create, Delete, Send and Receive operations. Please notice that Queue names must not contain spaces. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/8.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/8.png" alt="Service Bus" width="589" height="331" border="0" /></a></li>
<li><strong>Simple Topics: </strong>Explore the basic functionality of a Service Bus Topic including Create, Subscribe, Send and Delete. <a href="http://www.nickharris.net/wp-content/uploads/2012/04/9.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/9.png" alt="Service Bus" width="589" height="331" border="0" /></a></li>
<li><strong>Peek Lock: </strong>Explore alternate receive semantics you can use when reading messages from Service Bus. <a name="_GoBack" href="file:///C:/Users/sdurandeu.SW/AppData/Local/Temp/EcfPreview1280/html/#"></a> <a href="http://www.nickharris.net/wp-content/uploads/2012/04/10.png"><img title="Service Bus" src="http://www.nickharris.net/wp-content/uploads/2012/04/10.png" alt="Service Bus" width="589" height="331" border="0" /></a></li>
</ol>
</li>
</ol>
<p>If you would like to learn more please see this video on channel 9:<br />
<video width="576" height="432" poster="http://ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_512.jpg" controls="controls"><source src="http://ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4" type="video/mp4" /><source src="http://ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75.webm" type="video/webm" /><object width="576" height="432" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="src" value="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" /><param name="flashvars" value="url=http%3A//ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4&amp;poster=http%3A//ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_512.jpg" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="true" /><embed width="576" height="432" type="application/x-shockwave-flash" src="http://www.nickharris.net/wp-includes/js/tinymce/plugins/media/moxieplayer.swf" flashvars="url=http%3A//ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4&amp;poster=http%3A//ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_512.jpg" allowfullscreen="true" allowscriptaccess="true" /></object></video></p>
<p>or download it <a href="http://channel9.msdn.com/Shows/Cloud+Cover/Episode-75-Building-Windows-8-Metro-Apps-using-Windows-Azure-Service-Bus" target="_blank">directly from channel 9</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/04/sample-using-windows-azure-service-bus-from-a-windows-8-metro-style-app/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://ch9files.blob.core.windows.net/ch9/1a4e/dc84923b-6090-4b42-be23-2ca5033b1a4e/CloudCover75_mid.mp4" length="0" type="video/mp4" />
		</item>
		<item>
		<title>Decks for DevConnection talks</title>
		<link>http://www.nickharris.net/2012/04/decks-for-devconnection-talks/</link>
		<comments>http://www.nickharris.net/2012/04/decks-for-devconnection-talks/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 22:42:16 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1135</guid>
		<description><![CDATA[Thank you all for attending my talks at DevConnections Las Vegas.  Per your request here are the powerpoint decks: Bring your Windows 8 Apps to Life with Push Notifications using Windows Azure Mobile Application Development using Windows Azure If you &#8230; <a href="http://www.nickharris.net/2012/04/decks-for-devconnection-talks/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Thank you all for attending my talks at <a href="http://www.devconnections.com/home.aspx" target="_blank">DevConnections Las Vegas</a>.  Per your request here are the powerpoint decks:</p>
<ul>
<li><a href="http://www.nickharris.net/wp-content/uploads/2012/04/1_W8NotificationsUsingWindowsAzure.pptx" target="_blank">Bring your Windows 8 Apps to Life with Push Notifications using Windows Azure</a></li>
<li><a href="http://www.nickharris.net/wp-content/uploads/2012/04/2_Devices.pptx" target="_blank">Mobile Application Development using Windows Azure</a></li>
</ul>
<p>If you are building an app related to any of the content above or if you are presenting this content at a user group or other event I would love to hear about it!  Please reach out to me on twitter <a href="http://twitter.com/#!/cloudnick" target="_blank">@cloudnick</a></p>
<p>Enjoy,</p>
<p>Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/04/decks-for-devconnection-talks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Episode 73 of Cloud Cover Building Push Notifications for Windows 8</title>
		<link>http://www.nickharris.net/2012/04/episode-73-of-cloud-cover-building-push-notifications-for-windows-8/</link>
		<comments>http://www.nickharris.net/2012/04/episode-73-of-cloud-cover-building-push-notifications-for-windows-8/#comments</comments>
		<pubDate>Wed, 11 Apr 2012 22:30:57 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Notifications]]></category>
		<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[notifications]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1130</guid>
		<description><![CDATA[If you would like to get an overview of the Windows Azure Toolkit for Windows 8 and how the code within it works check the following episode of Wade and I on cloud cover If you want to download the &#8230; <a href="http://www.nickharris.net/2012/04/episode-73-of-cloud-cover-building-push-notifications-for-windows-8/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>If you would like to get an overview of the Windows Azure Toolkit for Windows 8 and how the code within it works check the following episode of Wade and I on cloud cover </p>
<p><video width="576" height="432" poster="http://files.channel9.msdn.com/thumbnail/8462b6a7-c3b1-4ab8-9789-b7b69f8ee0ef.jpg" controls><source src="http://ch9files.blob.core.windows.net/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_med_ch9.mp4" type="video/mp4" /><source src="http://ch9files.blob.core.windows.net/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_ch9.webm" type="video/webm" /></video></p>
<p>If you want to download the hi def version here is the <a href="http://channel9.msdn.com/Shows/Cloud+Cover/Episode-73-Nick-Harris-on-Push-Notifications-for-Windows-8" target="_blank">direct link to Channel 9 for this episode </a></p>
<p>Enjoy, Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/04/episode-73-of-cloud-cover-building-push-notifications-for-windows-8/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://ch9files.blob.core.windows.net/ch9/eed6/e38707f0-dba4-490e-9e09-a01d00dfeed6/Episode73NickHarrisOnPushNotifications_med_ch9.mp4" length="0" type="video/mp4" />
		</item>
		<item>
		<title>Devices + Cloud Using Windows Azure with WP7, iOS, Android</title>
		<link>http://www.nickharris.net/2012/03/devices-cloud-using-windows-azure-with-wp7-ios-android/</link>
		<comments>http://www.nickharris.net/2012/03/devices-cloud-using-windows-azure-with-wp7-ios-android/#comments</comments>
		<pubDate>Mon, 05 Mar 2012 01:16:08 +0000</pubDate>
		<dc:creator>nick.harris</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Mobile]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[iOS]]></category>
		<category><![CDATA[Windows Phone]]></category>

		<guid isPermaLink="false">http://www.nickharris.net/?p=1095</guid>
		<description><![CDATA[Here is a talk I recently gave at TechDays Belgium So, you’re building apps that span multiple devices apps and you’re curious about what the cloud can offer. Is it possible to deploy scalable Web apps and services on Windows &#8230; <a href="http://www.nickharris.net/2012/03/devices-cloud-using-windows-azure-with-wp7-ios-android/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[<p>Here is a talk I recently gave at TechDays Belgium</p>
<p>So, you’re building apps that span multiple devices apps and you’re curious about what the cloud can offer. Is it possible to deploy scalable Web apps and services on Windows Azure? How about storing data in the cloud? Is it possible to use the cloud for push notifications to the device? In this session, you&#8217;ll learn how to build tablet, Windows Phone, Android and even iOS apps that are backed by scalable cloud services with the Windows Azure platform. This demo-focused session will cover the end-to-end experience and address how to tackle issues such as authentication, storage and notifications across a wide range of devices. </p>
<p><video poster="http://video.ch9.ms/ch9/8e91/747bdab2-b259-42db-8743-9ff700be8e91/devicesandcloudusing_custom_ch9.jpg" width="576" height="432" controls="controls"><source src="http://video.ch9.ms/ch9/8e91/747bdab2-b259-42db-8743-9ff700be8e91/devicesandcloudusing_med_ch9.mp4" /><source src="http://video.ch9.ms/ch9/8e91/747bdab2-b259-42db-8743-9ff700be8e91/devicesandcloudusing_ch9.webm" /></video></p>
<p>or you can <a href="http://channel9.msdn.com/Events/TechDays/TechDays-2012-Belgium/201" title="watch it directly here on channel 9" target="_blank">watch it directly here on channel 9</a></p>
<p>Enjoy,<br />
Nick</p>
]]></content:encoded>
			<wfw:commentRss>http://www.nickharris.net/2012/03/devices-cloud-using-windows-azure-with-wp7-ios-android/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
<enclosure url="http://video.ch9.ms/ch9/8e91/747bdab2-b259-42db-8743-9ff700be8e91/devicesandcloudusing_med_ch9.mp4" length="533224826" type="video/mp4" />
<enclosure url="http://video.ch9.ms/ch9/8e91/747bdab2-b259-42db-8743-9ff700be8e91/devicesandcloudusing_ch9.webm" length="242575161" type="video/webm" />
		</item>
	</channel>
</rss>
