<?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/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Wade Wegner</title>
	
	<link>http://www.wadewegner.com</link>
	<description>From the whiteboard to the keyboard</description>
	<lastBuildDate>Sun, 10 Mar 2013 22:07:05 +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/WadeWegner" /><feedburner:info uri="wadewegner" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><geo:lat>39.610431</geo:lat><geo:long>-104.881399</geo:long><feedburner:emailServiceId>WadeWegner</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><feedburner:feedFlare href="http://add.my.yahoo.com/rss?url=http%3A%2F%2Ffeeds.feedburner.com%2FWadeWegner" src="http://us.i1.yimg.com/us.yimg.com/i/us/my/addtomyyahoo4.gif">Subscribe with My Yahoo!</feedburner:feedFlare><feedburner:feedFlare href="http://www.newsgator.com/ngs/subscriber/subext.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FWadeWegner" src="http://www.newsgator.com/images/ngsub1.gif">Subscribe with NewsGator</feedburner:feedFlare><feedburner:feedFlare href="http://feeds.my.aol.com/add.jsp?url=http%3A%2F%2Ffeeds.feedburner.com%2FWadeWegner" src="http://o.aolcdn.com/favorites.my.aol.com/webmaster/ffclient/webroot/locale/en-US/images/myAOLButtonSmall.gif">Subscribe with My AOL</feedburner:feedFlare><feedburner:feedFlare href="http://www.bloglines.com/sub/http://feeds.feedburner.com/WadeWegner" src="http://www.bloglines.com/images/sub_modern11.gif">Subscribe with Bloglines</feedburner:feedFlare><feedburner:feedFlare href="http://www.netvibes.com/subscribe.php?url=http%3A%2F%2Ffeeds.feedburner.com%2FWadeWegner" src="http://www.netvibes.com/img/add2netvibes.gif">Subscribe with Netvibes</feedburner:feedFlare><feedburner:feedFlare href="http://fusion.google.com/add?feedurl=http%3A%2F%2Ffeeds.feedburner.com%2FWadeWegner" src="http://buttons.googlesyndication.com/fusion/add.gif">Subscribe with Google</feedburner:feedFlare><feedburner:feedFlare href="http://www.pageflakes.com/subscribe.aspx?url=http%3A%2F%2Ffeeds.feedburner.com%2FWadeWegner" src="http://www.pageflakes.com/ImageFile.ashx?instanceId=Static_4&amp;fileName=ATP_blu_91x17.gif">Subscribe with Pageflakes</feedburner:feedFlare><feedburner:feedFlare href="http://www.live.com/?add=http%3A%2F%2Ffeeds.feedburner.com%2FWadeWegner" src="http://tkfiles.storage.msn.com/x1piYkpqHC_35nIp1gLE68-wvzLZO8iXl_JMledmJQXP-XTBOLfmQv4zhj4MhcWEJh_GtoBIiAl1Mjh-ndp9k47If7hTaFno0mxW9_i3p_5qQw">Subscribe with Live.com</feedburner:feedFlare><item>
		<title>Creating Anonymous Apex REST APIs with Force.com</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/MFhauuKSWOk/</link>
		<comments>http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/#comments</comments>
		<pubDate>Sun, 10 Mar 2013 21:23:17 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[Apex]]></category>
		<category><![CDATA[Force.com]]></category>
		<category><![CDATA[REST API]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1993</guid>
		<description><![CDATA[The Force.com REST API lets you integration with Force.com applications using standard HTTP methods. This API provides a way to expose the data you have within your Force.com application to external applications – both mobile and non-mobile. A few useful bits of information related to these REST APIs: Use standard HTTP verbs: GET, POST, PUT,&#8230; <a href="http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>The Force.com REST API lets you integration with Force.com applications using standard HTTP methods. This API provides a way to expose the data you have within your Force.com application to external applications – both mobile and non-mobile. A few useful bits of information related to these REST APIs:</p>
<ul>
<li>Use standard HTTP verbs: GET, POST, PUT, PATCH, DELETE, and HEAD.</li>
<li>You can use either HTTP or HTTPS.</li>
<li>Use standard security to authenticate your REST calls via OAuth 2.0.</li>
<li>Serialize your data in either XML or JSON format.</li>
</ul>
<p>Force.com provides this capability out-of-the-box (OOTB) for objects you create and supports standard CRUD (create, read, update, and delete) against your objects. While this is great, there are a few scenarios that are not supported OOTB in Force.com – complex data queries (i.e. joins) via the API, custom logic or rules, and anonymous access.</p>
<p>In this post I’ll show you how you can create REST APIs using Apex REST in order to anonymous access to your APIs.</p>
<p>Following is a detailed tutorial:</p>
<p>1. Start by creating a new Force.com developer account. Why create a new account? Well, why not? It provides a good sandbox for testing things out and you can have as many as you want. Note that the although the login you create looks like an email address it doesn’t have to be your email address – it’s simply a login. You can create a nonsensical login – i.e. anonymous@restcall.com – and just throw it away when you’re done.</p>
<p>2. Let’s create a custom object. Under <strong>App Setup</strong> click <strong>Schema Builder</strong>. Click the <strong>Elements</strong> tab and drag an <strong>Object</strong> into the schema canvas.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb.png" width="235" height="133" border="0" /></a></p>
<p>3. For the <strong>Label</strong> choose “Widget”, for the <strong>Plural Label</strong> choose “Widgets”, and for the <strong>Record Name</strong> choose “Name&#8221;. Click <strong>Save</strong>.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_3.png" width="481" height="612" border="0" /></a></p>
<p>4. It’s time to create the Apex REST API. Close the Schema Builder and under <strong>App Setup</strong> expand <strong>Developer</strong> and click <strong>Apex Classes</strong>. Click <strong>New</strong> to create a new class.</p>
<p>5. Past the following code into <strong>Apex Class Editor</strong>:</p>
<pre class="code"><span style="color: black;">@RestResource(urlMapping=</span><span style="color: #a31515;">'/Widgets/*'</span><span style="color: black;">)
global </span><span style="color: blue;">class </span><span style="color: #2b91af;">WidgetController </span><span style="color: black;">{

    @HttpGet
    global </span><span style="color: blue;">static </span><span style="color: black;">List&lt;Widget__c&gt; getWidgets() {
        List&lt;Widget__c&gt; widgets = [SELECT Name from Widget__c];
        </span><span style="color: blue;">return </span><span style="color: black;">widgets;
    }

    @HttpPost 
    global </span><span style="color: blue;">static </span><span style="color: black;">String createNewWidget(String Name) {
        Widget__c w = </span><span style="color: blue;">new </span><span style="color: black;">Widget__c();
        w.Name = Name;
        insert w;

        </span><span style="color: blue;">return </span><span style="color: #a31515;">'Done'</span><span style="color: black;">;
   }

    @HttpDelete
    global </span><span style="color: blue;">static </span><span style="color: black;">String deleteWidgetById() {
        String Id = RestContext.request.</span><span style="color: blue;">params</span><span style="color: black;">.get(</span><span style="color: #a31515;">'Id'</span><span style="color: black;">);
        List&lt;Widget__c&gt; w = [ Select ID from Widget__c where Id= :Id];

        delete w;

        </span><span style="color: blue;">return </span><span style="color: #a31515;">'Deleted Widget'</span><span style="color: black;">;
    }

    @HttpPut
    global </span><span style="color: blue;">static </span><span style="color: black;">String updateWidget(String Id, String NewName) {
        Widget__c w = [ Select ID, Name from Widget__c where Id= :Id];

        w.Name = NewName;
        update w;

        </span><span style="color: blue;">return </span><span style="color: #a31515;">'Widget Updated'</span><span style="color: black;">;
    }
}</span></pre>
<p>6. To access these APIs we have to create a site and provide access to this Apex class. Force.com sites enable you to create public websites and applications. Under <strong>App Setup</strong> expand <strong>Develop</strong> and click <strong>Sites.</strong></p>
<p>7. Choose a Force.com domain name. Ensure it is available, click the checkbox, then click <strong>Register My Force.com Domain</strong>.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_4.png" width="497" height="152" border="0" /></a></p>
<p>8. Once your site is registered click the <strong>New</strong> button.</p>
<p>9. Give yourself a <strong>Site Label</strong>, <strong>Site Name</strong>, and choose an <strong>Active Site Home Page</strong>. Since no one will use this site as a website I’ve chosen <strong>FileNotFound</strong>. Click the <strong>Save</strong> button.</p>
<p>10. By default the site is not active. Click the <strong>Activate</strong> button or else you will not be able to access your APIs.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_5.png" width="567" height="69" border="0" /></a></p>
<p>11. Next we have to grant anonymous access to our Apex REST API. Click the <strong>Public Access Settings</strong> button.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_6.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_6.png" width="567" height="69" border="0" /></a></p>
<p>12. Scroll down the <strong>Custom Object Permissions</strong> and click the <strong>Edit</strong> button underneath the <strong>Widgets</strong>.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_7.png" width="348" height="169" border="0" /></a></p>
<p>Scroll down again to <strong>Custom Object Permissions </strong>(yeah, I know …) and check all the boxes. Click <strong>Save</strong>.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_8.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_8.png" width="318" height="126" border="0" /></a></p>
<p>13. Scroll down to <strong>Enabled Apex Class Access</strong> and click the <strong>Edit</strong> button. Select the <strong>WidgetController</strong> and click the <strong>Add</strong> button. Click <strong>Save</strong>.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_9.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_9.png" width="391" height="342" border="0" /></a></p>
<p>14.Browse to <a target="_blank" href="http://www.hurl.it/">http://www.hurl.it/</a>. This is a great website for making HTTP requests and will let us test the GET, POST, PATCH, and DELETE.</p>
<p>15. Right now our object doesn’t have any data. Before we make a Get request let’s add some data. Enter <a target="_blank" title="https://wadeapitest-developer-edition.na15.force.com/services/apexrest/Widgets" href="https://wadeapitest-developer-edition.na15.force.com/services/apexrest/Widgets">https://wadeapitest-developer-edition.na15.force.com/services/apexrest/Widgets</a> in the URL (note: the first part of this URL is from step 7 above). Change to <strong>POST </strong>(and if necessary click the <strong>set post body</strong> link. Add the following text into the body:</p>
<pre class="code"><span style="color: black;">{</span><span style="color: #a31515;">"Name"</span><span style="color: black;">:</span><span style="color: #a31515;">"Widget1"</span><span style="color: black;">}</span></pre>
<p>Click <strong>+ add header</strong> and enter “Content-Type” for the <strong>name</strong> and “application/json; charset=UTF-8” for the value. Click the <strong>Send</strong> button.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_10.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_10.png" width="777" height="584" border="0" /></a></p>
<p>You should get a response like the following:</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_11.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_11.png" width="772" height="177" border="0" /></a></p>
<p>16. Change from <strong>POST</strong> to <strong>GET</strong> and click <strong>Send.</strong> You should get the following response:</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_12.png"><img style="background-image: none; margin: 0px 0px 0px 2px; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_12.png" width="769" height="285" border="0" /></a></p>
<p>Copy the <strong>Id</strong> value – we’ll use this in a moment.</p>
<p>17. Change from <strong>GET</strong> to <strong>PUT</strong>, enter the following information in the body, and click <strong>Send</strong>.</p>
<pre class="code"><span style="color: black;">{</span><span style="color: #a31515;">"Id"</span><span style="color: black;">:</span><span style="color: #a31515;">"a00i0000001RdL4AAK"</span><span style="color: black;">,</span><span style="color: #a31515;">"NewName"</span><span style="color: black;">:</span><span style="color: #a31515;">"Widget1a"</span><span style="color: black;">}</span></pre>
<p>You should get the following response:</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_13.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border-width: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/Create-a_7D04/image_thumb_13.png" width="765" height="131" border="0" /></a></p>
<p>If you quickly flip back to <strong>GET</strong> and click <strong>Send</strong> you’ll see that your record has been updated.</p>
<p>18. Finally, let’s delete the record. Change the URL to <a target="_blank" title="https://wadeapitest-developer-edition.na15.force.com/services/apexrest/Widgets?Id=a01i0000000Z4jzAAC" href="https://wadeapitest-developer-edition.na15.force.com/services/apexrest/Widgets?Id=a01i0000000Z4jzAAC">https://wadeapitest-developer-edition.na15.force.com/services/apexrest/Widgets?Id=a01i0000000Z4jzAAC</a> (again, use your site name and the proper Id value), change from <strong>PUT</strong> (or <strong>GET</strong>) to <strong>DELETE</strong>, and click <strong>Send</strong>. Now the record is gone!</p>
<p>That’s it!</p>
<p>The beauty of this technique is that any platform or language that can communicate over this HTTP methods – i.e. GET, POST, PUT, and DELETE – can execute CRUD operations against your custom object without having to authenticate. Pretty cool!</p>
<p>Now, should you always allow for CRUD over an anonymous set of APIs? Probably not. Just because I’ve shown you how to do it doesn’t mean you should. However, I’m sure you can think of some scenarios when the aforementioned capabilities are useful.</p>
<p>I hope this helps!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=MFhauuKSWOk:6gKLASu5WHk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=MFhauuKSWOk:6gKLASu5WHk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=MFhauuKSWOk:6gKLASu5WHk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=MFhauuKSWOk:6gKLASu5WHk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=MFhauuKSWOk:6gKLASu5WHk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=MFhauuKSWOk:6gKLASu5WHk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=MFhauuKSWOk:6gKLASu5WHk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=MFhauuKSWOk:6gKLASu5WHk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=MFhauuKSWOk:6gKLASu5WHk:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/MFhauuKSWOk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2013/03/creating-anonymous-rest-apis-with-salesforce-com/</feedburner:origLink></item>
		<item>
		<title>A Few Tips on Getting Started with Force.com</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/FPiU_5RGUF4/</link>
		<comments>http://www.wadewegner.com/2013/03/a-few-tips-on-getting-started-with-salesforce-com/#comments</comments>
		<pubDate>Sat, 09 Mar 2013 00:59:17 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[Force.com]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1991</guid>
		<description><![CDATA[Today I got the opportunity to attend a Salesforce.com “hack day” in San Francisco. Quite fun, and I learned a lot from Adam Seligman, Dave Carroll, Pat Patterson, and Akhilesh Gupta. This is a great team: extremely personable, clearly excited about their platform and the technology, and willing to pull up their sleeves and write&#8230; <a href="http://www.wadewegner.com/2013/03/a-few-tips-on-getting-started-with-salesforce-com/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>Today I got the opportunity to attend a Salesforce.com “hack day” in San Francisco. Quite fun, and I learned a lot from <a target="_blank" href="https://twitter.com/adamse" target="_blank">Adam Seligman</a>, <a target="_blank" href="https://twitter.com/dcarroll" target="_blank">Dave Carroll</a>, <a target="_blank" href="https://twitter.com/metadaddy" target="_blank">Pat Patterson</a>, and <a target="_blank" href="https://twitter.com/akhileshgupta" target="_blank">Akhilesh Gupta</a>. This is a great team: extremely personable, clearly excited about their platform and the technology, and willing to pull up their sleeves and write some code. My kind of people.</p>
<p>During the hack day I acquired a few tips for getting started. Nothing earthshattering but useful nonetheless.</p>
<ol>
<li>Setup a <a target="_blank" href="http://www.developerforce.com/events/regular/registration.php" target="_blank">developer account</a>. It’s quick, easy, and free. You can get a lot of them.</li>
<li>Don’t use your production account for development. This may sound trite but I can tell you from first-hand experience that you don’t want to start hacking in production. The Salesforce.com development lifecycle has process for <a target="_blank" href="http://www.salesforce.com/us/developer/docs/dev_lifecycle/Content/deploy.htm" target="_blank">deploying from one environment to another</a>. Use it. Today I didn’t follow this advice and it cost me quite a bit of time. See tip #1 for getting a proper developer account.</li>
<li>Simplify the password requirements for your developer account. First, under your name, choose <strong>Setup</strong>.<a href="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_thumb.png" width="198" height="171" border="0" /></a>
<p>Then type “password” in the search box and click <strong>Password Policies</strong>.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_3.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_thumb_3.png" width="209" height="118" border="0" /></a></p>
<p>Choose some less restrictive policies. It’s up to you – personally, I don’t want my developer account password expiring all the time. <strong>Note</strong>: I do not recommend you do this on your production account.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_4.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_thumb_4.png" width="572" height="260" border="0" /></a></li>
<li>Change the default <strong>IP Restrictions</strong>. Again, for my developer account, I don’t want the platform continually challenging me if I log in from different places. After you browse to <strong>Setup</strong> search for <strong>Profile</strong>. Click on <strong>Profiles</strong>.<a href="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_5.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_thumb_5.png" width="205" height="162" border="0" /></a>
<p>Scroll down until your see <strong>System Administrators</strong> and select it.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_6.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_thumb_6.png" width="590" height="42" border="0" /></a></p>
<p>Scroll down to <strong>IP Address Ranges</strong> and click <strong>New</strong>. Enter default ranges 0.0.0.0 to 255.255.255.255 and click <strong>Save</strong>.</p>
<p><a href="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_7.png"><img style="background-image: none; padding-left: 0px; padding-right: 0px; display: inline; padding-top: 0px; border: 0px;" title="image" alt="image" src="http://www.wadewegner.com/wp-content/uploads/A-Few-Tips-on-Getting-Started-with-S.com_E309/image_thumb_7.png" width="958" height="137" border="0" /></a></li>
</ol>
<p>That’s all for now. For those of you who are pro’s on the platform this is likely not new or exciting. I’m sure there are more tips I’ll learn over time and, when I do, I’ll try to update this list.</p>
<p>I hope this helps!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=FPiU_5RGUF4:Jgf4krfx7iY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=FPiU_5RGUF4:Jgf4krfx7iY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=FPiU_5RGUF4:Jgf4krfx7iY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=FPiU_5RGUF4:Jgf4krfx7iY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=FPiU_5RGUF4:Jgf4krfx7iY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=FPiU_5RGUF4:Jgf4krfx7iY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=FPiU_5RGUF4:Jgf4krfx7iY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=FPiU_5RGUF4:Jgf4krfx7iY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=FPiU_5RGUF4:Jgf4krfx7iY:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/FPiU_5RGUF4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2013/03/a-few-tips-on-getting-started-with-salesforce-com/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2013/03/a-few-tips-on-getting-started-with-salesforce-com/</feedburner:origLink></item>
		<item>
		<title>To The Cloud(s)</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/mxf-43Aal1g/</link>
		<comments>http://www.wadewegner.com/2013/03/to-the-clouds/#comments</comments>
		<pubDate>Wed, 06 Mar 2013 16:26:39 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[Amazon Web Services]]></category>
		<category><![CDATA[Salesforce.com]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1990</guid>
		<description><![CDATA[One of my goals this past year has been to get more hands-on with respects to real-world cloud applications. Working for Aditi has provided many opportunities to dig into some interesting cloud workloads. In addition to building all kinds of applications running in Windows Azure, I’ve learned a lot working with Ryan Dunn and Raghu&#8230; <a href="http://www.wadewegner.com/2013/03/to-the-clouds/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>One of my goals this past year has been to get more hands-on with respects to real-world cloud applications. Working for Aditi has provided many opportunities to dig into some interesting cloud workloads. In addition to building all kinds of applications running in Windows Azure, I’ve learned a lot working with <a target="_blank" href="http://dunnry.com/blog/" target="_blank">Ryan Dunn</a> and <a target="_blank" href="http://niftybits.wordpress.com/" target="_blank">Raghu Rajagopalan</a> on building products (like <a target="_blank" href="http://www.windowsazure.com/en-us/store/service/?id=53765649-ba4b-4fe2-a834-21b334b551e2" target="_blank">Scheduler</a>) that run in the cloud.
<p>Coming from a Windows Azure focus at Microsoft my natural tendency has been to approach most problems with solutions in Windows Azure. It’s amazing how versatile Windows Azure is as a platform; with a little bit of elbow grease there are few problems you can’t solve. That said, what I’ve come to release is, regardless of any platforms merits, there are always cases when you need to leave your comfort zone. For me, this has manifested itself with customers that – for a great many reasons – look to either Amazon Web Services or SalesForce.com for solutions.
<p>Don’t get me wrong. I’m still a huge fan of Windows Azure and incredibly excited by what the platform offers. (And not just because I spent five years of my life working on it!) Just look at the evolution Windows Azure has taken over the last year:
<ul>
<li>Introduced IaaS capabilities last year</li>
<li>Introduced Windows Azure Websites</li>
<li>Introduced Windows Azure Mobile Services </li>
<li>Introduced Media Services</li>
</ul>
<p>… and so much more. There’s never been a better time to build on Windows Azure.
<p>That said, it’s interesting to talk to CIOs and technology leaders at various companies. I’ve found a great many different mental models people have for the cloud. Generally speaking, it appears that when talking to a technical person the cloud is synonymous with AWS; when talking to a businessperson the cloud is synonymous with SalesForce.com. We all ignore these platforms at our own peril. The same can be said for folks focused entirely on AWS or SalesForce.com – you ignore Windows Azure at your own peril.
<p>At the end of the day, no one platform ever has all the answers. If we’re honest with ourselves we have to admit that it’s both worthwhile and important to understand other platforms as well. The desire to learn and to branch out into new areas is natural; furthermore, and most importantly, the needs of customers comes first.
<p>All of this is a way of saying that you’ll start to see me blog more about other cloud platforms – certainly AWS and SalesForce.com, but it’s possible I’ll go even beyond these two. There’s a lot to learn from platforms like Heroku, Google Cloud, and others.
<p>None of this is surprising or revolutionary. Consequently, you may ask yourself, why a long blog post? Well, primarily it’s because I don’t want to give the impression that I’ve given up on Windows Azure. In fact, I’m more excited about the future of Windows Azure than ever before. There’s a lot of opportunity just around the corner.
<p>So … to the cloud(s)!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=mxf-43Aal1g:jgB2leFoOAM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=mxf-43Aal1g:jgB2leFoOAM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=mxf-43Aal1g:jgB2leFoOAM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=mxf-43Aal1g:jgB2leFoOAM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=mxf-43Aal1g:jgB2leFoOAM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=mxf-43Aal1g:jgB2leFoOAM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=mxf-43Aal1g:jgB2leFoOAM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=mxf-43Aal1g:jgB2leFoOAM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=mxf-43Aal1g:jgB2leFoOAM:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/mxf-43Aal1g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2013/03/to-the-clouds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2013/03/to-the-clouds/</feedburner:origLink></item>
		<item>
		<title>Using Windows Azure Virtual Machines to Publish and Synchronize a Web Farm</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/Fs4_x51ja48/</link>
		<comments>http://www.wadewegner.com/2013/03/using-windows-azure-virtual-machines-to-publish-and-synchronize-a-web-farm/#comments</comments>
		<pubDate>Mon, 04 Mar 2013 04:47:29 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[IAAS]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Virtual Machine]]></category>
		<category><![CDATA[Web Deploy]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1977</guid>
		<description><![CDATA[Lately I’ve been attempting to try out a number of different techniques for publishing web applications – both websites and web APIs – to the cloud. I’m being purposely vague when saying “the cloud” – it could be Windows Azure, AWS, or even a traditional hosting provider. It’s likely you saw a great post by&#8230; <a href="http://www.wadewegner.com/2013/03/using-windows-azure-virtual-machines-to-publish-and-synchronize-a-web-farm/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>Lately I’ve been attempting to try out a number of different techniques for publishing web applications – both websites and web APIs – to the cloud. I’m being purposely vague when saying “the cloud” – it could be Windows Azure, AWS, or even a traditional hosting provider. It’s likely you saw a <a target="_blank" href="http://michaelwasham.com/2012/08/13/publishing-and-synchronizing-web-farms-using-windows-azure-virtual-machines/" target="_blank">great post by Michael Washam</a> that provides a solution for using Windows Azure virtual machines along with Web Deploy and a few PowerShell scripts. What’s below is a technique adapted from Michael’s post and detailed for each of the steps. What I like about this approach is that, aside from the machine preparation, the deployment technique is consistent across different platforms.
<p>There are certainly a few things missing below: scripts for scaling up/down, scripts for running Windows update, and so forth. I’ll tackle these in future posts. My point here is to highlight a different way to look at tackling a common problem.</p>
<p>What are some of the advantages to this approach?</p>
<ul>
<li>Near instant deployment.
<li>Fully automated.
<li>Consistent development model with other platforms.
<li>Consistent deployment model with other platforms.</li>
</ul>
<p>I’m sure there are more. There are some limitations as well – in particular, you’re bound by the number of roles you can have in your Cloud Service, which today is (I think) 25. This means that, at most, you can only scale out to 25 virtual machines. I imagine this limitation will be removed at some point (or perhaps you could get around it by using virtual networks).</p>
<p>Regardless, give it a try.</p>
<p><strong>Note</strong>: You can find the PowerShell scripts used below in this gist here: <a target="_blank" title="https://gist.github.com/wadewegner/5080142" href="https://gist.github.com/wadewegner/5080199">https://gist.github.com/wadewegner/5080142</a>.</p>
<p><strong><u><font size="4">Image Preparation</font></u></strong></p>
<p>In this first step you’ll create and customize a virtual machine that you’ll then sysprep and turn into a disk that we’ll use later on.<br />
<h5><u>Create the Base Virtual Machine</u></h5>
<p>This first part takes the longest. This is because you’re preparing the disk you’ll use moving forward. Note that you only do it once – this is not something you have to do over and over again.
<p>1. Create a Virtual Machine.<br />&nbsp;<a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="WAIIASImage1" border="0" alt="WAIIASImage1" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb.png" width="252" height="59"></a>
<p>2. Enter the VM information. Use the default “Windows Server 2012 Datacenter” image. Size doesn’t matter. This VM will sysprepped and used as a disk image for creating future virtual machines.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_3.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="WAIIASImage2" border="0" alt="WAIIASImage2" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_3.png" width="370" height="336"></a></p>
<ul>
<li>Be sure to note the location you use.
<li>Be sure and remember the password. You’ll need it. </li>
</ul>
<p>3. Start the VM.</p>
<ul>
<li>Note: Notice that VMs create a Cloud Service. Each VM is actually a role within </li>
</ul>
<p>4. RDP into the VM once it has provisioned and started.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_4.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="WAIIASImage3" border="0" alt="WAIIASImage3" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_4.png" width="73" height="57"></a> </p>
<p>5. Click to <b>Add roles and features</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_5.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_5.png" width="340" height="145"></a>
<p>6. Leave defaults and click <b>Next</b> until you get to Server Roles.
<p>7. Choose <b>Application Server</b> and <b>Web Server (IIS)</b>. Click <b>Next</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_6.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_6.png" width="624" height="442"></a>
<p>8. Under <b>Features</b> be sure to select <b>ASP.NET 4.5</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_7.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_7.png" width="347" height="88"></a>
<p>9. Click <b>Next</b> until you get to <b>Role Services</b> under <b>Web Server Role (IIS).</b></p>
<p>10. Add <b>ASP.NET 4.5</b> under <b>Application Development</b>. This will add the other default values.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_8.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_8.png" width="348" height="217"></a> </p>
<p>11. Click <b>Next</b> until you get to the last step. Click <b>Install</b>. Wait until the operation completes.
<p><strong><u>Install and Use Windows Azure PowerShell Cmdlets</u></strong></p>
<p>12. From the machine, download the Windows Azure PowerShell Cmdlets. These can be found at: <a target="_blank" href="http://www.windowsazure.com/en-us/downloads/">http://www.windowsazure.com/en-us/downloads/</a>.
<p>13. Install the cmdlets. This can take 5-15 minutes.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_9.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_9.png" width="624" height="428"></a>
<p>14. Create the folder <b>c:&#92;&#92;Scripts</b>.
<p>15. Run the following script in <b>Windows PowerShell ISE</b> to download your publish settings file:</p>
<p>Get-AzurePublishSettingsFile </p>
<p>16. Save or move this file into the <b>c:&#92;&#92;Scripts</b> folder and rename to <b>credentials.publishsettings</b>.
<p>17. Run the following script in <b>Windows PowerShell ISE</b> to change the execution policy:<br />Set-ExecutionPolicy Unrestricted
<p><strong><u>Setup Web Deploy</u></strong></p>
<p>18. Download <b>Web Deploy 3.0</b> from the following link: <a target="_blank" href="http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi">http://download.microsoft.com/download/1/B/3/1B3F8377-CFE1-4B40-8402-AE1FC6A0A8C3/WebDeploy_amd64_en-US.msi</a>. <b>Do not install</b>. To simplify, download to C:&#92;&#92;.
<p>19. Open a <b>Command Prompt</b>.
<p>20. Run the following command:
<p><font size="2"><font face="Courier New">C:&#92;&#92;&gt;msiexec /I webdeploy_amd64_en-us.msi /passive ADDLOCAL=ALL LISTENURL=http://+:8080/</font><br /></font><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_10.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_10.png" width="626" height="315"></a> </p>
<p><strong><u>Configure Firewall Settings</u></strong></p>
<p>21. Run <b>Windows Firewall with Advanced Security</b>.
<p>22. Select <b>Inbound Rules</b> and click <b>New Rule</b>.
<p>23. Select <b>Port</b> and click <b>Next</b>.
<p>24. Level TCP selected and enter <b>8080</b> for the <b>Specific local ports</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_11.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_11.png" width="624" height="504"></a>
<p>25. Keep the defaults and click <b>Next</b> until prompted to give a name. Choose a name (e.g. Web Deploy Port) and click <b>Finish</b>.
<p><strong><u>System Preparation</u></strong></p>
<p>26. Open a <b>Command Prompt</b> as an administrator.
<p>27. Change the directory to: <font face="Courier New">%windir%&#92;&#92;system32&#92;&#92;sysprep</font>
<p>28. Run <b>sysprep.exe</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_12.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_12.png" width="626" height="429"></a>
<p>29. Ensure the following options are selected:
<ul>
<li>Enter System Out-of-Box Experience (OOBE)
<li>Generalize
<li>Shutdown<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_13.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_13.png" width="354" height="267"></a> </li>
</ul>
<p><strong><u>Capture the Virtual Machine</u></strong></p>
<p>30. Return to your Virtual Machine Instances tab in the portal: <a target="_blank" href="https://manage.windowsazure.com/#Workspace/VirtualMachineExtension/vms">https://manage.windowsazure.com/#Workspace/VirtualMachineExtension/vms</a>.
<p>31. Wait until you see that the status of your virtual machine is <b>Stopped</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_14.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_14.png" width="626" height="78"></a>
<p>32. Capture the image by clicking the <b>CAPTURE</b> button below.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/clip_image024.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image024" border="0" alt="clip_image024" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/clip_image024_thumb.png" width="113" height="78"></a>
<p>33. Select an image name (e.g. WS2012-WebFarmImage) and check that you have sysprepped the machine. Click the button.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_15.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_15.png" width="524" height="411"></a>
<p>34. When the capture operation completes you’ll see the disk image available under <b>Images</b> in the portal: <a target="_blank" href="https://manage.windowsazure.com/#Workspaces/VirtualMachineExtension/images">https://manage.windowsazure.com/#Workspaces/VirtualMachineExtension/images</a>
<p><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_16.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_16.png" width="576" height="95"></a>
<p><strong><u><font size="4">Virtual Machine Deployment</font></u></strong></p>
<p>You’ll run these steps from your own PC.
<p>1. Open the <b>Windows PowerShell ISE</b> to run the following scripts. It’s always a good idea to save them somewhere to use later.
<p>2. You might need to import your publish settings. If so, download your publish settings file, save it, then import it.</p>
<p><font size="2" face="Courier New">Get-AzurePublishSettingsFile</font></p>
<p><font size="2" face="Courier New">Import-AzurePublishSettingsFile C:&#92;&#92;credentials.publishsettings</font> </p>
<p>3. Get the subscription name to which you’ll deploy. Run the following script:</p>
<p><font size="2" face="Courier New">Get-AzureSubscription -Current</font><br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_17.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_17.png" width="525" height="73"></a> </p>
<p>4. You need to get the storage account that contains your disk image. You’ll need to use the same storage account for the disks attached to the web servers in your web farm. Select the <b>Images</b> tab under <b>Virtual Machines</b> on the portal. Find your image and look at the location. The first part of the URL is the storage account name.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_18.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_18.png" width="341" height="98"></a> </p>
<p>5. It’s now time to deploy your web farm using the disk image you created in the previous section. Review the following script and update appropriately.
<pre class="code"><span style="color: black">$imgname = </span><span style="color: #a31515">'WS2012-WebFarmImage'
</span><span style="color: black">$cloudsvc = </span><span style="color: #a31515">'DemoWebFarm'
</span><span style="color: black">$pass = </span><span style="color: #a31515">'Password'
</span><span style="color: black">$subscriptionName = </span><span style="color: #a31515">'Windows Azure MSDN - Visual Studio Ultimate'
</span><span style="color: black">$storageAccount = </span><span style="color: #a31515">'portalvhds9dvbvvff5hdg3'
</span><span style="color: black">$location = </span><span style="color: #a31515">'East US'

</span><span style="color: black">Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccount $storageAccount

$iisvm1 = New-AzureVMConfig -Name </span><span style="color: #a31515">'iis1' </span><span style="color: black">-InstanceSize Small -ImageName $imgname |
    Add-AzureEndpoint -Name web -LocalPort 80 -PublicPort 80 -Protocol tcp -LBSetName web -ProbePath </span><span style="color: #a31515">'/' </span><span style="color: black">-ProbeProtocol http -ProbePort 80 |
    Add-AzureEndpoint -Name webdeploy -LocalPort 8080 -PublicPort 8080 -Protocol tcp | 
    Add-AzureProvisioningConfig -Windows -Password $pass
    
$iisvm2 = New-AzureVMConfig -Name </span><span style="color: #a31515">'iis2' </span><span style="color: black">-InstanceSize Small -ImageName $imgname |
    Add-AzureEndpoint -Name web -LocalPort 80 -PublicPort 80 -Protocol tcp -LBSetName web -ProbePath </span><span style="color: #a31515">'/' </span><span style="color: black">-ProbeProtocol http -ProbePort 80 |
    Add-AzureProvisioningConfig -Windows -Password $pass
    
$iisvm3 = New-AzureVMConfig -Name </span><span style="color: #a31515">'iis3' </span><span style="color: black">-InstanceSize Small -ImageName $imgname |
    Add-AzureEndpoint -Name web -LocalPort 80 -PublicPort 80 -Protocol tcp -LBSetName web -ProbePath </span><span style="color: #a31515">'/' </span><span style="color: black">-ProbeProtocol http -ProbePort 80 |
    Add-AzureProvisioningConfig -Windows -Password $pass    
    
New-AzureVM -ServiceName $cloudsvc -VMs $iisvm1, $iisvm2, $iisvm3 -Location $location</span></pre>
<p>Notes on script: </p>
<ul>
<li><b>$imgname</b>: This is the name of the disk image you created.
<li><b>$cloudsvc</b>: When you deploy it will create a cloud service. This is the name for the cloud service.
<li><b>$pass</b>: This is the password for the virtual machine you created.
<li><b>$subscriptionName</b>: This is your subscription name.
<li><b>$location</b>: The datacenter you want to deploy into. Note: this has to be the same data center as your storage account. </li>
</ul>
<p>It is <u>important</u> to note that the setup for $iisvm1 is different than $iisvm2 and $iisvm3. That’s because we’re adding an additional endpoint named <b>webdeploy</b> on 8080. We’ll use this public port for deploying via web deploy. It is not opened on the other machines. </p>
<p>6. It’s time to run the script. Note: the script does not rollback. If you have values that are incorrect you’ll have to clean them up manually. If all goes well, you’ll see progress indicators like the following:<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_19.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_19.png" width="606" height="268"></a><br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_20.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_20.png" width="529" height="116"></a> </p>
<p>7. You can now look in the portal and you’ll see the following machines Running/Provisioning.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_21.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_21.png" width="626" height="232"></a> </p>
<p>8. You can browse the URL, for example: <a target="_blank" href="http://demowebfarm.cloudapp.net">http://demowebfarm.cloudapp.net</a>. You’ll get the standard IIS page:<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_22.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_22.png" width="626" height="340"></a> </p>
<p><strong><u><font size="4">Setup Synchronization across Virtual Machines</font></u></strong></p>
<p>1. Remote into <b>iis1</b>. From the portal, select <b>iis1</b> under <b>Virtual Machine Instances</b> and click the <b>CONNECT</b> button. This will download an RDP file. Save this and use it for connecting to the machine later.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/clip_image039.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="clip_image039" border="0" alt="clip_image039" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/clip_image039_thumb.png" width="67" height="66"></a> </p>
<p>2. Open <b>Windows PowerShell ISE</b>. </p>
<p>3. Click <b>New</b> to create a new script. </p>
<p>4. Copy the following script and save it as <b>C:&#92;&#92;Scripts&#92;&#92;Sync.ps1</b>. DO NOT RUN IT.
<pre class="code"><span style="color: black">$subscriptionName = </span><span style="color: #a31515">'Windows Azure MSDN - Visual Studio Ultimate'
</span><span style="color: black">$storageAccount = </span><span style="color: #a31515">'portalvhds9dvbvvff5hdg3'
</span><span style="color: black">$cloudsvc = </span><span style="color: #a31515">' DemoWebFarm' 
</span><span style="color: black">$publishSettings = </span><span style="color: #a31515">'C:&#92;&#92;Scripts&#92;&#92;credentials.publishsettings'

</span><span style="color: black">Import-Module </span><span style="color: #a31515">'C:&#92;&#92;Program Files (x86)&#92;&#92;Microsoft SDKs&#92;&#92;Windows Azure&#92;&#92;PowerShell&#92;&#92;Azure&#92;&#92;Azure.psd1'

</span><span style="color: black">Import-AzurePublishSettingsFile $publishSettings
Set-AzureSubscription -SubscriptionName $subscriptionName -CurrentStorageAccount $storageAccount

$publishingServer = (gc env:computername).toLower()

Get-AzureVM -ServiceName $cloudsvc | </span><span style="color: blue">foreach </span><span style="color: black">{ 
    </span><span style="color: blue">if </span><span style="color: black">($_.Name.toLower() -ne $publishingServer) {
       $target = $_.Name + </span><span style="color: #a31515">":8080"
       </span><span style="color: black">$source = $publishingServer + </span><span style="color: #a31515">":8080"

       </span><span style="color: black">$exe = </span><span style="color: #a31515">"C:&#92;&#92;Program Files&#92;&#92;IIS&#92;&#92;Microsoft Web Deploy V3&#92;&#92;msdeploy.exe"
       </span><span style="color: black">[Array]$</span><span style="color: blue">params </span><span style="color: black">= </span><span style="color: #a31515">"-verb:sync"</span><span style="color: black">, </span><span style="color: #a31515">"-source:contentPath=C:&#92;&#92;Inetpub&#92;&#92;wwwroot,computerName=$source"</span><span style="color: black">, </span><span style="color: #a31515">"-dest:contentPath=C:&#92;&#92;Inetpub&#92;&#92;wwwroot,computerName=$target"</span><span style="color: black">;

        &amp; $exe $</span><span style="color: blue">params</span><span style="color: black">;
    }   
}</span></pre>
<p><strong><u><font size="4"></p>
<p>Create a Scheduled Task</font></u></strong></p>
<p>5. Open <b>Task Scheduler</b>. </p>
<p>6. Click <b>Create Task …<br /></b><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_23.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_23.png" width="624" height="445"></a><b><br /></b></p>
<p>7. On the <b>General </b>tab set the <b>Name</b> and <b>Run wehather user is logged on or not</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_24.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_24.png" width="624" height="470"></a> </p>
<p>8. On the <b>Triggers</b> tab click <b>New</b>. Create a <b>Daily</b> trigger and <b>Repeat task every</b> 2 minutes. Click <b>OK</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_25.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_25.png" width="605" height="523"></a> </p>
<p>9. On the <b>Actions</b> tab click <b>New</b>. Set the following values:</p>
<p><font size="2"><b>Program/script</b>: <font face="Courier New">C:&#92;&#92;Windows&#92;&#92;System32&#92;&#92;WindowsPowerShell&#92;&#92;v1.0&#92;&#92;powershell.</font>exe<br /><b>Add arguments</b>: <font face="Courier New">-File C:&#92;&#92;Scripts&#92;&#92;Sync.ps1<br /></font></font><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_26.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_26.png" width="468" height="507"></a> </p>
<p>10. You should now see this as a scheduled task.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_27.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_27.png" width="626" height="66"></a> </p>
<p>11. You can wait for this to run or run it manually. It should run successfully.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_28.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_28.png" width="626" height="60"></a> </p>
<p><strong><u><font size="4">Deploy a Website through Web Deploy</font></u></strong></p>
<p>1. Create a new <b>ASP.NET MVC 4 Web Applications</b>. (In actually it can be anything.) Choose an <b>Internet Application</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_29.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_29.png" width="501" height="65"></a> </p>
<p>2. Update the <b>HomeController.cs</b> code:
<pre class="code"><span style="color: blue">public </span><span style="color: black">ActionResult Index()
{
    </span><span style="color: blue">string </span><span style="color: black">machineName = </span><span style="color: #2b91af">Environment</span><span style="color: black">.MachineName;
    ViewBag.Message = </span><span style="color: #a31515">"Computer Name: " </span><span style="color: black">+ machineName;

    </span><span style="color: blue">return </span><span style="color: black">View();
}</span></pre>
<p>3. Right-click on your application and click <b>Publish</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_30.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_30.png" width="608" height="178"></a> </p>
<p>4. In the dropdown select <b>New</b>.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_31.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_31.png" width="409" height="104"></a> </p>
<p>5. Give your publish profile a name. Click OK.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_32.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_32.png" width="354" height="155"></a> </p>
<p>6. Update all the fields:<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_33.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_33.png" width="624" height="490"></a> </p>
<ul>
<li><b>Server</b>: This is the DNS name of the cloud service with port 8080.
<li><b>Site name</b>: This needs to be “Default Web Site”.
<li><b>User name</b>: This is the administrator account.
<li><b>Password</b>: The password you set.
<li><b>Destination URL</b>: The same as server without the ports. </li>
</ul>
<p>7. Click <b>Publish.</b></p>
<p>8. In Visual Studio you should see that it deployed successfully.<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_34.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_34.png" width="590" height="181"></a></p>
<blockquote>
<p><font size="2"><b>WARNING</b>: Don’t be alarmed if the browser opens and you don’t see your site. Remember that we set synchronization at two minutes and you have a 66% chance of hitting iis2 or iis3. </font></p>
</blockquote>
<p>9. If you go back to your RDP session with <b>iis1</b> and browse to C:&#92;&#92;inetpub&#92;&#92;wwwroot you’ll see all your content has been deployed. </p>
<p>10. Either way two minutes or manually invoke your synchronization task. Hit the website again and start refreshing:<br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_35.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_35.png" width="626" height="389"></a><br /><a href="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_36.png"><img style="background-image: none; border-right-width: 0px; margin: 5px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wadewegner.com/wp-content/uploads/acc7ea03346c_12181/image_thumb_36.png" width="654" height="386"></a> </p>
<p>That’s it!</p>
<p>Yeah, that might seem like a lot but realize that most of the work detailed here – such as the image preparation – you’ll only have to do one time. The rest of the time you’re using tools like PowerShell and Visual Studio.</p>
<p>Enjoy!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=Fs4_x51ja48:2ccz9bfh9EA:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=Fs4_x51ja48:2ccz9bfh9EA:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=Fs4_x51ja48:2ccz9bfh9EA:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=Fs4_x51ja48:2ccz9bfh9EA:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=Fs4_x51ja48:2ccz9bfh9EA:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=Fs4_x51ja48:2ccz9bfh9EA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=Fs4_x51ja48:2ccz9bfh9EA:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=Fs4_x51ja48:2ccz9bfh9EA:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=Fs4_x51ja48:2ccz9bfh9EA:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/Fs4_x51ja48" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2013/03/using-windows-azure-virtual-machines-to-publish-and-synchronize-a-web-farm/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2013/03/using-windows-azure-virtual-machines-to-publish-and-synchronize-a-web-farm/</feedburner:origLink></item>
		<item>
		<title>Detecting Expired PKI Certificates</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/KjEx_U_w25s/</link>
		<comments>http://www.wadewegner.com/2013/02/detecting-expired-pki-certificates/#comments</comments>
		<pubDate>Sat, 23 Feb 2013 19:06:27 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Certificates]]></category>
		<category><![CDATA[PKI]]></category>
		<category><![CDATA[SSL]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1887</guid>
		<description><![CDATA[Yesterday Windows Azure experienced a worldwide disruption in many services due to an expired PKI certificate for Windows Azure storage. Mary Jo Foley’s article Windows Azure storage issue: Expired HTTPS certificate possibly at fault provides the best coverage of the event as it unfolded. You can also take a look at a few threads on&#8230; <a href="http://www.wadewegner.com/2013/02/detecting-expired-pki-certificates/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>Yesterday Windows Azure experienced a worldwide disruption in many services due to an expired PKI certificate for Windows Azure storage. Mary Jo Foley’s article <a target="_blank" href="http://www.zdnet.com/windows-azure-storage-issue-expired-https-certificate-possibly-at-fault-7000011705/" target="_blank">Windows Azure storage issue: Expired HTTPS certificate possibly at fault</a> provides the best coverage of the event as it unfolded. You can also take a look at a few threads on the <a target="_blank" href="http://social.msdn.microsoft.com/Forums/en-US/windowsazuredata/thread/751c85c5-b3b5-43ba-9d5b-770472ad79e1" target="_blank">Windows Azure forum</a> and <a target="_blank" href="http://stackoverflow.com/questions/15033020/windows-azure-storage-certificate-expired" target="_blank">Stack Overflow</a> that provide a lot of commentary on the event. The effects of this disruption rippled through most of the other Windows Azure services. Even if you modified your application to use HTTP instead of HTTPS it’s likely you still had issues given that the rest of the platform was crippled by the expired certificate.</p>
<p>It’s disappointing this happened but highlights a pretty common situation. This has nothing to do with the merits of the Windows Azure storage service or any other parts of the platform – this is an operations management issue, plain and simple. The irony is that, as a number of folks <a target="_blank" href="https://twitter.com/larsw/status/305375364534902784" target="_blank">including Lars Wilhelmsen</a> have pointed out, there are tools like Microsoft SCOM that provide a Certificate Management Pack that can notify operations of expiring certificates. I can’t imagine the operations team at Windows Azure doesn’t use some kind of tool to manage expiring certificates.</p>
<p>As a developer, I found myself curious to see just how hard it is to determine the expiration of a certificate by checking the URI. Turns out, it’s pretty simple by using <font face="Courier New">System.Net.ServicePoint</font> which provides connection management for HTTP/S connections.</p>
<pre class="code"><span style="color: blue">private string </span><span style="color: black">GetSSLExpiryDate()
{
    </span><span style="color: blue">string </span><span style="color: black">url = </span><span style="color: #a31515">"https://www.aditicloud.com/"</span><span style="color: black">;
    </span><span style="color: blue">var </span><span style="color: black">request = </span><span style="color: #2b91af">WebRequest</span><span style="color: black">.Create(url) </span><span style="color: blue">as </span><span style="color: #2b91af">HttpWebRequest</span><span style="color: black">;
    </span><span style="color: blue">var </span><span style="color: black">response = request.GetResponse();

    </span><span style="color: blue">if </span><span style="color: black">(request.ServicePoint.Certificate != </span><span style="color: blue">null</span><span style="color: black">)
    {
        </span><span style="color: blue">return </span><span style="color: black">request.ServicePoint.Certificate.GetExpirationDateString();
    }
    </span><span style="color: blue">else
    </span><span style="color: black">{
        </span><span style="color: blue">return string</span><span style="color: black">.Empty;
    }
}</span></pre>
<p>Pretty simple. What’s hard is the practice of managing and tracking these sorts of things.</p>
<p>I would expect that Microsoft will ensure that this kind of problem never happens again. It’s embarrassing yet solvable. Yet it exposes an issue that most of us will also have to account for – expiring certificates. If it can happen to Microsoft, it can happen to us too.</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=KjEx_U_w25s:yaeFHe2didM:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=KjEx_U_w25s:yaeFHe2didM:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=KjEx_U_w25s:yaeFHe2didM:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=KjEx_U_w25s:yaeFHe2didM:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=KjEx_U_w25s:yaeFHe2didM:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=KjEx_U_w25s:yaeFHe2didM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=KjEx_U_w25s:yaeFHe2didM:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=KjEx_U_w25s:yaeFHe2didM:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=KjEx_U_w25s:yaeFHe2didM:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/KjEx_U_w25s" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2013/02/detecting-expired-pki-certificates/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2013/02/detecting-expired-pki-certificates/</feedburner:origLink></item>
		<item>
		<title>Getting the Application ID and Hardware ID in Windows Store Applications</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/WmnWu1cvkj4/</link>
		<comments>http://www.wadewegner.com/2012/09/getting-the-application-id-and-hardware-id-in-windows-store-applications/#comments</comments>
		<pubDate>Fri, 21 Sep 2012 22:02:42 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[Windows 8]]></category>
		<category><![CDATA[Windows Store]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1875</guid>
		<description><![CDATA[So far I’ve really enjoyed developing applications for Windows 8. I still can’t claim to be particularly good at XAML design work yet, but I’m getting the hang of Windows Store Apps in C# using Windows RT. That said, there are have been a number of times when I’ve been lost and had to hit&#8230; <a href="http://www.wadewegner.com/2012/09/getting-the-application-id-and-hardware-id-in-windows-store-applications/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>So far I’ve really enjoyed developing applications for Windows 8. I still can’t claim to be particularly good at XAML design work yet, but I’m getting the hang of Windows Store Apps in C# using Windows RT. That said, there are have been a number of times when I’ve been lost and had to hit MSDN and search engines in order to figure things out. What makes this particularly challenging is that much of the information you’ll find is old and not appropriate for Windows 8 RTM. Consequently, I thought I’d share with you at least one thing I learned today.</p>
<p>Today I wanted to do two things.</p>
<ol>
<li>Get an ID specific to the application.</li>
<li>Get an ID specific to the device/hardware (also called App Specific Hardware ID or ASHWID).</li>
</ol>
<p>There are a lot of different reasons for wanting this information. For me, I’m storing this information in a Windows Azure table along with a <a target="_blank" href="http://msdn.microsoft.com/en-us/library/windows/apps/hh913756.aspx" target="_blank">Windows Notification Service (WNS)</a> Channel URI so that I can choose the right application and device to send notifications.</p>
<p>While trying to figure out how to get the Application ID wasn’t particularly difficult – that is, if you find the RTM documentation – I did struggle to figure out how to get the device/hardware ID. Finally, I found an <a target="_blank" href="http://stackoverflow.com/questions/12528186/how-do-i-get-a-unique-identifier-for-a-machine-running-windows-8-in-c" target="_blank">answer on Stack Overflow</a> that helped.</p>
<p>Here’s how to get the application ID with C#:</p>
<pre class="code"><span style="background: white; color: blue">string </span><span style="background: white; color: black">appId = </span><span style="background: white; color: #2b91af">CurrentApp</span><span style="background: white; color: black">.AppId.ToString();</span></pre>
<p>Note that during development the GUID comes back as &#8220;00000000-0000-0000-0000-000000000000&#8243;. Once released through the Windows Store you will get a specific value.</p>
<p>Getting the ASHWID is a bit more difficult. Prior to the RTM release a lot of folks created their own GUID and stored it in the Windows.Storage.ApplicationData.Current.LocalSettings. This is a reasonable hack but of course the user can delete local storage and then your application would change the value – not good if you’re depending on something unique.</p>
<p>Fortunately the RTM release includes the GetPackageSpecificToken class that can return the ASHWID. Of course, I looked at some <a target="_blank" href="http://msdn.microsoft.com/en-us/library/windows/apps/jj553431" target="_blank">guidance</a> and <a target="_blank" href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.system.profile.hardwareidentification.getpackagespecifictoken" target="_blank">MSDN method documentation</a> on getting the ASHWID and never found a good sample on how to get the ASHWID and store it as a string. Consequently, I hope this short snippet – again, found on Stack Overflow, helps:</p>
<pre class="code"><span style="background: white; color: blue">private string </span><span style="background: white; color: black">GetHardwareId()
{
    </span><span style="background: white; color: blue">var </span><span style="background: white; color: black">token = </span><span style="background: white; color: #2b91af">HardwareIdentification</span><span style="background: white; color: black">.GetPackageSpecificToken(</span><span style="background: white; color: blue">null</span><span style="background: white; color: black">);
    </span><span style="background: white; color: blue">var </span><span style="background: white; color: black">hardwareId = token.Id;
    </span><span style="background: white; color: blue">var </span><span style="background: white; color: black">dataReader = Windows.Storage.Streams.</span><span style="background: white; color: #2b91af">DataReader</span><span style="background: white; color: black">.FromBuffer(hardwareId);

    </span><span style="background: white; color: blue">byte</span><span style="background: white; color: black">[] bytes = </span><span style="background: white; color: blue">new byte</span><span style="background: white; color: black">[hardwareId.Length];
    dataReader.ReadBytes(bytes);

    </span><span style="background: white; color: blue">return </span><span style="background: white; color: #2b91af">BitConverter</span><span style="background: white; color: black">.ToString(bytes);
}  </span></pre>
<p>From here you can just load it into a string and do whatever you desire.</p>
<pre class="code"><span style="background: white; color: blue">string </span><span style="background: white; color: black">deviceId = GetHardwareId(); </span></pre>
<p>Now you’ll get a value that’s something like 03-00-F0-7E-03-00-76-F3-05-00-5C-54-05-00-8A-DE-06-00-01-00-04-00-54-49-04-00-C2-4A-04-00-DE-4D-01-00-A4-52-02-00-2E-B2-09-00-42-88 that you can store for future use.</p>
<p>Nothing groundbreaking here but hopefully this saves you a few minutes.</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WmnWu1cvkj4:9oc_A_hVQBk:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WmnWu1cvkj4:9oc_A_hVQBk:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=WmnWu1cvkj4:9oc_A_hVQBk:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WmnWu1cvkj4:9oc_A_hVQBk:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=WmnWu1cvkj4:9oc_A_hVQBk:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WmnWu1cvkj4:9oc_A_hVQBk:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WmnWu1cvkj4:9oc_A_hVQBk:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WmnWu1cvkj4:9oc_A_hVQBk:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=WmnWu1cvkj4:9oc_A_hVQBk:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/WmnWu1cvkj4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2012/09/getting-the-application-id-and-hardware-id-in-windows-store-applications/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2012/09/getting-the-application-id-and-hardware-id-in-windows-store-applications/</feedburner:origLink></item>
		<item>
		<title>Generating C# Classes from JSON</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/WK3WZh64oNc/</link>
		<comments>http://www.wadewegner.com/2012/08/generating-c-classes-from-json/#comments</comments>
		<pubDate>Wed, 22 Aug 2012 13:15:03 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[JSON]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1841</guid>
		<description><![CDATA[I’ve long advocated using JSON when building mobile and cloud applications. If nothing else, the payload size makes it extremely efficient when transferred over the wire – take a look at the size of the same information formatted as OData, REST-XML, and lastly JSON: Pretty compelling. Despite the use of JSON – and great frameworks&#8230; <a href="http://www.wadewegner.com/2012/08/generating-c-classes-from-json/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>I’ve long advocated using JSON when building mobile and cloud applications. If nothing else, the payload size makes it extremely efficient when transferred over the wire – take a look at the size of the same information formatted as OData, REST-XML, and lastly JSON:</p>
<p><img title="JSON versus OData versus REST-XML" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="JSON versus OData versus REST-XML" src="http://images.wadewegner.com/wordpress/2012/08/JSON.png" width="794" height="366" /></p>
<p>Pretty compelling.</p>
<p>Despite the use of JSON – and great frameworks like <a target="_blank" href="http://json.codeplex.com/">JSON.NET</a> and <a target="_blank" href="https://github.com/facebook-csharp-sdk/simple-json">SimpleJson</a> – I always struggled with creating my C# classes when working with an existing web service that returned JSON. It can take a long time to create these C# classes correctly, and often time I’d take a lazy approach and either use the <font face="Courier New">JObject</font> or an <font face="Courier New">IDictionary</font> such that I didn’t have to have a C# class – something like:</p>
<pre class="code"><span style="color: blue">var </span>json = (<span style="color: #2b91af">IDictionary</span>&lt;<span style="color: blue">string</span>, <span style="color: blue">object</span>&gt;)<span style="color: #2b91af">SimpleJson</span>.DeserializeObject(data);</pre>
<p>Yesterday I stumbled upon a tool that makes this SO amazingly easy. In many ways I’m bothered by the fact that it’s taken me so long to find it – has this been one of the best kept secrets on the Internet or did I just miss it?</p>
<p><a target="_blank" href="http://json2csharp.com/">http://json2csharp.com/</a></p>
<p>This website is as simple as it is powerful. Simply paste your JSON into the textbox, click Generate, and voilà you have C# objects!</p>
<p>Take a look. Here’s some JSON returned back from the <a target="_blank" href="http://untappd.com/api/" target="_blank">Untappd API</a>:</p>
<pre class="code"><span style="background: white; color: black">{
  </span><span style="background: white; color: #a31515">&quot;meta&quot;</span><span style="background: white; color: black">: {
    </span><span style="background: white; color: #a31515">&quot;code&quot;</span><span style="background: white; color: black">: 200,
    </span><span style="background: white; color: #a31515">&quot;response_time&quot;</span><span style="background: white; color: black">: {
      </span><span style="background: white; color: #a31515">&quot;time&quot;</span><span style="background: white; color: black">: 0.109,
      </span><span style="background: white; color: #a31515">&quot;measure&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;seconds&quot;
    </span><span style="background: white; color: black">}
  },
  </span><span style="background: white; color: #a31515">&quot;notifications&quot;</span><span style="background: white; color: black">: [],
  </span><span style="background: white; color: #a31515">&quot;response&quot;</span><span style="background: white; color: black">: {
    </span><span style="background: white; color: #a31515">&quot;pagination&quot;</span><span style="background: white; color: black">: {
      </span><span style="background: white; color: #a31515">&quot;next_url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;http://api.untappd.com/v4/thepub?max_id=11697698&quot;</span><span style="background: white; color: black">,
      </span><span style="background: white; color: #a31515">&quot;max_id&quot;</span><span style="background: white; color: black">: 11697698,
      </span><span style="background: white; color: #a31515">&quot;since_url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;http://api.untappd.com/v4/thepub?min_id=11697724&quot;
    </span><span style="background: white; color: black">},
    </span><span style="background: white; color: #a31515">&quot;checkins&quot;</span><span style="background: white; color: black">: {
      </span><span style="background: white; color: #a31515">&quot;count&quot;</span><span style="background: white; color: black">: 2,
      </span><span style="background: white; color: #a31515">&quot;items&quot;</span><span style="background: white; color: black">: [
        {
          </span><span style="background: white; color: #a31515">&quot;checkin_id&quot;</span><span style="background: white; color: black">: 11697724,
          </span><span style="background: white; color: #a31515">&quot;created_at&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Wed, 22 Aug 2012 12:56:41 +0000&quot;</span><span style="background: white; color: black">,
          </span><span style="background: white; color: #a31515">&quot;checkin_comment&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
          </span><span style="background: white; color: #a31515">&quot;user&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;uid&quot;</span><span style="background: white; color: black">: 205218,
            </span><span style="background: white; color: #a31515">&quot;user_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;asiahobo&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;first_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Bum&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;last_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;location&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;relationship&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">null</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;bio&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;0&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;user_avatar&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;https://untappd.s3.amazonaws.com/profile/7d21ba831edb33341b98f86e09795ed7_thumb.jpg&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;contact&quot;</span><span style="background: white; color: black">: {
              </span><span style="background: white; color: #a31515">&quot;twitter&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;asiahobo&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;foursquare&quot;</span><span style="background: white; color: black">: 31652652
            }
          },
          </span><span style="background: white; color: #a31515">&quot;beer&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;bid&quot;</span><span style="background: white; color: black">: 9652,
            </span><span style="background: white; color: #a31515">&quot;beer_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Maredsous 8° Brune&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;beer_label&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;https://untappd.s3.amazonaws.com/site/beer_logos/beer-maredsous.jpg&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;beer_style&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Belgian Dubbel&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;auth_rating&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;wish_list&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false
          </span><span style="background: white; color: black">},
          </span><span style="background: white; color: #a31515">&quot;brewery&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;brewery_id&quot;</span><span style="background: white; color: black">: 6,
            </span><span style="background: white; color: #a31515">&quot;brewery_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Abbaye de Maredsous (Duvel Moortgat)&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;brewery_label&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;https://untappd.s3.amazonaws.com/site/brewery_logos/brewery-AbbayedeMaredsousDuvelMoortgat_6.jpeg&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;country_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Belgium&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;contact&quot;</span><span style="background: white; color: black">: {
              </span><span style="background: white; color: #a31515">&quot;twitter&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;facebook&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;www.facebook.com/pages/Abbaye-De-Maredsous/208016262548587fine&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;www.maredsous.be/&quot;
            </span><span style="background: white; color: black">},
            </span><span style="background: white; color: #a31515">&quot;location&quot;</span><span style="background: white; color: black">: {
              </span><span style="background: white; color: #a31515">&quot;brewery_city&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;brewery_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Denée&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;lat&quot;</span><span style="background: white; color: black">: 50.3044,
              </span><span style="background: white; color: #a31515">&quot;lng&quot;</span><span style="background: white; color: black">: 4.77149
            }
          },
          </span><span style="background: white; color: #a31515">&quot;venue&quot;</span><span style="background: white; color: black">: [],
          </span><span style="background: white; color: #a31515">&quot;comments&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;count&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;items&quot;</span><span style="background: white; color: black">: []
          },
          </span><span style="background: white; color: #a31515">&quot;toasts&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;count&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;auth_toast&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">null</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;items&quot;</span><span style="background: white; color: black">: []
          },
          </span><span style="background: white; color: #a31515">&quot;media&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;count&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;items&quot;</span><span style="background: white; color: black">: []
          }
        },
        {
          </span><span style="background: white; color: #a31515">&quot;checkin_id&quot;</span><span style="background: white; color: black">: 11697723,
          </span><span style="background: white; color: #a31515">&quot;created_at&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Wed, 22 Aug 2012 12:56:35 +0000&quot;</span><span style="background: white; color: black">,
          </span><span style="background: white; color: #a31515">&quot;checkin_comment&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
          </span><span style="background: white; color: #a31515">&quot;user&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;uid&quot;</span><span style="background: white; color: black">: 137722,
            </span><span style="background: white; color: #a31515">&quot;user_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Mjoepp&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;first_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Christoffer&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;last_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;location&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Linköping&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;relationship&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">null</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;bio&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;user_avatar&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;http://gravatar.com/avatar/f1672535a7caa3bd686267257d33c588?size=100&amp;d=https%3A%2F%2Funtappd.s3.amazonaws.com%2Fsite%2Fassets%2Fimages%2Fdefault_avatar.jpg&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;contact&quot;</span><span style="background: white; color: black">: {
              </span><span style="background: white; color: #a31515">&quot;foursquare&quot;</span><span style="background: white; color: black">: 25958771
            }
          },
          </span><span style="background: white; color: #a31515">&quot;beer&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;bid&quot;</span><span style="background: white; color: black">: 12145,
            </span><span style="background: white; color: #a31515">&quot;beer_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Chocolate&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;beer_label&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;https://untappd.s3.amazonaws.com/site/beer_logos/beer-ChocolatePorter_12145.jpeg&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;beer_style&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;English Porter&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;auth_rating&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;wish_list&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">false
          </span><span style="background: white; color: black">},
          </span><span style="background: white; color: #a31515">&quot;brewery&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;brewery_id&quot;</span><span style="background: white; color: black">: 844,
            </span><span style="background: white; color: #a31515">&quot;brewery_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;Meantime Brewing Company&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;brewery_label&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;https://untappd.s3.amazonaws.com/site/brewery_logos/brewery-MeantimeBrewingCompanyLimited_844.jpeg&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;country_name&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;England&quot;</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;contact&quot;</span><span style="background: white; color: black">: {
              </span><span style="background: white; color: #a31515">&quot;twitter&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;MeantimeBrewing&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;facebook&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;http://www.facebook.com/meantimebrewing&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;url&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;http://www.meantimebrewing.com&quot;
            </span><span style="background: white; color: black">},
            </span><span style="background: white; color: #a31515">&quot;location&quot;</span><span style="background: white; color: black">: {
              </span><span style="background: white; color: #a31515">&quot;brewery_city&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;London&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;brewery_state&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: #a31515">&quot;&quot;</span><span style="background: white; color: black">,
              </span><span style="background: white; color: #a31515">&quot;lat&quot;</span><span style="background: white; color: black">: 51.5081,
              </span><span style="background: white; color: #a31515">&quot;lng&quot;</span><span style="background: white; color: black">: -0.128005
            }
          },
          </span><span style="background: white; color: #a31515">&quot;venue&quot;</span><span style="background: white; color: black">: [],
          </span><span style="background: white; color: #a31515">&quot;comments&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;count&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;items&quot;</span><span style="background: white; color: black">: []
          },
          </span><span style="background: white; color: #a31515">&quot;toasts&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;count&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;auth_toast&quot;</span><span style="background: white; color: black">: </span><span style="background: white; color: blue">null</span><span style="background: white; color: black">,
            </span><span style="background: white; color: #a31515">&quot;items&quot;</span><span style="background: white; color: black">: []
          },
          </span><span style="background: white; color: #a31515">&quot;media&quot;</span><span style="background: white; color: black">: {
            </span><span style="background: white; color: #a31515">&quot;count&quot;</span><span style="background: white; color: black">: 0,
            </span><span style="background: white; color: #a31515">&quot;items&quot;</span><span style="background: white; color: black">: []
          }
        }
      ]
    }
  }
}</span></pre>
<p>I’m sad to admit that, in the past, I’d like create my C# objects by hand and then either conform to the JSON or map between the two. It requires a TON of time and is extremely error prone. With <a target="_blank" href="http://json2csharp.com/">http://json2csharp.com/</a> all I do is paste this into the textbox and click Generate. I’ll get the following output:</p>
<pre class="code"><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">ResponseTime
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public double </span><span style="background: white; color: black">time { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">measure { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Meta
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">code { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">ResponseTime response_time { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Pagination
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">next_url { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">max_id { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">since_url { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Contact
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">twitter { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">foursquare { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">User
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">uid { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">user_name { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">first_name { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">last_name { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">location { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">url { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public object </span><span style="background: white; color: black">relationship { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">bio { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">user_avatar { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Contact contact { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Beer
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">bid { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">beer_name { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">beer_label { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">beer_style { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">auth_rating { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public bool </span><span style="background: white; color: black">wish_list { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Contact2
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">twitter { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">facebook { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">url { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Location
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">brewery_city { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">brewery_state { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public double </span><span style="background: white; color: black">lat { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public double </span><span style="background: white; color: black">lng { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Brewery
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">brewery_id { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">brewery_name { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">brewery_label { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">country_name { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Contact2 contact { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Location location { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Comments
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">count { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">List&lt;</span><span style="background: white; color: blue">object</span><span style="background: white; color: black">&gt; items { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Toasts
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">count { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public object </span><span style="background: white; color: black">auth_toast { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">List&lt;</span><span style="background: white; color: blue">object</span><span style="background: white; color: black">&gt; items { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Media
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">count { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">List&lt;</span><span style="background: white; color: blue">object</span><span style="background: white; color: black">&gt; items { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Item
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">checkin_id { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">created_at { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public string </span><span style="background: white; color: black">checkin_comment { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">User user { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Beer beer { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Brewery brewery { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">List&lt;</span><span style="background: white; color: blue">object</span><span style="background: white; color: black">&gt; venue { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Comments comments { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Toasts toasts { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Media media { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Checkins
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public int </span><span style="background: white; color: black">count { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">List&lt;Item&gt; items { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">Response
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Pagination pagination { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Checkins checkins { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}

</span><span style="background: white; color: blue">public class </span><span style="background: white; color: #2b91af">RootObject
</span><span style="background: white; color: black">{
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Meta meta { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">List&lt;</span><span style="background: white; color: blue">object</span><span style="background: white; color: black">&gt; notifications { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
    </span><span style="background: white; color: blue">public </span><span style="background: white; color: black">Response response { </span><span style="background: white; color: blue">get</span><span style="background: white; color: black">; </span><span style="background: white; color: blue">set</span><span style="background: white; color: black">; }
}</span></pre>
<p>Pretty amazing! Now, note that it’s not perfect – there’s both a Contact and Contact2 class, but that’s easy to fix by merging the two and updating references. I’ll gladly perform this little bit of cleanup given the hours this tool just saved me.</p>
<p>Now that I have these classes, it’s really easy to use JSON.NET to load them with data.</p>
<pre class="code"><span style="background: white; color: #2b91af">RootObject </span><span style="background: white; color: black">publicFeed = </span><span style="background: white; color: blue">new </span><span style="background: white; color: #2b91af">RootObject</span><span style="background: white; color: black">();

</span><span style="background: white; color: blue">using </span><span style="background: white; color: black">(</span><span style="background: white; color: #2b91af">StreamReader </span><span style="background: white; color: black">reader = </span><span style="background: white; color: blue">new </span><span style="background: white; color: #2b91af">StreamReader</span><span style="background: white; color: black">(response.GetResponseStream()))
{
    data = reader.ReadToEnd();

    publicFeed = </span><span style="background: white; color: #2b91af">JsonConvert</span><span style="background: white; color: black">.DeserializeObject&lt;</span><span style="background: white; color: #2b91af">RootObject</span><span style="background: white; color: black">&gt;(data);
}</span></pre>
<p>Now it’s a simple matter of using my <font face="Courier New">RootObject</font> within my applications.</p>
<p>I feel like I may be the last person to have heard of this tool, in which case I’m both embarrassed and bitter – couldn’t you all have told me about this years ago? <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://images.wadewegner.com/wordpress/2012/08/wlEmoticon-smile.png" /></p>
<p>I hope this helps!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WK3WZh64oNc:oj6zQhuwN-g:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WK3WZh64oNc:oj6zQhuwN-g:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=WK3WZh64oNc:oj6zQhuwN-g:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WK3WZh64oNc:oj6zQhuwN-g:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=WK3WZh64oNc:oj6zQhuwN-g:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WK3WZh64oNc:oj6zQhuwN-g:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WK3WZh64oNc:oj6zQhuwN-g:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=WK3WZh64oNc:oj6zQhuwN-g:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=WK3WZh64oNc:oj6zQhuwN-g:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/WK3WZh64oNc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2012/08/generating-c-classes-from-json/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2012/08/generating-c-classes-from-json/</feedburner:origLink></item>
		<item>
		<title>Notes from the MEET Windows Azure Keynote</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/6KZUsrhbBvg/</link>
		<comments>http://www.wadewegner.com/2012/06/notes-from-the-meet-windows-azure-keynote/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 21:35:15 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[IAAS]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PAAS]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1836</guid>
		<description><![CDATA[Excellent keynote today by Scott Guthrie and the Windows Azure team! I don’t know if it’s because I’m seeing it on the other side for the first time or if it’s due to the amazing new capabilities introduced into Windows Azure, but I loved every second of it! Within a few minutes Scott had jumped&#8230; <a href="http://www.wadewegner.com/2012/06/notes-from-the-meet-windows-azure-keynote/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>Excellent keynote today by Scott Guthrie and the Windows Azure team! I don’t know if it’s because I’m seeing it on the other side for the first time or if it’s due to the amazing new capabilities introduced into Windows Azure, but I loved every second of it! Within a few minutes Scott had jumped into a demo and it was nonstop thereafter!</p>
<p>I’ve been waiting for almost a year to write this blog post.</p>
<p><strong><u>Keynote with Scott Guthrie</u></strong></p>
<p><a target="_blank" href="http://images.wadewegner.com/wordpress/2012/06/WP_000321.jpg"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="WP_000321" border="0" alt="WP_000321" src="http://images.wadewegner.com/wordpress/2012/06/WP_000321_thumb.jpg" width="704" height="529" /></a></p>
<p>In order to get this post out quickly I decided to share my rough notes from the keynote. Over the coming days and weeks I will certainly expand this with more information.</p>
<p><strong>Scott Guthrie:</strong></p>
<ul>
<li>Today’s release “elevates Windows Azure to a new level”</li>
<li>Capabilities like Windows Azure Web Sites and open source libraries open the platform to many more developers</li>
<li>Three pillars of Windows Azure:</li>
<ul>
<li>Flexible</li>
<li>Open</li>
<li>Solid</li>
</ul>
<li>Windows Azure has pioneered Platform-as-a-Service</li>
<li>Today we’re enabling Infrastructure-as-a-Service (IaaS)</li>
<li>Support of Linux is how we’re embracing openness in a new way</li>
<li>Supporting more languages, protocols, and SDKs</li>
<li>Open-source libraries and SDKs on Github under the Apache 2.0 license</li>
</ul>
<p><strong>Demo: New Windows Azure website</strong></p>
<ul>
<li>There’s a new Linux and Mac installer for Node.js</li>
<li>Spent time optimizing the portal to work across platforms</li>
<li>Full monitoring and statistics through the portal</li>
<li>Everything done through the portal is communicating to APIs thereby allowing you to do everything through the command line</li>
<li>IaaS</li>
<ul>
<li>Create a new virtual machine</li>
<li>Anything installed on the machine will persist; full durable VM</li>
<li>Image gallery</li>
<ul>
<li>Linux distribution built into the portal</li>
</ul>
<li>We have a number of SDKs to download, including Mac</li>
<ul>
<li>installs an Azure utility and wires up a BASH shell</li>
<li>including ASCII art</li>
<li>SSH’d into Ubuntu machine</li>
</ul>
</ul>
<li>Virtual Networks</li>
<ul>
<li>Not just upload VMs into the cloud</li>
<li>Integrate into your existing networks and VMs you already have</li>
<li>Shipping virtual private networking</li>
<li>A wizard to create an address space and subnet; we’ll virtualize these addresses</li>
<li>You can provide DNS servers in the cloud or on-premises</li>
</ul>
</ul>
<p><strong>Scott Guthrie on VMs:</strong></p>
<ul>
<li>Virtual machine portability</li>
<ul>
<li>Between the cloud and different environments</li>
<li>All VMs are running a VHD format which is an open spec</li>
<li>Because it’s the same file format you can take a VM and move to Windows Azure or even move it back; you don’t have to export or convert the VHDs</li>
<li>This allows you to run in your data center, other service providers, or within Windows Azure: flexibility, portability, and no lock-in</li>
</ul>
<li>VM persistent drive</li>
<ul>
<li>Mount durable drives to the virtual machines</li>
<li>Reliable and consistent</li>
<li>When you mount a drive the disk is backed with the Windows Azure storage system</li>
<ul>
<li>Triple replicate the content; no interruption of service if there’s a failure</li>
<li>Continuous storage and geo-replication</li>
</ul>
</ul>
</ul>
<p><strong>Partner: RightScale</strong></p>
<ul>
<li>Michael Crandell, CEO</li>
<li>Mission: to build a broad cloud management platform</li>
<li>Web-based environment that allows companies to manage everything from development to delivery of applications running on cloud infrastructures</li>
<li>Think of us as a bridge between the apps and the infrastructures you want to run on (public, private, or hybrid)</li>
<li>Partner: worked with the Windows Azure team to interact with the new IaaS APIs</li>
<li>Brought to Windows Azure the full set of RightScale capabilities</li>
<li>When run by RightScale the solution includes auto scale</li>
<li>Why Windows Azure?</li>
<ul>
<li>Microsoft knows how to run global cloud infrastructure with a high degree of operational excellence</li>
<li>IaaS + PaaS is an industry first – provides an entire environment for the development and deployment of apps that are compelling, from simple to complex</li>
<li>Openness – a clear commitment of openness at multiple levels</li>
</ul>
</ul>
<p><strong>Scott Guthrie on Web sites:</strong></p>
<ul>
<li>Benefits</li>
<ul>
<li>Build with ASP.NET, Node.js, or PHP</li>
<li>Deploy in seconds with FTP, Git, or TFS</li>
<li>Start for free, scale up as your traffic grows</li>
</ul>
<li>Bill Staples demo</li>
<li>Opposite end of the cloud spectrum</li>
<ul>
<li>don’t want to focus on the platform; don’t want to install the frameworks</li>
</ul>
<li>Visual Studio &amp; .NET</li>
<ul>
<li>Quickly created a website</li>
<li>Downloaded a publishing profile that includes all the connection information</li>
<li>Opens up Visual Studio and ASP.NET MVC 4</li>
<li>Import the profile and publish</li>
<li>Support in both VS 20120 and VS 2012</li>
<li>Built and published into the cloud in just a few seconds</li>
<li>Updated a string and republished</li>
<ul>
<li>Preview shows the deltas between local and cloud</li>
<li>Just push the change</li>
</ul>
</ul>
<li>Mac with Node.js</li>
<ul>
<li>Instead of the portal use the commandline</li>
<li>Use the azure command</li>
<li>Uses git to deploy</li>
<li>One update connects to Mongo running in a Linux VM</li>
</ul>
<li>Sometimes it’s nice to build an application without writing code</li>
<ul>
<li>Best of Windows Azure and the power of open source</li>
<li>MySQL: worked with ClearDB to provide MySQL as a service </li>
</ul>
<li>Scale</li>
<ul>
<li>Scale out</li>
<ul>
<li>By default, website is running as a Shared Website</li>
<li>You can increase instance count</li>
</ul>
<li>Scale up</li>
<ul>
<li>Move from Shared to Reserved</li>
<li>Only my websites are routed</li>
</ul>
</ul>
<li>10 free shared websites</li>
</ul>
<p><strong>Scott Guthrie on Cloud Services:</strong></p>
<ul>
<li>Another model for building infinitely scalable applications and services</li>
<li>The traditional PaaS offering that Windows Azure has had since release</li>
<li>Creates a multi-tier applications using the website Bill created and adding a worker role</li>
<li>Process</li>
<ul>
<li>Upload a service package (which is essentially a zip file) into the cloud</li>
<li>Fabric controller provisions the machines and deploys my bits and brings it into rotation through load balancer</li>
</ul>
</ul>
<p><strong>Scott Guthrie on Building Blocks:</strong></p>
<ul>
<li>Overall message is to enable developers to focus on applications and less about infrastructure</li>
<li>Application building blocks</li>
<ul>
<li>big data</li>
<li>database</li>
<li>storage</li>
<li>traffic</li>
<li>caching</li>
<li>messaging</li>
<li>identity</li>
<li>media</li>
<li>CDN</li>
<li>networking</li>
</ul>
<li>Delivered by MSFT and partners</li>
<li>Language support for: .NET, Node.JS, Java, PHP, Python</li>
<ul>
<li>Libraries you can consume natively</li>
<li>Libraries on Github under Apache2</li>
</ul>
<li>SQL Database</li>
<ul>
<li>Relational SQL database</li>
<li>Clustered for high availability</li>
<li>Fully managed service</li>
<li>SQL Reporting support</li>
</ul>
<li>Blob storage</li>
<ul>
<li>Features</li>
<ul>
<li>Highly available, scalable and secure file system</li>
<li>Blobs can be exposed publically over http</li>
<li>Continuous geo-replication across datacenters</li>
</ul>
<li>Real-time data showed in portal</li>
<li>SQLs surfaced in the portal</li>
</ul>
<li>Cache</li>
<ul>
<li>implementing Memcached protocol support</li>
<li>Use the distributed service or run it in your own instances</li>
</ul>
<li>Identity</li>
<ul>
<li>Integrate with enterprise identity</li>
<li>Enable single sign-on within your apps</li>
<li>Enterprise Graph REST API</li>
<li>93% of Fortune 1000 use Active Directory</li>
</ul>
<li>Service Bus</li>
<ul>
<li>Secure messaging and relay capabilities</li>
<li>Easily build hybrid apps</li>
<li>Enable loosely coupled solutions</li>
<li>Cross platform SDKs</li>
</ul>
<li>Media Service</li>
<ul>
<li>Create, manage, and distribute content</li>
<li>Target any device or media format</li>
<li>Ingest, Encode, Protect, Stream</li>
</ul>
<li>Marketplace integration</li>
<li>Azure in 89 countries and territories</li>
</ul>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=6KZUsrhbBvg:a3JFGqn8rrg:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=6KZUsrhbBvg:a3JFGqn8rrg:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=6KZUsrhbBvg:a3JFGqn8rrg:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=6KZUsrhbBvg:a3JFGqn8rrg:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=6KZUsrhbBvg:a3JFGqn8rrg:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=6KZUsrhbBvg:a3JFGqn8rrg:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=6KZUsrhbBvg:a3JFGqn8rrg:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=6KZUsrhbBvg:a3JFGqn8rrg:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=6KZUsrhbBvg:a3JFGqn8rrg:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/6KZUsrhbBvg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2012/06/notes-from-the-meet-windows-azure-keynote/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2012/06/notes-from-the-meet-windows-azure-keynote/</feedburner:origLink></item>
		<item>
		<title>Early Thoughts on the Windows Azure Announcements</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/v7553UJCH60/</link>
		<comments>http://www.wadewegner.com/2012/06/early-thoughts-on-the-windows-azure-announcements/#comments</comments>
		<pubDate>Thu, 07 Jun 2012 16:43:54 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[IAAS]]></category>
		<category><![CDATA[PAAS]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1830</guid>
		<description><![CDATA[Today’s release marks a significant milestone for Windows Azure. To date, Windows Azure has been a platform that allows developers to build and run applications across Microsoft’s global datacenters – the key emphasis has been on “applications”. Windows Azure has not been a platform for providing the underlying infrastructure for running your own virtual machine&#8230; <a href="http://www.wadewegner.com/2012/06/early-thoughts-on-the-windows-azure-announcements/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>Today’s release marks a significant milestone for Windows Azure. To date, Windows Azure has been a platform that allows developers to build and run applications across Microsoft’s global datacenters – the key emphasis has been on “applications”. Windows Azure has not been a platform for providing the underlying infrastructure for running your own virtual machine – this has been a key pain point for many customers looking to move to the cloud that Microsoft has heard loud and clear. Today’s announcement makes it clear that Windows Azure is more than just a Platform-as-a-Service provider.</p>
<p>In my opinion, there are three significant components of today’s announcements worth delving into deeper:</p>
<ul>
<li>New Infrastructure-as-a-Service (IaaS) capabilities.</li>
<li>Free (or low-cost) hosting with Windows Azure Websites.</li>
<li>Enhanced cloud networking capabilities that support VPN connections between an on-premises corporate network and Windows Azure.</li>
</ul>
<p>Until now, Microsoft has never competed directly with Amazon EC2 with respects to IaaS nor with cloud platforms like Heroku. The new IaaS and Websites capabilities, combined with the ability to extend on-premises networks to the cloud, provides a number of ways that Windows Azure can now distinguish itself from other platforms and—in my opinion—will drive many new enterprises and a large number of developers to adopt Windows Azure.</p>
<p><strong>Infrastructure-as-a-Service</strong></p>
<p>Windows Azure has long had the concept of a “Virtual Machine role” but the fundamental problem has been the inability to persist changes made to the virtual machine image provided by the customer (i.e. the guest VM) during reboots or recycling. Supporting VM persistence in Windows Azure means that the guest VM will not lose these updates. This unlocks many workloads that previously did not work in Windows Azure – certainly products like SharePoint and SQL Server but also custom line-of business applications that previously were difficult to move to Windows Azure.</p>
<p>In addition to VM persistence, Windows Azure will also give customers the ability to run Linux VMs. There’s been a lot of interest and speculation regarding Microsoft’s strategy moving forward with Linux and open source. I think Microsoft recognizes that their customers run more than just Windows in their enterprise, and this is an opportunity for Windows Azure to run as many workloads as possible. We’ve seen this shift in Microsoft in a number of different ways – support for Node.js and Java in Windows and Windows Azure, the creation of a new interoperability subsidiary, and many more. The cloud provides a way to make it easier to connect all of these different platforms and technologies, and my take is that Microsoft is trying to make Windows Azure the best and simplest place to run your applications regardless of the platform or technology.</p>
<p><strong>Windows Azure Websites</strong></p>
<p>It’s exciting to see Microsoft continue to evolve its strategy with Windows Azure to make it increasingly accessible to the breadth of developers out there.   <br />Windows Azure Websites is a hosting platform for web applications. It provides a number of different deployment and runtime options beyond the existing Web Role, including:</p>
<ul>
<li>Target both Microsoft and non-Microsoft technologies already running in the environment, including SQL Azure, MySQL, PHP, Node.js, and (of course) .NET.</li>
<li>Deploy via Git, Web Deploy, FTP, or TFS.</li>
<li>Run in a high-density / multitenant VM for little-to-no cost or choose a dedicated deployment path.</li>
</ul>
<p>In addition to providing simpler and more consistent ways to deploy applications across different hosting platforms (e.g. Windows Azure, Windows Server, and hosting providers), Windows Azure Websites provides a way for Microsoft to bring thousands—perhaps even hundreds of thousands—of new developers to the platform with the offer of little-to-no cost hosting.</p>
<p><strong>Cloud Networking</strong></p>
<p>Windows Azure Virtual Networks allows a company to connect their cloud applications and solutions to their local network. This occurs at the networking layer through standard VPN devices. Coupled with IaaS support, this provides a ton of flexibility with respects to the kinds of workloads a customer moves to Windows Azure. Don’t want to move your sensitive SQL Server database? You don’t need to. Setup a VPN to your applications in Windows Azure and let them communicate directly back to your applications that live on-premises.</p>
<p>There’s certainly a lot more to talk about – new services, portal, SDK, tools, and so much more! These thoughts are pretty early—in fact, I write this before today’s MEET Windows Azure event—and there’s so much more to talk about!</p>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=v7553UJCH60:Q7f9SQspOZI:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=v7553UJCH60:Q7f9SQspOZI:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=v7553UJCH60:Q7f9SQspOZI:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=v7553UJCH60:Q7f9SQspOZI:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=v7553UJCH60:Q7f9SQspOZI:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=v7553UJCH60:Q7f9SQspOZI:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=v7553UJCH60:Q7f9SQspOZI:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=v7553UJCH60:Q7f9SQspOZI:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=v7553UJCH60:Q7f9SQspOZI:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/v7553UJCH60" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2012/06/early-thoughts-on-the-windows-azure-announcements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2012/06/early-thoughts-on-the-windows-azure-announcements/</feedburner:origLink></item>
		<item>
		<title>Simple Capped Exponential Back-Off for Queues</title>
		<link>http://feedproxy.google.com/~r/WadeWegner/~3/PmBklcjwrk0/</link>
		<comments>http://www.wadewegner.com/2012/04/simple-capped-exponential-back-off-for-queues/#comments</comments>
		<pubDate>Fri, 27 Apr 2012 21:15:36 +0000</pubDate>
		<dc:creator>Wade</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Best Practices]]></category>
		<category><![CDATA[Queues]]></category>
		<category><![CDATA[Windows Azure]]></category>

		<guid isPermaLink="false">http://www.wadewegner.com/?p=1805</guid>
		<description><![CDATA[Recently Steve Marx and I spent a few hours working on a best practices document for Windows Azure. As expected, this was a fun and educational experience – plenty of goofing around, but also some really good discussion on things to think about when building applications for Windows Azure. One of the items we discussed&#8230; <a href="http://www.wadewegner.com/2012/04/simple-capped-exponential-back-off-for-queues/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
				<content:encoded><![CDATA[
<p>Recently <a target="_blank" href="http://blog.smarx.com/" target="_blank">Steve Marx</a> and I spent a few hours working on a best practices document for Windows Azure. As expected, this was a fun and educational experience – plenty of goofing around, but also some really good discussion on things to think about when building applications for Windows Azure. One of the items we discussed is a better approach for sleeping inside the Worker Role when pulling from queues. Rather than defaulting to a retry every 10 seconds we decided that the best approach is to exponentially back-off on your queue reads while capping it with an upper bound.</p>
<p>The primary value of this is to decrease the number of storage transactions when reading from your queue, and therefore reduce both bandwidth and transaction costs.</p>
<p>There are plenty of other good posts on this topic that provide a lot more detailed justification and rationale for this approach:</p>
<ul>
<li><a target="_blank" href="http://www.developerfusion.com/article/120619/advanced-scenarios-with-windows-azure-queues/" target="_blank">Advanced scenarios with Windows Azure Queues</a>
<li><a target="_blank" href="http://geekswithblogs.net/hroggero/archive/2011/05/26/cloud-lesson-learned-exponential-backoff.aspx" target="_blank">Cloud Lesson Learned: Exponential Backoff</a>
<li><a target="_blank" href="http://programming4.us/desktop/2910.aspx" target="_blank">Windows Azure : Messaging with the queue &#8211; Patterns for message processing</a> </li>
</ul>
<p>The logic and approach is deceptively simple and I thought I’d share a really simple, yet effective, example. (Incidentally, credit goes to Steve for very quickly putting together the basis of this really simple example.)</p>
<p>Here’s the code:</p>
<pre class="code"><span style="color: blue">   string </span>queueName = <span style="color: #a31515">"queuetest"</span>;

<span style="color: blue">   int </span>minInterval = 1;
<span style="color: blue">   int </span>interval = minInterval;

<span style="color: blue">   int </span>exponent = 2;
<span style="color: blue">   int </span>maxInterval = 60;

<span style="color: #2b91af">   CloudStorageAccount </span>account = <span style="color: #2b91af">CloudStorageAccount</span>.DevelopmentStorageAccount;
<span style="color: #2b91af">   CloudQueueClient </span>queueClient = account.CreateCloudQueueClient();
<span style="color: #2b91af">   CloudQueue </span>queue = queueClient.GetQueueReference(queueName);
   queue.CreateIfNotExist();

<span style="color: blue">   while </span>(<span style="color: blue">true</span>)
   {
      <span style="color: blue">var </span>msg = queue.GetMessage();
      <span style="color: blue">if </span>(msg != <span style="color: blue">null</span>)
      {
         <span style="color: green">// do something
         </span>queue.DeleteMessage(msg);
         interval = minInterval;

         <span style="color: #2b91af">Trace</span>.WriteLine(<span style="color: blue">string</span>.Format(<span style="color: #a31515">"Interval reset to {0} seconds"</span>, interval));
      }
      <span style="color: blue">else
      </span>{
         <span style="color: #2b91af">Trace</span>.WriteLine(<span style="color: blue">string</span>.Format(<span style="color: #a31515">"Sleep for {0} seconds"</span>, interval));
         <span style="color: #2b91af">Thread</span>.Sleep(<span style="color: #2b91af">TimeSpan</span>.FromSeconds(interval));
         interval = <span style="color: #2b91af">Math</span>.Min(maxInterval, interval * exponent);
      }
   }</pre>
<p>As I said, really simple. The magic is in the last line where we check to see which is smaller – the maximum interval or the product of the interval and the exponent. At some point the product of the interval and exponent grows larger than the maximum interval, and consequently the interval value is set to the maximum interval.</p>
<p>Here’s the output in the Windows Azure Compute Emulator:</p>
<pre style="padding-bottom: 10px; border-right-width: 0px; margin: 0px; padding-left: 0px; outline-width: 0px; padding-right: 0px; font-family: 'Courier New'; background: none transparent scroll repeat 0% 0%; border-top-width: 0px; border-bottom-width: 0px; font-size: 11px; vertical-align: baseline; border-left-width: 0px; padding-top: 0px">   Sleep for 1 seconds 
   Sleep for 2 seconds 
   Sleep for 4 seconds 
   Sleep for 8 seconds 
   Sleep for 16 seconds 
   Sleep for 32 seconds 
   Sleep for 60 seconds 
   Sleep for 60 seconds 
   ...</pre>
<p>Now, the application will continue to sleep until it finds a message in the queue, at which point the interval is reset back to one. To test this I used the Azure Storage Explorer and created a new queue message.</p>
<p><a target="_blank" href="http://images.wadewegner.com/wordpress/2012/04/AzureStorageExplorerQueue.jpg"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="AzureStorageExplorerQueue" border="0" alt="AzureStorageExplorerQueue" src="http://images.wadewegner.com/wordpress/2012/04/AzureStorageExplorerQueue_thumb.jpg" width="640" height="464"></a></p>
<p>Once the message is created the output is as follows:</p>
<pre style="padding-bottom: 10px; border-right-width: 0px; margin: 0px; padding-left: 0px; outline-width: 0px; padding-right: 0px; font-family: 'Courier New'; background: none transparent scroll repeat 0% 0%; border-top-width: 0px; border-bottom-width: 0px; font-size: 11px; vertical-align: baseline; border-left-width: 0px; padding-top: 0px">   Interval reset to 1 seconds 
   Sleep for 1 seconds
   Sleep for 2 seconds
   Sleep for 4 seconds
   Sleep for 8 seconds
   ...</pre>
<p>And so forth.</p>
<p>You can find all the source code for this sample in my <a target="_blank" href="https://github.com/wadewegner/CappedExponentialBackOff" target="_blank">CappedExponentialBackOff repository</a> on GitHub.</p>
<p>Pretty simple but quite useful. I hope this helps!</p>
<pre></pre>

<div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/WadeWegner?a=PmBklcjwrk0:9ajrtw4qiiY:dnMXMwOfBR0"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=dnMXMwOfBR0" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=PmBklcjwrk0:9ajrtw4qiiY:V_sGLiPBpWU"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=PmBklcjwrk0:9ajrtw4qiiY:V_sGLiPBpWU" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=PmBklcjwrk0:9ajrtw4qiiY:F7zBnMyn0Lo"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=PmBklcjwrk0:9ajrtw4qiiY:F7zBnMyn0Lo" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=PmBklcjwrk0:9ajrtw4qiiY:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=yIl2AUoC8zA" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=PmBklcjwrk0:9ajrtw4qiiY:qj6IDK7rITs"><img src="http://feeds.feedburner.com/~ff/WadeWegner?d=qj6IDK7rITs" border="0"></img></a> <a href="http://feeds.feedburner.com/~ff/WadeWegner?a=PmBklcjwrk0:9ajrtw4qiiY:D7DqB2pKExk"><img src="http://feeds.feedburner.com/~ff/WadeWegner?i=PmBklcjwrk0:9ajrtw4qiiY:D7DqB2pKExk" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/WadeWegner/~4/PmBklcjwrk0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.wadewegner.com/2012/04/simple-capped-exponential-back-off-for-queues/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.wadewegner.com/2012/04/simple-capped-exponential-back-off-for-queues/</feedburner:origLink></item>
	</channel>
</rss>
