<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Heavily Caffeinated</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/rmattsampson/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/rmattsampson/feed.xml</link>
    <description>Good stuff about life at Microsoft and being a Software Engineer on Visual Studio&amp;#039;s Cloud Platform Team</description>
    <lastBuildDate>Wed, 17 Apr 2019 03:25:04 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>I am leaving Microsoft</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/i-am-leaving-microsoft</link>
      <pubDate>Mon, 06 Apr 2015 07:22:31 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2015/04/06/i-am-leaving-microsoft/</guid>
      <description><![CDATA[The blog has been a blast, and though I may be terrible at responding to all your comments, believe...]]></description>
      <content:encoded><![CDATA[<p>The blog has been a blast, and though I may be terrible at responding to all your comments, believe me I will miss interacting with users on this platform.</p>
<p>You no doubt have countless questions ;)</p>
<p>FAQ:</p>
<p><strong>Where are you going?</strong></p>
<p>I'll be heading over to work for Citrix (doing software development of course)</p>
<p><strong>Where is your new blog?</strong></p>
<p>Follow me on twitter, and on my user about page I'll have a link to my new blog once I get it out there:&nbsp;<a href="https://twitter.com/TrampSansTom">https://twitter.com/TrampSansTom</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>I got nothing but love for Microsoft, and I believe the feeling is mutual on their side too.</p>]]></content:encoded>
    </item>
    <item>
      <title>Micro Blog Post - Open Door / Closed Door Problem and TypeScript Solution</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/micro-blog-post-open-door-closed-door-problem-and-typescript-solution</link>
      <pubDate>Mon, 23 Mar 2015 14:03:41 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2015/03/23/micro-blog-post-open-door-closed-door-problem-and-typescript-solution/</guid>
      <description><![CDATA[&nbsp;
The open door / closed door problem was just something I was messing with after an interview...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;</p>
<p>The open door / closed door problem was just something I was messing with after an interview question about it.</p>
<p>Wanting to verify that my original solution was actually correct (it was)</p>
<p>&nbsp;</p>
<p>You can check it out here on typescript playground (which is a sweet playground):</p>
<p><a href="http://www.typescriptlang.org/Playground/#src=%0Aclass%20Door%20%0A%7B%0A%20%20%20%20status%3A%20boolean%3B%09%0A%7D%0A%0Avar%20doors%20%3D%20new%20Array()%3B%0A%0Afor%20(var%20i%3D0%3B%20i%3C100%3B%20i%2B%2B)%0A%7B%0A%09var%20newDoor%20%3D%20new%20Door()%3B%0A%09newDoor.status%20%3D%20false%3B%0A%09doors.push(newDoor)%3B%09%0A%7D%0A%0Afor%20(var%20x%3D0%3B%20x%20%3C%20doors.length%3B%20x%2B%2B)%0A%7B%0A%09for%20(var%20y%3Dx%3B%20y%20%3C%20doors.length%3B%20y%20%3D%20y%20%2B%20x%20%2B%201)%0A%09%7B%0A%09%09if%20(doors%5By%5D.status%20%3D%3D%20false)%0A%09%09%7B%0A%09%09%09doors%5By%5D.status%20%3D%20true%3B%0A%09%09%7D%20%09%0A%09%09else%0A%09%09%7B%0A%09%09%09doors%5By%5D.status%20%3D%20false%3B%09%0A%09%09%7D%0A%09%7D%09%0A%7D%0A%0Afor%20(var%20z%20%3D%200%3B%20z%20%3C%20doors.length%3B%20z%2B%2B)%0A%7B%0A%09var%20listthing%20%3D%20document.createElement('li')%3B%0A%09listthing.textContent%20%3D%20doors%5Bz%5D.status%3B%0A%09document.body.appendChild(listthing)%3B%0A%7D%0A%0A">http://www.typescriptlang.org/Playground/#src=%0Aclass%20Door%20%0A%7B%0A%20%20%20%20status%3A%20boolean%3B%09%0A%7D%0A%0Avar%20doors%20%3D%20new%20Array()%3B%0A%0Afor%20(var%20i%3D0%3B%20i%3C100%3B%20i%2B%2B)%0A%7B%0A%09var%20newDoor%20%3D%20new%20Door()%3B%0A%09newDoor.status%20%3D%20false%3B%0A%09doors.push(newDoor)%3B%09%0A%7D%0A%0Afor%20(var%20x%3D0%3B%20x%20%3C%20doors.length%3B%20x%2B%2B)%0A%7B%0A%09for%20(var%20y%3Dx%3B%20y%20%3C%20doors.length%3B%20y%20%3D%20y%20%2B%20x%20%2B%201)%0A%09%7B%0A%09%09if%20(doors%5By%5D.status%20%3D%3D%20false)%0A%09%09%7B%0A%09%09%09doors%5By%5D.status%20%3D%20true%3B%0A%09%09%7D%20%09%0A%09%09else%0A%09%09%7B%0A%09%09%09doors%5By%5D.status%20%3D%20false%3B%09%0A%09%09%7D%0A%09%7D%09%0A%7D%0A%0Afor%20(var%20z%20%3D%200%3B%20z%20%3C%20doors.length%3B%20z%2B%2B)%0A%7B%0A%09var%20listthing%20%3D%20document.createElement('li')%3B%0A%09listthing.textContent%20%3D%20doors%5Bz%5D.status%3B%0A%09document.body.appendChild(listthing)%3B%0A%7D%0A%0A</a></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Open Door / Closed Door problem - given n number of doors:</p>
<p>1) Go through the list of doors, and "toggle" the state of every door</p>
<p>2) Go through the list of doors again, starting with the "next" door, toggle every other door</p>
<p>3) Go through the list of doors again, starting with the "next next" door, toggle every other other door&nbsp;</p>
<p>4) And on and on</p>
<p>&nbsp;</p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>GitHub Language Correlation for Jan 1 2014 - Feb 1 2015</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/github-language-correlation-for-jan-1-2014-feb-1-2015</link>
      <pubDate>Wed, 11 Feb 2015 13:46:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2015/02/11/github-language-correlation-for-jan-1-2014-feb-1-2015/</guid>
      <description><![CDATA[GitHub seems like a great place to view some statistics regarding development languages.
I wanted...]]></description>
      <content:encoded><![CDATA[<p>GitHub seems like a great place to view some statistics regarding development languages.</p>
<p>I wanted to see what I could find out there in regards to GitHub data.</p>
<p>There were a couple choices I had: use their open API (which allow for a limited set of use daily) or use Google's Big Query engine which happens to have a ton of <a href="https://github.com/blog/1112-data-at-github">GitHub data available</a> in it's list of public data sets.</p>
<p>So I went with Google's Big Query engine. And it's pretty slick. Despite having a lot of intermittent failures when running queries or downloading data, I was able to successfully do some pretty cool querying.</p>
<p>I found some data in there (old data, from 2012) regarding language correlation. I knew I wanted to do something like that, but definitely needed something more recent than ancient 2012.</p>
<p>And thanks to Data Hacker MD's post on <a href="http://datahackermd.com/2013/language-use-on-github/">Language Use On GitHub</a> I was able to get started.</p>
<p>The steps were pretty simple:</p>
<p>1) Get a free 60 day trial account on <a href="https://cloud.google.com/bigquery/">Google's Big Query</a></p>
<p>2) Filter out the data I wanted, and shove that into a new "table"</p>
<p>3) Export the table to a very large CSV file</p>
<p>4) Run<a href="https://gist.github.com/akshayjshah/4772174"> Data Hacker MD's python script</a> over the data (which uses Spearman's Rank Correlation to determine the correlation between any 2 languages)</p>
<p>5) Exports the results as a SVG file (<a href="http://en.wikipedia.org/wiki/Scalable_Vector_Graphics">Scalable Vector Graphics</a>) that you can see below</p>
<p>What we have here is an answer to the question:</p>
<p>"If person A writes code in Language X, are they also likely to write code in Language Y?"</p>
<p>Or in other words:</p>
<p>"If someone writes a lot of Javascript, does that mean they also write a lot of CSS?" (Answer: chart below shows a slightly strong correlation not surprisingly)</p>
<p>Some interesting conclusions:</p>
<ul>
<li>There is a fairly strong positive correlation between PowerShell and TypeScript...very weird</li>
<li>C# users aren't likely to avoid other languages (I don't see any negative correlations in the C# column...well except for Puppet)</li>
<li>But Visual Basic Users, they area a bit more insular and seem to favor certain languages over others.</li>
<li>Plus, very few languages had a strong negative correlation (XSLT and Julia...)</li>
</ul>
<p>But overall, and maybe it's just me, but comparing my chart from 2014 - Feb 2015 to Data Hacker MD's chart, seem to show that software developers are developing across multiple languages more and more (i.e. less redish coloring)</p>
<p><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/4405.Spearman2014to2015LangCorrelation.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/4405.Spearman2014to2015LangCorrelation.png" alt="2014-2015 GitHub Language Correlation" width="898" height="756" /></p>]]></content:encoded>
    </item>
    <item>
      <title>TypeScript Generic Collection Implementation, it's, you know, generic</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/typescript-generic-collection-implementation-its-you-know-generic</link>
      <pubDate>Thu, 01 Jan 2015 20:29:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2015/01/01/typescript-generic-collection-implementation-its-you-know-generic/</guid>
      <description><![CDATA[&nbsp;I had the need for a Generic Collection like data structure recently while messing around in...]]></description>
      <content:encoded><![CDATA[<p>&nbsp;<span style="font-size: small;">I had the need for a Generic Collection like data structure recently while messing around in TypeScript (while making </span><a style="font-size: small;" href="http://medschoolresidentmatching.azurewebsites.net/">this goofy implementation of the Medical School / Resident Matching Algorithm</a><span style="font-size: small;">....with balls for some reason)</span></p>
<p><span style="font-size: small;">You can check out the&nbsp;<a href="http://www.typescriptlang.org/Playground/#src=%2F%2FA%20typescript%20implemenation%20of%20a%20generic%20Collection%0D%0Aclass%20Collection%3CT%3E%20%7B%0D%0A%0D%0A%20%20%20%20%2F%2F%20The%20underlying%20array%20data%20structure%20of%20the%20collection%0D%0A%20%20%20%20private%20_items%20%3D%20%5B%5D%3B%0D%0A%0D%0A%20%20%20%20%2F%2F%20Get%20the%20collection%20as%20an%20array%0D%0A%20%20%20%20public%20GetItems()%20%7B%0D%0A%20%20%20%20%20%20%20%20return%20this._items%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2F%20Get%20a%20specific%20item%20from%20a%20collection%20given%20it's%20index%0D%0A%20%20%20%20public%20GetItem(index%3A%20number)%3A%20T%7B%0D%0A%20%20%20%20%20%20%20%20return%20this._items%5Bindex%5D%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2F%20Length%20of%20the%20collection%0D%0A%20%20%20%20public%20Count()%20%7B%20return%20this._items.length%3B%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2F%20Add%20an%20object%20to%20the%20collection%0D%0A%20%20%20%20public%20Add(item%3A%20T)%20%7B%0D%0A%20%20%20%20%20%20%20%20this._items.push(item)%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2F%20Delete%20an%20object%20from%20the%20collection%0D%0A%20%20%20%20public%20Delete(itemIndex%3A%20number)%20%7B%0D%0A%20%20%20%20%20%20%20%20this._items.splice(itemIndex%2C%201)%3B%0D%0A%20%20%20%20%7D%0D%0A%0D%0A%20%20%20%20%2F%2F%20Find%20the%20index%20of%20a%20given%20object%20in%20a%20collection%0D%0A%20%20%20%20public%20IndexOfItem(obj%3A%20T%2C%20fromIndex%3F%3A%20number)%20%3Anumber%20%7B%0D%0A%20%20%20%20%20%20%20%20if%20(fromIndex%20%3D%3D%20null)%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20fromIndex%20%3D%200%3B%0D%0A%20%20%20%20%20%20%20%20%7D%20else%20if%20(fromIndex%20%3C%200)%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20fromIndex%20%3D%20Math.max(0%2C%20this._items.length%20%2B%20fromIndex)%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20for%20(var%20i%20%3D%20fromIndex%2C%20j%20%3D%20this._items.length%3B%20i%20%3C%20j%3B%20i%2B%2B)%20%7B%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20if%20(this._items%5Bi%5D%20%3D%3D%3D%20obj)%0D%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20return%20i%3B%0D%0A%20%20%20%20%20%20%20%20%7D%0D%0A%20%20%20%20%20%20%20%20return%20-1%3B%0D%0A%20%20%20%20%7D%0D%0A%7D%0D%0A">implementation</a> in a nice typescript playground on typescript.org sandbox, or if you'd rather I have it below.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">Later on I'll blog out the intricacies of animating the Medical School / Resident matching algorithm and things learned along the way (not expecting it to be the most popular thing I've ever written but maybe thousands of Med Schools residents will finally find that animated algorithm they've been dreaming of)</span></p>
<p><span style="font-size: small;">&nbsp;Typescript implementation:</span></p>
<pre>//A typescript implementation of a generic Collection<br />class Collection&lt;T&gt; {<br /><br />    // The underlying array data structure of the collection<br />    private _items = [];<br /><br />    // Get the collection as an array<br />    public GetItems() {<br />        return this._items;<br />    }<br /><br />    // Get a specific item from a collection given it's index<br />    public GetItem(index: number): T{<br />        return this._items[index];<br />    }<br /><br />    // Length of the collection<br />    public Count() { return this._items.length; }<br /><br />    // Add an object to the collection<br />    public Add(item: T) {<br />        this._items.push(item);<br />    }<br /><br />    // Delete an object from the collection<br />    public Delete(itemIndex: number) {<br />        this._items.splice(itemIndex, 1);<br />    }<br /><br />    // Find the index of a given object in a collection<br />    public IndexOfItem(obj: T, fromIndex?: number) :number {<br />        if (fromIndex == null) {<br />            fromIndex = 0;<br />        } else if (fromIndex &lt; 0) {<br />            fromIndex = Math.max(0, this._items.length + fromIndex);<br />        }<br />        for (var i = fromIndex, j = this._items.length; i &lt; j; i++) {<br />            if (this._items[i] === obj)<br />                return i;<br />        }<br />        return -1;<br />    }<br />}</pre>]]></content:encoded>
    </item>
    <item>
      <title>3rd Party Controls Shout out - Syncfusion for LightSwitch</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/3rd-party-controls-shout-out-syncfusion-for-lightswitch</link>
      <pubDate>Wed, 22 Oct 2014 12:00:45 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2014/10/22/3rd-party-controls-shout-out-syncfusion-for-lightswitch/</guid>
      <description><![CDATA[Visual Studio LightSwitch (Silverlight Client) Syncfusion Controls
I've seen plenty of questions in...]]></description>
      <content:encoded><![CDATA[<div><span style="font-size: medium;">Visual Studio LightSwitch (Silverlight Client) Syncfusion Controls</span></div>
<div>I've seen plenty of questions in that past about how to export data from a LightSwitch app into Word or Excel, or how to do some basic reporting over LightSwitch data.</div>
<div><br />It's worthwhile mentioning that Syncfusion has got some <a href="http://www.syncfusion.com/">extensions</a> that should prove useful for these kind of problems.</div>
<div>-Wondering how to export data to Microsoft Word or Microsoft Excel? <a href="http://www.syncfusion.com/products/lightswitch/xlsiodocio">Syncfusion's 3rd party controls</a>&nbsp;have that.</div>
<div>-You need a reporting tool? Syncfusion has a <a href="http://www.syncfusion.com/products/lightswitch/report-viewer">reporting extension for LightSwitch</a> too.</div>
<div>They also have some nice data visualization extensions for charts, maps, and more.</div>
<div><br />So shout out and thank you to Syncfusion for making some good extensions for LightSwitch!</div>]]></content:encoded>
    </item>
    <item>
      <title>Azure Resource Manager Tools for Visual Studio - Advanced Template Editing</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/azure-resource-manager-tools-for-visual-studio-advanced-template-editing</link>
      <pubDate>Tue, 19 Aug 2014 05:17:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2014/08/19/azure-resource-manager-tools-for-visual-studio-advanced-template-editing/</guid>
      <description><![CDATA[Update 11/17/2014: This is RELEASED now! Go get the official released public bits from available in...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;"><strong>Update 11/17/2014</strong></span>: This is RELEASED now! Go get the official released public bits from available in <a href="http://azure.microsoft.com/blog/2014/11/12/announcing-azure-sdk-2-5-for-net-and-visual-studio-2015-preview">Azure SDK 2.5</a> (<a href="http://azure.microsoft.com/blog/2014/11/12/announcing-azure-sdk-2-5-for-net-and-visual-studio-2015-preview">DOWNLOAD HERE</a>)</p>
<p><strong style="font-size: 12px;">Update 09/23/2014:</strong><span style="font-size: 12px;"> I "fixed" the "apiVersion" values in the below JSON so that they pointed to the recent versions. This will problem be a problem again in the future. One way to see what the latest apiVersion is is to simple look at the other parts of the website.JSON and see what version they use.</span></p>
<p>The Azure Resource Manager Tools (Preview) for Visual Studio have been available for almost a week now, so I think it's time to move beyond the basic scenario and do something more advanced.</p>
<ul>
<li><span style="font-size: 10pt;">Note: Not familiar with Azure Resource Manager or the Tools yet? I'd recommend you check out this <a href="http://azure.microsoft.com/blog/2014/08/11/azure-resource-manager-tools-preview/">Azure Blog</a> which gives a quick introduction to everything you need to get started here.</span></li>
</ul>
<p style="text-align: left;">Using the tooling, we are going to walk through creating a Web Application, deploying our Azure resources (e.g. websites and databases), and publishing our application. We'll accomplish this by editing an Azure Gallery Template (maybe you've seen these already on the<a href="http://portal.azure.com"> new Azure Portal</a>) so that it not only deploys all the Azure resources we need, but also does the publishing part for us. We won't be publishing to Azure using a "Publish Wizard" in this tutorial. And we won't be using the Azure Portal website for creating any resource. We are going to do everything strictly from Visual Studio.</p>
<p style="text-align: left;">Before we can experience all of this, make sure you install the <a href="http://go.microsoft.com/fwlink/?LinkID=507510">Azure RM Tools (Preview) for Visual Studio</a>. Also, you'll need an Azure account. Don't have one? Then you can sign up for a trial one <a href="http://msdn.microsoft.com/en-us/library/dn168987(v=nav.70).aspx">here</a>.</p>
<p style="text-align: left;">Let's get started creating our web application, then we'll move onto deploying our Azure resources, and to top it off we'll publish the app. Again we'll be using nothing but the tooling we've made available in Visual Studio.</p>
<p style="text-align: left;"><span style="font-size: 14pt;"><strong>Create a Web Application</strong></span></p>
<p style="text-align: left;">Let's get started creating the web application.</p>
<ol>
<li>Launch Visual Studio</li>
<li>Go to File -&gt; New Project -&gt; Cloud -&gt; Cloud App from the Azure Gallery</li>
<ol>
<li><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/4532.CloudProject-636x365.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/4532.CloudProject_2D00_636x365.png" alt="" width="636" height="365" /></li>
</ol>
<li>Give your project a name and clock OK.</li>
<li>You'll be prompted to pick a template from the Azure Gallery&nbsp;</li>
<ol>
<li>Select the "Website" template</li>
<ol>
<li><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/0624.websitetemplate.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/0624.websitetemplate.png" alt="" width="599" height="450" /></li>
</ol>
<li><span style="font-size: 10pt;">Note:</span>&nbsp; What is a "template"? Templates are THE way that you create resources in the "new" Azure Portal. This template will have all the components needed for us to create an Azure website (or other Azure resources).</li>
</ol>
<li>Next you'll be asked to pick an ASP.NET Project type</li>
<ol>
<li>Doesn't matter much, but for this demo let's just pick an Empty Web Project template</li>
</ol></ol>
<p>Now that you've created the Azure Cloud Application project, let's take a look at the solution.</p>
<p>We have 2 Projects in our solution, first is our Web Project, and the second is this new thing called a Deployment Project.</p>
<p>The Deployment Project is what we will use for deployment of our Azure Website template that you just selected. So later on here we are going to use the Deployment Project to create an Azure Resource Group with Azure resources (like websites) in it.&nbsp;</p>
<p>The Deployment Project has two json files that enable us to create Azure resource. One json file is called Website.json. You can think of this file as containing the "code" needed to create Azure resources (like a website). The other file is called Website.dev.param.json. This file contains the values for a few parameters that our Website resource is going to need (specifically: location, a name, and a web host plan).</p>
<p>And let's not forget we have a PowerShell file here that includes some scripts for working with Azure Resource Manager. But, we won't be using that today.</p>
<p>Right now, the Deployment Project is only available through the Azure Cloud Application template.</p>
<p><strong><span style="font-size: 14pt;">Create a Web Deployment Package of our Project</span><br /></strong></p>
<p>We need something to deploy, so we need to make a web deployment package.</p>
<ol>
<li>Right click on the Web Project - select Publish</li>
<li>Click "Custom" to create our own Publish profile, call it whatever you want</li>
<li>Click Next</li>
<li>Select "Web Deploy Package" for the Publish Method option</li>
<li>Type a location for the package .zip file</li>
<li>That's it. Click Publish</li>
</ol>
<p>We now have a web deployment package (.zip file). This is the website we are going to publish later on. But first we need to put this file somewhere where Azure Resource Manager can access it. An Azure Storage Account is a good place for this.</p>
<p>And if you have the Azure SDK, then uploading this zip file will be a breeze (if not there are some great&nbsp;<a href="https://filezilla-project.org/">3rd party tools</a>). To upload the file, navigate to Server Explorer -&gt; Azure -&gt; Storage. Create a storage account if you need one. Create a Blob container next. Double click on it. It should open in the document window. In the document window you can click the upload button now to upload your web deployment package. After you upload it you can also get the URL location of the package by right clicking on it and select "Copy URL" (you'll need to do this later)</p>
<p>That's it. Let's move onto creating some Azure resources using the Deployment Project.</p>
<p><strong><span style="font-size: 14pt;">Prep our Deployment Project</span></strong></p>
<p>Open up the Website.json file. As I mentioned before, this file contains all the Azure resources that get created when you select an Azure Website template (things like the Website, Application Insights, a web host plan, and more). It also contains a list of parameters, like the website name (though their values aren't stored here, that gets stores in the Website.param.dev.json file).</p>
<p>You can scroll through the "resources" node to see all the resources that this template creates for you. What's here already may be just fine for you, and you don't need to necessarily edit any part of this file. But since this is an "advanced" scenario blog, we are going to edit it.</p>
<p>Just to make things a bit more advanced, I think we should deploy two websites here, and not just one (the template is currently configured to only deploy one website). So let's add a second website that will be our staging/development website.</p>
<p>To get another website added to our template is pretty simple, just edit the json file parameters section (in your Website.json file) and add in this highlighted json:</p>
<p>&nbsp;&nbsp; "parameters": {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "siteName": {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "string"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br /><strong>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ffcc00;">&nbsp; "siteName-staging": {</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "string"</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</span></strong><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "hostingPlanName": {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "string"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p>
<p>Now we have a new parameter for our "staging" website.</p>
<p>Then we need a resource to deploy the "siteName-staging" site. So add this json to your list of "resources" in your Website.json file:</p>
<p>&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "apiVersion": "2014-06-01",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "name": "[parameters('siteName-staging')]",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "Microsoft.Web/sites",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "location": "[parameters('siteLocation')]",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "tags": {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "dependsOn": [<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"<br />&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "properties": {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "name": "[parameters('siteName-staging')]",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "serverFarm": "[parameters('hostingPlanName')]"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p>
<p>After you've done this, you'll have a resource template that creates TWO websites, and both of them will be in the same location (e.g. West US) with the same web hosting plan (if you wanted it in different locations or with different web host plans,you would need to add new parameters for those as well).</p>
<p>I want to deploy my Azure resources and publish my website at the same time. Right now all this template does is deploy Azure resources. So I need to add another resource in the list. Specifically, I want to add an MSDeploy resource to this file. The MSDeploy resource will take our web package and publish it to the website (specifically sitename-staging website) for us.</p>
<p>To add the MSDeploy resource, add the highlighted json into your siteName-staging website resource:</p>
<p>&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "apiVersion": "2014-06-01",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "name": "[parameters('siteName-staging')]",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "Microsoft.Web/sites",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "location": "[parameters('siteLocation')]",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "tags": {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "[concat('hidden-related:', resourceGroup().id, '/providers/Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]": "Resource"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "dependsOn": [<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "[concat('Microsoft.Web/serverfarms/', parameters('hostingPlanName'))]"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "properties": {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "name": "[parameters('siteName-staging')]",<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "serverFarm": "[parameters('hostingPlanName')]"<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color: #ffcc00;">&nbsp;&nbsp;<strong>&nbsp; "resources": [</strong></span><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "apiVersion": "2014-06-01",</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "name": "MSDeploy",</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "type": "Extensions",</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "dependsOn": [</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "[concat('Microsoft.Web/Sites/', parameters('siteName-staging'))]"</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ],</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "properties": {</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "packageUri": "https://someStorageAcct/yourWebPackage.zip",</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "dbType": "None",</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "connectionString": "",</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "setParameters": {</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; "IIS Web Application Name": "[parameters('siteName-staging')]"</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</span></strong><br /><strong><span style="color: #ffcc00;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ]</span></strong><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; },</p>
<p>I got this MSDeploy resource code by just looking at another Azure template, and taking what I needed out of it (there are a whole bunch of templates for Azure, and while they aren't all first class citizens in Visual Studio like the Website template, you can at least <a href="http://azure.microsoft.com/en-us/documentation/articles/powershell-azure-resource-manager/">download them</a> and open up the template's json file right in Visual Studio). This template's resource code is telling our website resource to also use the MSDeploy resource. And we are giving the MSDeploy resource the location of our web package (which should be some Azure storage account blob), and you can also set the values of any parameters for you web package here as well (which I've done with the "IIS Web Application Name" parameter).</p>
<p>So to recap, we have edited our template file so that it will create two website resources. And it will also use the MSDeploy resource to publish our web package to the staging website.</p>
<p><span style="font-size: 14pt;">Deploy our Project</span></p>
<p>Its time to deploy our Azure resources and publish our website.</p>
<p>This is the easy part of the "advanced" blog.</p>
<p>Right click on the Deployment Project, select "Deploy to Resource Group".</p>
<ol>
<li>Make sure you have a Subscription selected.</li>
<li>Click the Resource Group drop down and select "Create New"</li>
<li>Create a new Azure Resource Group (an Azure Resource Group is a way to manage all the resources used by your application, and this Resource Group will be the container for all of our resources that we are going to deploy)</li>
<ol>
<li><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/5340.createresourcegroup2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/5340.createresourcegroup2.png" alt="" width="397" height="283" /></li>
</ol>
<li>Select a Deployment template (Website.json)</li>
<li>Select a Template parameter file (Website.param.dev.json)</li>
<li>Click "Edit Parameters"</li>
<ol>
<li>Select the website names</li>
<li>Select the location (has to be a valid region, like "West US")</li>
<li>Select the web hosting plan name</li>
<li>Click Save</li>
<ol>
<li><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/2476.EditParams2.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/2476.EditParams2.png" alt="" width="405" height="315" /></li>
</ol></ol>
<li>Select a Storage account next, this storage account is used to temporarily copy the template's json files to during the deployment process, and not for anything else</li>
<li>Click Deploy</li>
<li><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/3771.Deploy.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/3771.Deploy.png" alt="" width="508" height="367" /></li>
</ol>
<p>In the Output window, you can follow along as the Azure resources are being created.</p>
<p>You should see something like this in the Output window:</p>
<p><em>11:55:39 - Starting deployment. This may take a while...</em><br /><em>11:55:39 -&nbsp;&nbsp;&nbsp; Uploading template to Azure storage account 'defaultstoragerms'.</em><br /><em>11:55:39 -&nbsp;&nbsp;&nbsp; Creating resource group 'MyAzureCloudApp' in location 'westus'.</em><br /><em>11:55:40 -&nbsp;&nbsp;&nbsp; Creating deployment 'VS_website' in resource group 'MyAzureCloudApp'.</em><br /><em>11:55:40 -&nbsp;&nbsp;&nbsp; Deployment created. Waiting for provisioning to complete...</em><br /><em>11:55:50 -&nbsp;&nbsp;&nbsp; Successfully provisioned resource 'WebHostPlan'</em>.</p>
<p>After a minute or so it should all be done, and you can navigate to the Azure Portal to view your new Azure Resource Group, and the new websites inside of it.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/0841.AzurePortal.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65/0841.AzurePortal.png"><img src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/0841.AzurePortal.png" original-url="http://blogs.msdn.com/resized-image.ashx/__size/550x0/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65/0841.AzurePortal.png" alt="" border="0" /></a></p>
<p>&nbsp;</p>
<p>And the coolest part, since your website has been published you can navigate directly to it.</p>
<p><span style="font-size: 14pt;">Wrapping it up</span></p>
<p>That's it!</p>
<p>We took a quick look at how Visual Studio has some tooling now that allows you make a Web Project that uses the Azure Gallery Template.</p>
<p>You can edit these templates to customize your Azure resource deployments.</p>
<p>We did just this, and customized our template so that it deployed two websites instead of one, and so that the one of our websites used the MSDeploy resource to publish our web package.</p>
<p>This is an early release of our tooling, and I'd really love to hear any feedback you have about it our Azure Resource Manager in general.</p>
<p>Thanks, All&nbsp;</p>]]></content:encoded>
    </item>
    <item>
      <title>Visual Studio Database Project + Web Project Into One Web Package. YES. FOR REAL.</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/visual-studio-database-project-web-project-into-one-web-package-yes-for-real</link>
      <pubDate>Mon, 23 Jun 2014 12:53:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2014/06/23/visual-studio-database-project-web-project-into-one-web-package-yes-for-real/</guid>
      <description><![CDATA[Visual Studio SQL Database Projects are super cool projects that let you create and manage your SQL...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">Visual Studio <a href="http://www.mpspartners.com/2014/02/leveraging-visual-studio-2013-sql-server-database-projects/" target="_blank">SQL Database Projects</a> are super cool projects that let you create and manage your SQL databases in Visual Studio. They produce a .dacpac file that you can deploy to a SQL Database using msdeploy or other tools.</span></p>
<p><span style="font-size: small;">Visual Studio Web Projects are a great way to create a web site (duh).</span></p>
<p><span style="font-size: small;">Recently I was deploying my VS Web Project to a &ldquo;web package .zip&rdquo; file. And then using the .zip file to publish my web site to Azure (using some Azure PowerShell cmdlets mainly).</span></p>
<p><span style="font-size: small;">This was going great, until I wanted to publish the Database Project and the Web Project at the same time. To do this I figured I&rsquo;d just put the .dacpac file INSIDE of my web package .zip file. </span></p>
<p><span style="font-size: small;">Well, I couldn&rsquo;t figure this out for the longest time and didn&rsquo;t find much help online. </span></p>
<p><span style="font-size: small;">So I better write it down here, or who knows if I&rsquo;ll ever remember it.</span></p>
<h2>Simplest Walkthrough Ever &ndash; Make a dacpac</h2>
<p><span style="font-size: small;">First you&rsquo;ll want to make a SQL Database Project. This is pretty straightforward. </span></p>
<p><span style="font-size: small;">Create a New Project in Visual Studio and select &ldquo;SQL Server Database Project&rdquo;. After it&rsquo;s created, right click the project and select &ldquo;Add Table&rdquo;. Add whatever kind of table you want here. </span></p>
<p><span style="font-size: small;">In the solution explorer, double click on &ldquo;Properties&rdquo;. For this example we are going to change the &ldquo;Target Platform&rdquo; type to be &ldquo;SQL Azure Database&rdquo;.</span></p>
<p><span style="font-size: small;">Now &ldquo;Build&rdquo; the solution. In your \bin\debug folder you will find the output which will be a &ldquo;.dacpac&rdquo; file. Save this for later.</span></p>
<h2>Simplest Walkthrough Ever &ndash; Make a web project</h2>
<p><span style="font-size: small;">Now we&rsquo;ll make a simple web project. Create another project, and select &ldquo;ASP.NET Web Application&rdquo;. Let&rsquo;s make an &ldquo;Empty&rdquo; web project here. We don&rsquo;t need anything fancy.</span></p>
<p><span style="font-size: small;">Just build this project when it&rsquo;s done creating. The output will also be in the bin\debug folder.</span></p>
<h2>Simplest Walkthrough Ever &ndash; Make a Manifest.xml file</h2>
<p><span style="font-size: small;">We need to make a &ldquo;Manifest.xml&rdquo; file now. This file will contain some parameters about are web package that we are going to build. And we will give the manifest.xml file as input to MSDEPLOY.exe</span></p>
<p>&nbsp;<span style="font-size: small;">The manifest file will be called Manifest.xml and will look like this:</span></p>
<p>&lt;sitemanifest&gt; <br />&nbsp; &lt;iisApp path="C:\Users\matt\Documents\Visual Studio 2013\Projects\YourSolution\YourWebProject" /&gt; <br />&nbsp; &lt;dbDacFx path="C:\Users\matt\Documents\Visual Studio 2013\Projects\YourSolution\DBProj\bin\Debug\DBProj.dacpac" /&gt; <br />&lt;/sitemanifest&gt;</p>
<p><span style="font-size: small;">Alright, next thing is to write a MSDEPLOY command to consume this manifest file and output a web deploy package.</span></p>
<p><span style="font-size: small;">I&rsquo;ve written out below the necessary steps I used to create a package using MSDEPLOY:</span>&nbsp;</p>
<div style="border: 1px solid black; width: 500px; height: 200px; -ms-overflow-x: scroll; -ms-overflow-y: hidden;">
<p style="width: 450%;">CALL "c:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" ^ <br />-verb:sync ^ <br />-source:manifest=Manifest.xml ^ <br />-dest:package=MattsWebData.zip ^ <br />-declareParam:name="IIS Web Application Name",defaultValue="YourAzureWebSiteName",tags="IisApp" ^ <br />-declareParam:name="IIS Web Application Name",kind=ProviderPath,scope="IisApp",match="^c:\\yourWebProjPath\\obj\\Debug\\Package\\PackageTmp$" ^ <br />-declareParam:name="IIS Web Application Name",kind=ProviderPath,scope="setAcl",match="^c:\\yourWebProjPath\\obj\\Debug\\Package\\PackageTmp$" ^ <br />-declareParam:name="DefaultConnection-Web.config Connection String",defaultValue="Data Source=azureserver.database.windows.net;Initial Catalog=azuredb;Persist Security Info=True;User ID=yourUser;Password=yourPW" ^ <br />-declareParam:name="DefaultConnection-Web.config Connection String",kind=ProviderPath,scope=dbDacFx,match="^C:\\pathToYourDBProject\\bin\\Debug\\DBProj.dacpac" ^ <br />-declareParam:name="DefaultConnection-Web.config Connection String",kind=XmlFile,scope="c:\\pathToYourWebProject\\obj\\Release\\Package\\PackageTmp\\Web\.config$",match="/configuration/connectionStrings/add[@name='DefaultConnection']/@connectionString"</p>
</div>
<p><span style="font-size: small;">Put that into a .BAT script, or type it from a command prompt.</span></p>
<p><span style="font-size: small;">This is going to create a web package, and correctly set the parameters for us inside of the web package.</span></p>
<p><span style="font-size: small;">Run it.</span></p>
<p><span style="font-size: small;">After this is done, you will have a Web Deploy Package .ZIP file that contains your dacpac AND your web project!</span></p>
<h2>Publish it</h2>
<p><span style="font-size: small;">Before you publish it, make sure you&rsquo;ve already create an Azure Web Site and an Azure Database with the correct names as you&rsquo;ve specified. You can do this right through the Azure Portal (<a href="http://manage.windowsazure.com">http://manage.windowsazure.com</a>).</span></p>
<p><span style="font-size: small;">The easiest way in the whole world to publish a web project to an Azure Website is to just use the Azure PowerShell cmdlets.</span></p>
<p><span style="font-size: small;">Here&rsquo;s how you do that:</span></p>
<p><span style="font-size: small;">1) Download the Web Platform Installer - <a href="http://www.microsoft.com/web/downloads/platform.aspx">www.microsoft.com/web/downloads/platform.aspx</a></span></p>
<p><span style="font-size: small;">2) Search on &ldquo;Azure PowerShell&rdquo; and install it (you &ldquo;may&rdquo; have to reboot after install).</span></p>
<p><span style="font-size: small;">3) Open up Azure PowerShell as an Administrator. </span></p>
<blockquote>
<p><span style="font-size: small;">-Set your execution policy for PowerShell using &ldquo;<a href="http://technet.microsoft.com/en-us/library/ee176961.aspx" target="_blank">Set-ExecutionPolicy RemoteSigned</a>&rdquo;</span></p>
<p><span style="font-size: small;">-Run &ldquo;Add-AzureAccount&rdquo; to add your Azure subscription to the session</span></p>
<p><span style="font-size: small;">-Run &ldquo;Publish-AzureWebsiteProject &ndash;Name yourwebsite &ndash;Package .\yourwebpackage.zip&rdquo;</span></p>
</blockquote>
<p><span style="font-size: small;">4) Wait around 20 seconds</span></p>
<p><span style="font-size: small;">That should be it. Check it out on Azure and you should see that your database was updated and the website was updated.</span></p>
<h2>Help, it didn&rsquo;t work!</h2>
<p><span style="font-size: small;">If it didn&rsquo;t work here&rsquo;s a couple things to try&hellip;</span></p>
<p><span style="font-size: small;">-Use the <a title="KUDU Service" href="http://blogs.msdn.com/b/rmattsampson/archive/2014/01/06/getting-lightswitch-memory-dumps-and-so-much-more-using-kudu.aspx">KUDU service</a> to examine the data logs and see what the actual error was (navigate down to the .\data\msdeploy\ folder).</span></p>
<p><span style="font-size: small;">-Also you can try opening up the web deploy .zip package you made. Look at the &ldquo;Parameters.xml&rdquo; file in there. Make sure there&rsquo;s no obvious path errors or anything like that. Also, make sure you don&rsquo;t have &ldquo;^^&rdquo; double caret symbols either. If you do, you can easily just extract the zip file to a folder. Modify the parameters.xml file. And then ZIP the whole thing up again back into a .zip file.</span></p>
<p>&nbsp;</p>
<p><span style="font-size: small;">I hope this was helpful. Let me know if it worked or didn&rsquo;t work for you.</span></p>
<p><span style="font-size: small;">FOLLOW ME too &ndash; <a href="https://twitter.com/trampsanstom">https://twitter.com/trampsanstom</a></span></p>
<p><span style="font-size: small;">THANKS! </span></p>
<p><span style="font-size: small;">-Matt Sampson</span></p>]]></content:encoded>
    </item>
    <item>
      <title>Azure Development with VMs with Azure SDK 2.3 and Update 2 RC</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/azure-development-with-vms-with-azure-sdk-2-3-and-update-2-rc</link>
      <pubDate>Thu, 03 Apr 2014 08:11:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2014/04/03/azure-development-with-vms-with-azure-sdk-2-3-and-update-2-rc/</guid>
      <description><![CDATA[A new era of developing and testing in the cloud is upon us!
(Well I may be exaggerating a...]]></description>
      <content:encoded><![CDATA[<p>A new era of developing and testing in the cloud is upon us!</p>
<p>(Well I may be exaggerating a bit)</p>
<p>For a while now Microsoft has been working on improving our <a href="http://www.windowsazure.com/en-us/solutions/dev-test/" target="_blank">Develop and Test</a> experience of web apps for all of our Azure cloud developers out there. Things are about to get a lot better with these new releases of the Azure SDK 2.3 and Update 2 RC.</p>
<p>One of the coolest contributions we had made in previous releases to Dev/Test is the ability to easily get Virtual Machines up and running in the cloud. These VM's could be setup to already have things like Visual Studio 2013 installed, SharePoint, or SQL, etc..</p>
<p>Starting with the new release of Azure SDK 2.3 and Update 2 (RC), you will also be able to provision a Windows Server VM that has IIS and Web Deploy enabled! This effectively gives you a web server in the cloud that you can develop and test your web apps against.</p>
<p>How cool is that?!&nbsp;</p>
<p>This is good news for those of us who are interested in IaaS (Infrastructure as a Service), and awesome news for those of us who are cloud web developers.</p>
<p>No more setting up ON-PREM IIS machines with Web Deploy for web development for me. I&rsquo;ll just be having Visual Studio make one up in Azure for me when I need it. Plus then I get the benefit of developing and testing my web app completely in the cloud.</p>
<p>Today I&rsquo;m just going to do a simple walk through of these features here.</p>
<p>Go get your box setup before we get rocking:</p>
<p>-Go <a href="http://www.microsoft.com/en-us/download/details.aspx?id=42307" target="_blank">download Visual Studio 2013 Update 2 RC</a>.</p>
<p>-Go get the Azure SDK 2.3 (for VS 2013) using <a href="http://www.microsoft.com/web/downloads/platform.aspx" target="_blank">Web Platform installer</a></p>
<p>-Go download the Azure PowerShell latest using <a href="http://www.microsoft.com/web/downloads/platform.aspx" target="_blank">Web Platform installer</a></p>
<h2>Show me the experience!</h2>
<p>Let's walk through a simple end to end scenario here to show off the new features we've added around the Dev/Test experience.</p>
<p>We'll start by launching VS, making a web app project, and creating a VM with IIS and Web Deploy already enabled.</p>
<p>Launch Visual Studio.</p>
<p>Select File-&gt;New Project.</p>
<p>We'll pick the ASP.NET Web Project template. Hit OK, and you'll see the ASP.NET project dialog now looks like:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/3323.image_3D59D7D4.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/3323.image_5F00_3D59D7D4.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/0511.image_thumb_46496A13.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/0511.image_5F00_thumb_5F00_46496A13.png" alt="image" width="644" height="482" border="0" /></a></p>
<p>&nbsp;</p>
<p>We've got this new option in the bottom right of the wizard that will let us automatically create an Azure Web Site or Virtual Machine resource at the same time we make our project. We'll select the Virtual Machine option from the combobox. Hit OK.</p>
<p>You may need to login to Azure at this point (or sign up for free if you have an <a href="http://www.windowsazure.com/en-us/pricing/member-offers/msdn-benefits/?WT.mc_id=azurebg_us_sem_bing_br_MSDN_nontest_web&amp;WT.srch=1">MSDN Subscription</a>)</p>
<p>At this point you'll see a dialog to create a new Virtual Machine:</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/8463.image_38CA67FC.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/8463.image_5F00_38CA67FC.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/6740.image_thumb_3B06F0B8.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/6740.image_5F00_thumb_5F00_3B06F0B8.png" alt="image" width="595" height="484" border="0" /></a></p>
<p>You can provide a few parameters here specifying what type of VM you want.</p>
<p>1) OS Image - you can select from any User Images, MSDN Images, or Microsoft Windows Images</p>
<p>2) <a href="http://msdn.microsoft.com/en-us/library/windowsazure/dn197896.aspx" target="_blank">VHD Size</a> - pick a size for you VM</p>
<p>3) Enable IIS and Web Deploy - check this box if you want your VM to automatically have IIS and Web Deploy. Who wouldn&rsquo;t want this?</p>
<p>4) Region - You can either select an <a href="http://blogs.msdn.com/controlpanel/blogs/posteditor.aspx/social.technet.microsoft.com/wiki/contents/articles/7916.importance-of-windows-azure-affinity-groups.aspx" target="_blank">Affinity Group</a>, <a href="http://www.windowsazure.com/en-us/services/virtual-network/" target="_blank">Virtual Network</a> and Subnet, or an Azure region here which will designate where you VM should be created</p>
<p>Once you are done, hit OK. And now you&rsquo;ll see some output messages about how the VM is being created up in Azure and then about how it is being configured. Be patient here as this can take over 10 minutes to complete (if you selected &ldquo;Enable IIS and Web Deploy&rdquo; it will likely take at least 10 minutes)</p>
<p>If you want, you can hop over to the Azure portal and see how it&rsquo;s made a new Cloud Service and Virtual machine. It also added a storage account as well (this is needed for the Virtual Machine&rsquo;s VHD).</p>
<p>Until this completes, you&rsquo;ll notice that some resources have been added to your solution &ndash; 2 PowerShell scripts, and 1 JSON configuration file.</p>
<p>Let&rsquo;s take a look at these.</p>
<h2>PowerShell (PS) scripts and a JSON file</h2>
<p>These PS scripts have a lot of power built into them. They can do a number of things for you to make your cloud development and testing easier. These scripts know how to create Azure web sites, publish to Azure web sites, create Azure VM&rsquo;s, publish to Azure VM&rsquo;s, and create SQL Azure DB&rsquo;s as well in the case of Azure web sites.</p>
<p>The scripts don&rsquo;t have any dependencies on VS. And can run on completely separate machine. They can be automated in a build environment. They can be shared with the other developers on your team. The scripts themselves don&rsquo;t &ldquo;change&rdquo; from project to project.</p>
<p>So what is this JSON configuration for? This is consumed by the PS Scripts (it is NOT consumed by VS or the Web App Publish Wizard). It basically contains either all the parameters needed to create or publish to an Azure web site (like the name, the region, etc), or, in this example, it contains all the parameters needed to create or publish to an Azure VM.</p>
<p>You&rsquo;ll see it&rsquo;s got all the information regarding the VM we setup. It has the size, name, region, OS, the endpoints that it&rsquo;s going to open, etc.</p>
<p>Looking at it you&rsquo;ll see that VS has added coloring and formatting for JSON files. Sweet!</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/1641.image_4AA98C7A.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/1641.image_5F00_4AA98C7A.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/0412.image_thumb_580F9F80.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/0412.image_5F00_thumb_5F00_580F9F80.png" alt="image" width="644" height="476" border="0" /></a></p>
<p>Open up any of the PS Scripts in the VS Editor. You&rsquo;ll see that we now have coloring for PS Scripts as well.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/0447.image_01309CDD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/0447.image_5F00_01309CDD.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/3286.image_thumb_113F6B94.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/3286.image_5F00_thumb_5F00_113F6B94.png" alt="image" width="644" height="324" border="0" /></a></p>
<p>Again - How cool is that!?</p>
<p>You can also right click on any PS Script and open it up in the PowerShell ISE. Let&rsquo;s do that now. Right click on the .PS1 script and open it up in the PowerShell ISE.</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/5672.image_7A13F115.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/5672.image_5F00_7A13F115.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/6281.image_thumb_37A3DF90.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/6281.image_5F00_thumb_5F00_37A3DF90.png" alt="image" width="644" height="426" border="0" /></a></p>
<p>&nbsp;</p>
<p>We are now going to walkthrough creating a VM using the PS Scripts. Before we get started here, a few pre-requisites:</p>
<p>1) You need to have at least <a href="http://www.microsoft.com/en-us/download/details.aspx?id=40855">PowerShell (PS) 3.0</a> installed (find out what version you have by typing &ldquo;$PSVersionTable&rdquo; in PS.)</p>
<p>2) You need the latest version of <a href="file://trinlab2/msdn.microsoft.com/en-us/library/windowsazure/jj156055.aspx">Azure PowerShell</a> as mentioned earlier (you can get this through the <a href="http://www.microsoft.com/web/downloads/platform.aspx" target="_blank">Web Platform installer</a>)</p>
<p>a. You&rsquo;ll need to run the &ldquo;Add-AzureAccount&rdquo; script to add your Azure credentials.</p>
<p>3) You need to set your <a href="http://technet.microsoft.com/en-us/library/ee176961.aspx">PowerShell&rsquo;s execution policy</a> to be RemoteSigned or Unrestricted.</p>
<p>4) For this example to work, you&rsquo;ll need a Web package that we&rsquo;ll publish. Create one through the web app we just made by right clicking the Web Application project and selecting Publish. Then during the Publish Wizard make sure you publish it a web (.zip) package.</p>
<p>5) (YOU MAY HAVE TO DO THIS STEP) You might have to import Azure PS module for the very first time. You can do this with this PS command:</p>
<p><em>Import-Module &lsquo;[SYSTEM DRIVE]:\Program Files (x86)\Microsoft SDKs\Windows Azure\PowerShell\Azure\Azure.psd1&rsquo;</em></p>
<h2>Now for some PS Action</h2>
<p>Alright, that&rsquo;s out of the way. Let&rsquo;s get started using this PS script</p>
<p>The PS1 file that is opened in our PS ISE is the main &ldquo;entry&rdquo; point that we&rsquo;ll use to generate or publish to our Azure resources (i.e. Azure web sites and Azure VMs). The PSM1 file is a module file, or a library basically of some commonly used PS functions.</p>
<p>You can always use the <a href="http://technet.microsoft.com/en-us/library/ee176848.aspx">&ldquo;Get-Help&rdquo;</a> PS cmdlet to find out more about what these PS scripts do (e.g. <em>GET-HELP .\ScriptName.ps1</em>).</p>
<p>We&rsquo;re going to do a couple things here with our PS Scripts:</p>
<p>1) Create an Azure VM that has IIS and Web Deploy enabled</p>
<p>2) Publish a web package to it</p>
<p>Before we do this we need to modify our JSON configuration file. You can do this right from VS if you want.</p>
<p>You&rsquo;ll want to change the following 2 parameters &ndash; the Virtual Machine <em>name</em> and the Cloud Service <em>name</em>. Give both of these a unique name. You can also specify the VM user&rsquo;s password right in the JSON file (if you don&rsquo;t want to do it here, you&rsquo;ll need to do it on the PS command line).&nbsp; You can certainly change more parameters if you want, but this is the minimum we&rsquo;ll need to create a new Azure VM.</p>
<p>You can certainly skip this step. And just publish the web package the VM we&rsquo;ve already made. Nothing wrong with that. If you want to do that then just do nothing to the JSON file (except you will have to type in your password and save it, unless you want to pass in the password on the PS command line to the PS Script like so: <em>&ndash;VMPassword @{name=&rsquo;myname&rsquo;;password=&rsquo;mypassword&rsquo;}&nbsp; </em>)</p>
<p>Save your changes to the JSON. Switch back to the PS ISE.</p>
<p>Type the following:</p>
<p>&gt; &lt;Name Of Your PS1&gt;.ps1 &ndash;Configuration .\configurations\&lt;name of your JSON&gt;.json &ndash;Verbose &ndash;WebDeployPackage &lt;path to your web package&gt; -AllowUntrusted</p>
<p>The &ldquo;-Verbose&rdquo; flag isn&rsquo;t necessary, but I like to know everything my scripts are doing, and the &ndash;Verbose flag will output all the scripts runtime messages for you.</p>
<p>The &ldquo;-AllowUntrusted&rdquo; flag is necessary. And this is because the Azure VM&rsquo;s Web Deploy certificate we are deploying to is not a trusted certificate.</p>
<p>Let&rsquo;s run this command run now. It could take a while (around 10-20 minutes. Most of that time is setting up IIS and Web Deploy.).</p>
<p>Once it&rsquo;s done, (and the PS Script will tell you when it&rsquo;s done), you should be able to launch your web site, which will be something like: <a href="http://<myVMname>.cloudapp.net/">.cloudapp.net/"&gt;http://&lt;myVMname&gt;.cloudapp.net/</a></p>
<h2>Wrap it up</h2>
<p>There&rsquo;s more to show off here that I&rsquo;ll have to do in another blog post.</p>
<p>But to summarize what we did:</p>
<p>1) Created an Azure VM with IIS and Web Deploy as part of our web project creation experience</p>
<p>2) Automatically had some PS Scripts and a JSON configuration file added to our solution to give us more flexibility when creating and publishing web apps to Azure</p>
<p>3) Used those PS Scripts and JSON file to create an Azure VM and publish a simple web app to it.</p>
<blockquote>
<p>You can find a LOT more about the PS Scripts on this great MSDN Article:- <a href="http://msdn.microsoft.com/library/azure/dn642480.aspx" target="_blank">Using Windows PowerShell Scripts to Publish to Dev and Test Environments</a></p>
</blockquote>
<p>Hopefully this IaaS and Dev/Test demo was useful to you.</p>
<p>Let me see any feedback you have!</p>
<p>Find me on Twitter - <a title="https://twitter.com/TrampSansTom" href="https://twitter.com/TrampSansTom">https://twitter.com/TrampSansTom</a></p>
<p>And big thanks to my co-worker and friend Raghuveer who helped with this article (find him on Twitter as well - <a title="https://twitter.com/hey_krish" href="https://twitter.com/hey_krish">https://twitter.com/hey_krish</a>)</p>
<p>Thanks &ndash; Matt Sampson</p>
<div id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:626532ba-e918-4132-ac8b-612b0ea6a494" class="wlWriterEditableSmartContent" style="margin: 0px; padding: 0px; float: none; display: inline;">Technorati Tags: <a href="http://technorati.com/tags/Azure" rel="tag">Azure</a>,<a href="http://technorati.com/tags/Visual+Studio+2013" rel="tag">Visual Studio 2013</a>,<a href="http://technorati.com/tags/IaaS" rel="tag">IaaS</a></div>]]></content:encoded>
    </item>
    <item>
      <title>What Version of Azure PowerShell am I running?</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/what-version-of-azure-powershell-am-i-running</link>
      <pubDate>Tue, 01 Apr 2014 06:45:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2014/04/01/what-version-of-azure-powershell-am-i-running/</guid>
      <description><![CDATA[Unable to find a decent answer to this question on all of the internets I checked, I figured I'd...]]></description>
      <content:encoded><![CDATA[<p>Unable to find a decent answer to this question on all of the internets I checked, I figured I'd better step up to the challenge and answer this simple question.</p>
<p><br />So you've installed Azure PowerShell.</p>
<p>Now you are asking yourself "WHAT VERSION OF AZURE POWERSHELL HAVE I INSTALLED?!"</p>
<p>First, stop screaming. Find that Caps Lock Key.</p>
<p>&nbsp;</p>
<p><strong>Updated way: </strong>The easiest way in the world to do this &ndash; launch an Azure PowerShell session. And then type the following:</p>
<p>&gt; <em>get-module azure</em></p>
<p>ModuleType&nbsp; Version&nbsp;&nbsp;&nbsp; Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ExportedCommands&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />----------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -------&nbsp;&nbsp;&nbsp; ----&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ----------------&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />Binary&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 0.7.4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Azure&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {Add-AzureAccount, Add-AzureCacheWorkerRole, Add-AzureCertificate, Add-AzureDataDisk...}&nbsp;&nbsp;&nbsp;</p>
<p>You can see right in the output there is the version of Azure (0.7.4) in this case.</p>
<p>A secondary way to do this is to actually look at the web request itself:</p>
<p>1) Use the Web Platform Installer to install the latest Azure PowerShell version (<a href="http://www.microsoft.com/web/downloads/platform.aspx">http://www.microsoft.com/web/downloads/platform.aspx)</a></p>
<p>2) Launch an Azure Powershell session</p>
<p>3) Run the Add-AzureAccount command and add your azure account</p>
<p>4) Install and launch Fiddler - <a href="http://www.telerik.com/fiddler">http://www.telerik.com/fiddler</a> (I can't do my job without Fiddler, so keep this thing around)</p>
<p>5) Enable HTTPS Decryption in Fiddler (takes 2 clicks to do -<a href="http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/DecryptHTTPS">http://docs.telerik.com/fiddler/Configure-Fiddler/Tasks/DecryptHTTPS</a> )</p>
<p>6) Run some benign Azure PowerShell command now like "Get-AzureLocation"</p>
<p>7) Look at the awesome output in Fiddler - find your Web Request, select it, then on the right side of the screen select INSPECTORS tab and then the HEADERS sub tab</p>
<p>8) You should see some Client: User-Agent header like -</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/1638.image_6CF551DA.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/1638.image_5F00_6CF551DA.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/3162.image_thumb_1E6F1655.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/3162.image_5F00_thumb_5F00_1E6F1655.png" alt="image" width="525" height="134" border="0" /></a></p>
<p>&nbsp;</p>
<p>At the end of the User Agent is the version &ndash; v.0.7.4 in this case.</p>
<p><br />HTH! &ndash; more posts coming soon</p>
<p>Matt Sampson</p>]]></content:encoded>
    </item>
    <item>
      <title>Getting LightSwitch Web App Memory Dumps and so much more using KUDU</title>
      <link>https://docs.microsoft.com/archive/blogs/rmattsampson/getting-lightswitch-web-app-memory-dumps-and-so-much-more-using-kudu</link>
      <pubDate>Mon, 06 Jan 2014 09:59:00 GMT</pubDate>
      <dc:creator><![CDATA[Matt Sampson]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/rmattsampson/2014/01/06/getting-lightswitch-web-app-memory-dumps-and-so-much-more-using-kudu/</guid>
      <description><![CDATA[There&rsquo;s an nice little diagnostic tool that is available for all Windows Azure Web Sites that...]]></description>
      <content:encoded><![CDATA[<p><span style="font-size: small;">There&rsquo;s an nice little diagnostic tool that is available for all Windows Azure Web Sites that I came across called <a href="http://github.com/projectkudu/kudu" target="_blank">KUDU</a>.</span></p>
<p><span style="font-size: small;">KUDU is one of those neat little things that is developed here at Microsoft that I seem to just accidentally stumble into (like <a href="http://blogs.msdn.com/b/rmattsampson/archive/2013/03/14/asp-net-signalr-in-lightswitch.aspx" target="_blank">SignalR</a>). </span></p>
<p><span style="font-size: small;">So in this blog, I&rsquo;m going to give a brief demo of how you can use the KUDU diagnostic service with your own LightSwitch Web Apps that is deployed to a Windows Azure Web Site. But truthfully, you could use this with any azure web site (not just LightSwitch).</span></p>
<p><span style="font-size: small;">If you are someone who loves having debugging tools at your disposal like, KUDU, and you use Azure Web Sites, then this blog is for you :).</span></p>
<h1>Publish a LightSwitch Web App to an Azure Web Sites</h1>
<p><span style="font-size: small;">I won&rsquo;t be going over how to publish a LightSwitch app to an Azure Web Site since there are already so many walkthroughs on how to do this (like this one - <a href="http://msdn.microsoft.com/en-us/library/windowsazure/jj131261.aspx" target="_blank">How to: Publish a LightSwitch Application to Windows Azure</a>). But you will need to get this step done before we can continue. If you already have a recent deployment, then we can use that too.</span></p>
<p><span style="font-size: small;">Launch the <a href="http://www.windowsazure.com/en-us/" target="_blank">Azure Portal</a> and navigate to your Azure Web Site. You should see an option to &ldquo;<em>Set up deployment credentials</em>&rdquo; (unless you have already done this in the past, in which case you should have these credentials setup already). </span></p>
<p>&nbsp;</p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/6332.image_3511A4C6.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/6332.image_5F00_3511A4C6.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/1641.image_thumb_4BD3}.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/1641.image_5F00_thumb_5F00_4BD37D00.png" alt="image" width="449" height="317" border="0" /></a></p>
<p><span style="font-size: small;">Go ahead and click this link. Then setup your login and password. The KUDU service requires credentials before you can use it, and it&rsquo;s going to use these credentials that you just setup.</span></p>
<h1>Check out the KUDU Service</h1>
<p><span style="font-size: small;">We&rsquo;ll get to collecting a memory dump from our web site in a minute, but first let&rsquo;s just look at the KUDU service some more.</span></p>
<p><span style="font-size: small;">The KUDU service has something like a &ldquo;Dashboard&rdquo; that you can access (with your credentials): <a href="https://mywebsitename.scm.azurewebsites.net">https://&rdquo;mywebsitename&rdquo;.scm.azurewebsites.net</a></span></p>
<p><span style="font-size: small;">The dashboard looks like this:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/2555.image_5140D1BD.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/2555.image_5F00_5140D1BD.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/6864.image_thumb_6C792ABE.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/6864.image_5F00_thumb_5F00_6C792ABE.png" alt="image" width="398" height="325" border="0" /></a></p>
<p><span style="font-size: small;">There&rsquo;s some information on how to use the REST API (which we&rsquo;ll do later on), and at the top there are some other functions, like &ldquo;Debug Console&rdquo;. Which is very cool IMO.</span></p>
<p><span style="font-size: small;">If you select Debug Console and then click the Sites folder, you&rsquo;ll see something like this:</span></p>
<p><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/4743.image_08F73886.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/4743.image_5F00_08F73886.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/3582.image_thumb_7D617B46.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/3582.image_5F00_thumb_5F00_7D617B46.png" alt="image" width="394" height="269" border="0" /></a></p>
<p><span style="font-size: small;">These are the web app&rsquo;s files on some machine up in the &ldquo;cloud&rdquo;. All the files you published are up here.</span></p>
<p><span style="font-size: small;">I fell out of my seat with excitement when I first saw this. You can do some great stuff here like edit the web.config file (to do something like enabling tracing), or add new files (as I have done with the cleverly named &ldquo;New Text Document.txt&rdquo;).&nbsp; You could do these things before of course through other methods, but this streamlines the whole experience and makes it more familiar to use.</span></p>
<h1><span style="font-size: small;">Get a Memory Dump</span></h1>
<p><span style="font-size: small;">We will now use the KUDU Service to get ourselves a dump of the process that hosts our web application. All the different ways to get various types of process DUMP files are documented on the <a href="https://github.com/projectkudu/kudu/wiki/Process-Threads-list-and-minidump-gcdump-diagsession" target="_blank">KUDU GitHub site.</a>&nbsp; Remember any requests you make are going to be counted as part of your usage quota for your Azure Subscription.&nbsp; The one we are going to get is a GCDUMP, which is a memory dump and something we can look at using VS 2013 Ultimate.&nbsp; </span></p>
<p><span style="font-size: small;">Launch a PowerShell script. And input the following script call to the KUDU service to retrieve the first process (i.e. w3wp.exe) and get a GCDUMP of it:</span></p>
<pre>Invoke-WebRequest -uri <a href="https://%3cwebsite%3e.scm.azurewebsites.net/diagnostics/processes/0/gcdump">https://&lt;Website&gt;.scm.azurewebsites.net/diagnostics/processes/0/gcdump</a> </pre>
<pre>-credential &lt;YourDeploymentUser&gt; -outfile .\dump.diagsession</pre>
<div align="left"><span style="font-family: Segoe UI; font-size: small;">We are writing a dump.diagsession file as the output from this call. </span><span style="font-family: Segoe UI; font-size: small;">When you open it in VS it should look something like: </span>
<pre><a href="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/8836.image_66CEB572.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/8836.image_5F00_66CEB572.png"><img style="display: inline;" title="image" src="https://msdnshared.blob.core.windows.net/media/MSDNBlogsFS/prod.evol.blogs.msdn.com/CommunityServer.Blogs.Components.WeblogFiles/00/00/01/44/65/metablogapi/6607.image_thumb_6FBE47B1.png" original-url="http://blogs.msdn.com/cfs-file.ashx/__key/communityserver-blogs-components-weblogfiles/00-00-01-44-65-metablogapi/6607.image_5F00_thumb_5F00_6FBE47B1.png" alt="image" width="561" height="234" border="0" /></a></pre>
<span style="font-family: Segoe UI; font-size: small;">Which is a very nice low level view of the memory usage by our application. </span><span style="font-family: Segoe UI; font-size: small;">You could dig down into it at this point and figure out where most of your memory usage is going.</span>
<h1>THAT IS IT</h1>
<p><span style="font-size: small;">I hope that opens up your world to another diagnostic tool you could use to debug your LightSwitch Azure Web Site.</span></p>
<p><span style="font-size: small;">Thanks for reading. You all rock. Have a good code! &ndash; Matt Sampson</span></p>
</div>
<p><span style="font-family: Segoe UI; font-size: small;">&nbsp;Follow me on Twitter -&nbsp;</span>&nbsp;<a href="https://twitter.com/TrampSansTom">https://twitter.com/TrampSansTom</a></p>
<p>&nbsp;</p>]]></content:encoded>
    </item>
  </channel>
</rss>