<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>bradygaster.com</title><link>http://www.bradygaster.com:80/</link><description>bradygaster.com</description><item><title>Running SSL with Windows Azure Web Sites Today</title><link>http://www.bradygaster.com:80/running-ssl-with-windows-azure-web-sites</link><description>&lt;p&gt;If you’re a web developer working with ASP.NET, Node.js, PHP, Python, or you have plans on building your site in C++, Windows Azure Web Sites is the best thing since sliced bread. With support for virtually every method of deployment and with support for most of the major web development models you can’t beat it. Until recently, SSL was the only question mark for a lot of web site owners, as WAWS doesn’t yet support SSL out of the box (trust me, it’s coming, I promise). The good news is that there’s a method of achieving SSL-secured sites &lt;strong&gt;now&lt;/strong&gt;. In this blog post I’ll introduce the idea of a workaround my engineering friends in the Web Sites team call the SSL Forwarder, and to demonstrate how you can get up and running with an SSL-protected Windows Azure-hosted web site in just a few minutes’ work.&lt;/p&gt; &lt;h2&gt;Disclaimer&lt;/h2&gt; &lt;p&gt;First, I’d like to point out one very important point about the SSL Forwarder solution. This solution works, and we have a handful of community members actively using this solution to provide an SSL front-end for their web sites. So feel comfortable using it, but understand that this isn’t something you’ll have to do forever, as SSL is indeed coming as an in-the-box feature for Web Sites. If you love the idea of Windows Azure Web Sites but the lack of in-the-box SSL support is a deal-breaker for you and your organization, this is a viable option to get you up and running &lt;em&gt;now&lt;/em&gt;. However, the SSL Forwarder isn’t an officially supported solution, in spite of one being actively used by numerous customers. So if you set this up and you experience anything weird, feel free to contact me directly via the comment form below, or on Twitter, or by email (and I’ll give you my email address on Twitter if you need it). All that being said, I’ve heard from quite a few in the community who are using this solution that it has mitigated their concern and they appear to be running quite well with this in place.&lt;/p&gt; &lt;h2&gt;Architectural Overview&lt;/h2&gt; &lt;blockquote&gt; &lt;p&gt;Don’t panic when you see this solution. &lt;em&gt;&lt;strong&gt;Do&lt;/strong&gt;&lt;/em&gt; read the introduction, once you see grok how it all works, the SSL Forwarding solution is a whole lot less intimidating. I admit to having freaked out with fear when I first saw this. I’m no expert at most of the things involved in this exercise, but the Web Sites team literally put together a “starter project” for me to use, and it took me 1 hour to get it working. If I can do this, &lt;strong&gt;you can do this&lt;/strong&gt;.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/SSL-Forwarder-Diagram_4_Updated_2.png"&gt;&lt;img title="SSL-Forwarder-Diagram_4_Updated" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: right; padding-top: 0px; padding-left: 0px; margin: 0px 0px 0px 10px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SSL-Forwarder-Diagram_4_Updated" align="right" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/SSL-Forwarder-Diagram_4_Updated_thumb.png" width="240" height="484"&gt;&lt;/a&gt;The idea of the SSL Forwarder is pretty simple. You set up a &lt;a href="http://www.windowsazure.com/en-us/home/features/cloud-services/"&gt;Cloud Service&lt;/a&gt; using the Windows Azure portal that redirects traffic to your Windows Azure Web Site. You can use all the niceties of Web Sites (like Git deployment, &lt;a href="http://channel9.msdn.com/Series/Windows-Azure-Web-Sites-Tutorials/Dropbox-Deployment-to-Windows-Azure-Web-Sites"&gt;DropBox integration&lt;/a&gt;, and publishing directly to your site using &lt;a href="http://www.microsoft.com/visualstudio/"&gt;Visual Studio&lt;/a&gt; or &lt;a href="http://www.microsoft.com/web/webmatrix/"&gt;WebMatrix&lt;/a&gt;) to actually build your web site, but the requests actually resolve to your Cloud Service endpoint, which then proxies HTTP traffic into your Web Site.&lt;/p&gt; &lt;p&gt;The diagram to the right shows how this solution works, at a high level. The paragraph below explains it in pretty simple terms. I think you’ll agree that it isn’t that complicated and that the magic that occurs works because of tried-and-true IIS URL Rewrite functionality. In order to obtain the 99.9% uptime as outlined in the &lt;a href="http://www.windowsazure.com/en-us/support/legal/sla/"&gt;Windows Azure SLA&lt;/a&gt;, you’ll need to deploy at least 2 instances of the Cloud Service, so the diagram shows 2 instances running. As well, the code provided with this blog post as a starting point is defaulted to start 2 instances. You can back this off or increase it however you want, but the 99.9% uptime is only guaranteed if you deploy the Cloud Service in 2 instances or more (and there’s no SLA in place yet for Web Sites, since it’s still in preview at the time of this blog post’s release, so you can host your Web Site on as many or as few instances as you like).&lt;/p&gt; &lt;p&gt;You map your domain name to your Cloud Service. Traffic resolves to the Cloud Service, and is then reverse-proxied back to your Web Site. The Cloud Service has 1 Web Role in it, and the Web Role consists of a single file, the Web.config file. The Web.config in the Web Role contains some hefty IISRewrite rules that direct traffic to the Web Site in which your content is hosted. In this way, all traffic – be it HTTP or HTTPS traffic – comes through the Cloud Service and resolves onto the Web Site you want to serve. Since Cloud Services support the use of custom SSL certificates, you can place a certificate into the Cloud Service, and serve up content via an HTTPS connection.&lt;/p&gt; &lt;h2&gt;Setup&lt;/h2&gt; &lt;p&gt;To go along with this blog post, there’s a &lt;a href="http://github.com"&gt;GitHub.com&lt;/a&gt; &lt;a href="https://github.com/WindowsAzure-Samples/WawsSslForwarder"&gt;repository&lt;/a&gt; containing a Visual Studio 2012 solution you can use to get started. This solution contains three projects:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;A Windows Azure Cloud Project  &lt;li&gt;A web site that’s used as a Web Role for the Cloud Project  &lt;li&gt;A web site that’s deployed to Windows Azure Web Sites (you’ll want to replace this one with the project you’re deploying or just remove it, it’s just there as part of the sample) &lt;/li&gt;&lt;/ul&gt; &lt;h3&gt;Create the Cloud Service and Web Site&lt;/h3&gt; &lt;p&gt;First thing is, I’ll need to create a Web Site to host the site’s code. Below is a screen shot of me creating a simple web site myself using the Windows Azure portal.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/1_2.png"&gt;&lt;img title="1" 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="1" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/1_thumb.png" width="644" height="397"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Obviously, I’ll need to create a Windows Azure Cloud Service, too. In this demo, I’ll be using a new Cloud Service called &lt;em&gt;SSLForwarder&lt;/em&gt;, since I’m not too good at coming up with funky names for things that don’t end in a capital R (and when I do, &lt;a href="https://twitter.com/haacked/status/241179056291323905"&gt;Phil teases me&lt;/a&gt;, so I’ll spare him the ammunition). Below is another screen shot of the Windows Azure portal, with the new Cloud Service being created.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/2_2.png"&gt;&lt;img title="2" 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="2" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/2_thumb.png" width="644" height="397"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If you’re following along at &lt;span style="text-decoration: line-through"&gt;home&lt;/span&gt; work, leave your browser open when you perform the next step, if you even &lt;strong&gt;need&lt;/strong&gt; to perform the next step, as it is an optional one.&lt;/p&gt; &lt;h3&gt;Create a Self-signed Certificate&lt;/h3&gt; &lt;p&gt;This next step is optional, and only required if you don’t already have an SSL certificate in mind that you’d like to use. I’ll use the IIS Manager to create my own self-signed certificate. In the IIS Manager I’ll click the &lt;em&gt;Server Certificates&lt;/em&gt; applet, as shown below.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;When I browse this site secured with this certificate, there’ll be an error message in the browser informing me that this cert isn’t supposed to be used by the domain name from where it’s being served. Since &lt;em&gt;you’ll&lt;/em&gt; be using a &lt;em&gt;real &lt;/em&gt;SSL certificate, you shouldn’t have to worry about that error when you go through this process (and I trust you’ll forgive a later screen shot where the error is visible).&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/4_2.png"&gt;&lt;img title="4" 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="4" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/4_thumb.png" width="644" height="414"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once that applet loads up in the manager, I’ll click the link in the actions pane labeled &lt;em&gt;Create Self-Signed Certificate&lt;/em&gt;.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/5_4.png"&gt;&lt;img title="5" 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="5" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/5_thumb_1.png" width="644" height="414"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll name my certificate &lt;em&gt;SSLForwarderTesting&lt;/em&gt;, and then it appears in the list of certificates I have installed on my local development machine. I select that certificate from the list and click the link in the Actions pane labeled &lt;em&gt;Export&lt;/em&gt; to save the cert somewhere as a file.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/6_2.png"&gt;&lt;img title="6" 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="6" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/6_thumb.png" width="644" height="414"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Then I find the location where I’ll save the file and provide it with a password (which I’ll need to remember for the next step).&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/7_2.png"&gt;&lt;img title="7" 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="7" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/The-SSL-on-Web-Sites-Workaround_79F0/7_thumb.png" width="376" height="297"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now that this [optional] step is complete I have a &lt;em&gt;*.PFX&lt;/em&gt; file I can use to install my certificate in the Cloud Service.&lt;/p&gt; &lt;h3&gt;Install the SSL Certificate into a Cloud Service&lt;/h3&gt; &lt;p&gt;To activate SSL on the Cloud Service I’ll need to install an SSL certificate into the service using the Windows Azure portal. Don’t panic, this is easier than it sounds. Promise. Five minutes, tops.&lt;/p&gt; &lt;p&gt;Back in my browser, on the Windows Azure portal page, I’ll click the Cloud Service that’ll be answering HTTP/S requests for my site. The service’s dashboard page will open up.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/8_4.png"&gt;&lt;img title="8" 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="8" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/8_thumb_1.png" width="644" height="396"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll click the &lt;em&gt;Certificates&lt;strong&gt; &lt;/strong&gt;&lt;/em&gt;tab in the navigation bar.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/9_2.png"&gt;&lt;img title="9" 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="9" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/9_thumb.png" width="644" height="195"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’m going to want to upload my certificate, so this next step should be self-explanatory.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/10_2.png"&gt;&lt;img title="10" 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="10" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/10_thumb.png" width="644" height="397"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The next dialog gives me a pretty hard-to-screw-up dialog. Unless I forgot that password.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;span style="color: #282828" color="#282828"&gt;(&lt;/span&gt;cue the sound of hands ruffling through hundreds of post-its)&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/11_4.png"&gt;&lt;img title="11" 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="11" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/11_thumb_1.png" width="644" height="398"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once the certificate is uploaded, I’ll click the new cert and copy the thumbprint to my clipboard, maybe paste it into Notepad just for the moment…&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/13_2.png"&gt;&lt;img title="13" 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="13" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/13_thumb.png" width="644" height="397"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;Configuring the Cloud Service’s SSL Certificate&lt;/h3&gt; &lt;p&gt;With the SSL cert installed and the thumbprint copied, I’ll open up the &lt;em&gt;ServiceConfiguration.cloud.cscfg&lt;/em&gt; file in Visual Studio 2012 and set the thumbprint’s configuration. I could also do this using the built-in Windows Azure tools in Visual Studio, but since I’ve got the thumbprint copied this is just as easy to do directly editing the files. Plus, the Web Sites team made it pretty obvious where to put the thumbprint, as you’ll see from the screen shot below.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/14_2.png"&gt;&lt;img title="14" 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="14" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/14_thumb.png" width="644" height="271"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;Configuring the URL Rewrite Rules in the Web Role&lt;/h3&gt; &lt;p&gt;Remember the architectural overview from earlier. The main thing this Cloud Service does is to answer HTTP/S requests and then reverse-proxy that traffic back to the Web Site I’m happily hosting in Windows Azure. Setting up this proxy configuration isn’t too bad, especially when I’ve got the code the team handed me. I just look for all the places in the Web.config file from the Web Role project that mentions &lt;em&gt;foo&lt;/em&gt;.com or &lt;em&gt;foo&lt;/em&gt;.azurewebsites.net or &lt;em&gt;foo…&lt;/em&gt;well, you get the idea.&lt;/p&gt; &lt;p&gt;Here’s the Web.config file from the Web Role project before I edit it to comply with the Web Site and Cloud Service I created to demonstrate this solution open in Visual Studio 2012. I’ve marked all the spots you’ll need to change in the screen shot.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/15_2.png"&gt;&lt;img title="15" 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="15" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/15_thumb.png" width="644" height="310"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Here’s the file after being edited. Again, I’ll indicate the places where I made changes.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/16_2.png"&gt;&lt;img title="16" 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="16" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/16_thumb.png" width="644" height="311"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now that the Cloud Service and the Web.config file of the Web Role project’s been configured to redirect traffic to another destination, the proxy is ready for deployment. The solution’s Cloud project is defaulted to run at 2 instances, so that’s something you’ll want to remember – you’ll be paying for 2 instances of the Cloud Service you’ll be using to forward HTTP/S traffic to your Web Site.&lt;/p&gt; &lt;h3&gt;&lt;/h3&gt; &lt;h3&gt;Publish the Cloud Service&lt;/h3&gt; &lt;p&gt;Within Visual Studio 2012, I right-click the Cloud project and select the &lt;em&gt;Publish&lt;/em&gt; context menu item.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/22_2.png"&gt;&lt;img title="22" 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="22" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/22_thumb.png" width="416" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;A dew dialogs will walk me through the process of publishing the SSLForwarder service into Windows Azure. It may take a few minutes to complete, but once it publishes the Cloud Service will be running in your subscription and ready to respond to HTTP/S requests.&lt;/p&gt; &lt;p&gt;To verify everything’s working, try hitting the Cloud Service URL – in my case &lt;em&gt;sslforwarder.cloudapp.net, &lt;/em&gt;to see if it’s answering requests or spewing errors about unreachable hosts, either of which wouldn’t be surprising – we’ve redirected the Cloud Service’s Web Role to a Web Site. That web site probably isn’t set up yet, so you could see some unpredictable results.&lt;/p&gt; &lt;p&gt;If you actually pre-configured your &lt;em&gt;SSLForwarder&lt;/em&gt; Cloud Service to direct traffic to a *.azurewebsites.net you’re already running you’re pretty much finished, and you’re probably running behind HTTPS without any problems right now. If not, and the idea of publishing Web Sites from Visual Studio is new to you, you’ll have a chance to use that technique here.&lt;/p&gt; &lt;h3&gt;Publish a Windows Azure Web Site&lt;/h3&gt; &lt;p&gt;I’ll go back into the Windows Azure portal and go specifically to the &lt;em&gt;SSLForwarder&lt;/em&gt; Web Site I created earlier on in the post.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/17_2.png"&gt;&lt;img title="17" 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="17" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/17_thumb.png" width="644" height="396"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once the site’s dashboard opens up, I’ll find the link labeled &lt;em&gt;download publishing profile&lt;/em&gt;. This file will be used by Visual Studio during publishing to make the process very simple.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/18_2.png"&gt;&lt;img title="18" 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="18" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/18_thumb.png" width="644" height="397"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h3&gt;Publishing and Browsing an SSL-encrypted Web Site&lt;/h3&gt; &lt;p&gt;Once the publish settings file has been downloaded, it’s easy to push the site to Web Sites using Visual Studio 2012 or WebMatrix. With the sample project provided I’ll open up the Web Application project I want to publish to Web Sites. Then, I’ll right-click the web site project and select the &lt;em&gt;Publish&lt;/em&gt; menu item.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/19_2.png"&gt;&lt;img title="19" 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="19" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/19_thumb.png" width="644" height="481"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Then, the publish process will make the remainder of the publishing experience pretty simple.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Remember to thank &lt;a href="https://twitter.com/sayedihashimi"&gt;Sayed Hashimi&lt;/a&gt; if you need him out and about, he loves to hear thoughts on publishing and uses suggestions to make the experience an improved one for you. He also has a stupendous team of people working with him to execute great publishing experiences, who love feedback.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;The publish process dialogs will walk you through the simple act of publishing your site up to Windows Azure. Once it completes (which usually takes 30-60 seconds for a larger site) the site will open up in a web browser.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/21_2.png"&gt;&lt;img title="21" 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="21" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/21_thumb.png" width="644" height="175"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Note the URL still shows HTTP, and it also shows the URL of the Windows Azure Web Site you created. You’ll need to manually enter in the URL for the Cloud Service you created.&lt;/p&gt; &lt;p&gt;For me, that’s &lt;a href="http://www.sslforwarder.com"&gt;www.sslforwarder.com&lt;/a&gt;. So long as the domain name you enter &lt;em&gt;resolves to &lt;/em&gt;Cloud Service you should be alright. You can also opt for the *.cloudapp.net approach too, as the domain name of the site you want to put out. Whatever your preference for solving this particular issue.&lt;/p&gt; &lt;p&gt;I’m going to go ahead and change the domain name &lt;em&gt;and &lt;/em&gt;the protocol, so our hit to the site being hosted in Web Sites will respond to it receiving an SSL-encrypted request, then load the site in the browser.&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Note – this is when you’ll need to forgive me for showing you something that causes a warning in the browser. It’s just that way since I used a self-signed cert in a Windows Azure service, so we should expect to see an error here. It’s right there in the browser’s address bar, where it says “Certificate Error.” If I’d used a real SSL cert, from a real authority, the error wouldn’t be there.&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/23_2.png"&gt;&lt;img title="23" 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="23" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-SSL-with-Windows-Azure-Web-Sites_13B78/23_thumb.png" width="644" height="156"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;&lt;/h2&gt; &lt;h2&gt;Summary&lt;/h2&gt; &lt;p&gt;So for many months I’ve heard users request SSL on Web Sites, saying &lt;em&gt;everything about it is awesome. &lt;/em&gt;Then they stare at me and wait about 3 seconds and usually follow it up with “&lt;em&gt;but you’ve gotta get me SSL man, I’m over here and I gotta have my SSL”&lt;/em&gt;. I understand their desire for us to support it, and luckily, the Web Sites team and our engineering organization is so willing to share their solutions publicly. This is a great solution, but it won’t work in every situation and isn’t as good as what the Web Sites teams have in plans for the future. The SSL Forwarder solution is a good stop-gap, a good temporary solution to a problem we’ve had a lot of requests about.&lt;/p&gt; &lt;p&gt;Hopefully this helps in your decision to give Windows Azure Web Sites a shot. If SSL has been your sole reason for not wanting to give it a try, now you have a great workaround in place that you can facilitate to get started right now.&lt;/p&gt;</description><pubDate>Thu, 28 Mar 2013 14:15:48 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/running-ssl-with-windows-azure-web-sites</guid></item><item><title>WebMatrix Templates in the App Gallery</title><link>http://www.bradygaster.com:80/webmatrix-templates-in-the-app-gallery</link><description>&lt;p&gt;If you’ve not yet used &lt;a href="http://www.microsoft.com/web/webmatrix/"&gt;WebMatrix&lt;/a&gt;, &lt;strike&gt;what are you waiting for?!?!?!?&lt;/strike&gt; you’re missing out on a great IDE that helps you get a web site up and running in very little time. Whether you’re coding your site in PHP, Node.js, or ASP.NET, WebMatrix has you covered with all sorts of great features. One of the awesome features of WebMatrix is the number of templates it has baked in. Starter templates for any of the languages it supports are available, as are a number of practical templates for things like stores, personal sites, and so on. As of the latest release of Windows Azure Web Sites, all the awesome WebMatrix templates are now also available in the Web Sites application gallery. Below, you’ll see a screen shot of the web application gallery, with the &lt;em&gt;Boilerplate&lt;/em&gt; template selected. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/image_2.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/image_thumb.png" width="591" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Each of the WebMatrix gallery projects is&amp;nbsp; now duplicated for you as a Web Site application gallery entry. So even if you’re not yet using WebMatrix, you’ll still have the ability to start your site using one of its handy templates. &lt;/p&gt; &lt;p&gt;Impossible, you say? &lt;/p&gt; &lt;p&gt;See below for a screenshot from within the WebMatrix templates dialog, and you’re sure to notice the similarities that exist between the Application Gallery entries and those previously only available from directly within WebMatrix. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/SNAGHTML42c4ada.png"&gt;&lt;img title="SNAGHTML42c4ada" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="SNAGHTML42c4ada" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/SNAGHTML42c4ada_thumb.png" width="609" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;As before, WebMatrix is fully supported as the easiest Windows Azure-based web development IDE. After you follow through with the creation of a site from the Application Gallery template list from within the Windows Azure portal, you can open the site live directly within WebMatrix. From directly within the portal’s dashboard of a new Boilerplate site, I can click the WebMatrix icon and the site will be opened up in the IDE. &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/image_4.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/image_thumb_1.png" width="644" height="359"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now that it’s open, if I make any changes to the site, they’ll be uploaded right back into Windows Azure Web Sites, live for consumption by my site’s visitors. Below, you’ll see the site opened up in WebMatrix. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/image_6.png"&gt;&lt;img title="image" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/WebMatrix-Templates-in-the-App-Gallery_AACA/image_thumb_2.png" width="644" height="469"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If you’ve not already signed up, go ahead and &lt;a href="http://bit.ly/windowsazuretrial"&gt;sign up for a free trial of Windows Azure&lt;/a&gt;, and you’ll get 10 free sites (per region) to use for as long as you want. Grab yourself a free copy of &lt;a href="http://www.microsoft.com/web/webmatrix/"&gt;WebMatrix&lt;/a&gt;, and you’ll have everything you need to build – and publish – your site directly into the cloud. &lt;/p&gt;</description><pubDate>Tue, 19 Mar 2013 19:55:20 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/webmatrix-templates-in-the-app-gallery</guid></item><item><title>Web Camps Dallas</title><link>http://www.bradygaster.com:80/web-camps-dallas</link><description>&lt;p&gt;I wanted to let you know about an event I’ll be speaking at in early April. Along with my good friend and mentor &lt;a href="https://twitter.com/coolcsh" target="_blank"&gt;Scott Hunter&lt;/a&gt;, “el master’o’ASP.NET,” I'll be presenting at the Web Camps in Dallas, Texas. I’d love to &lt;a href="https://msevents.microsoft.com/cui/EventDetail.aspx?culture=en-US&amp;amp;EventID=1032545560&amp;amp;IO=06yEqLapadXeFGsLZgvN8A%3d%3d" target="_blank"&gt;see you there&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.devcamps.ms/web"&gt;&lt;img title="web-camps" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="web-camps" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Web-Camps-Dallas_6E5B/web-camps_3.png" width="1188" height="150"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Dallas isn’t the only stop for the &lt;a href="http://www.devcamps.ms/web" target="_blank"&gt;Web Camps tour&lt;/a&gt;. Our other good buddy, &lt;a href="http://weblogs.asp.net/jgalloway/" target="_blank"&gt;Jon Galloway&lt;/a&gt;, has worked hard creating this year’s Web Camps content, and has been out on the road promoting all the awesome new stuff we’ve released with the ASP.NET framework and tools. Along with Mr. Hunter, I’ll be presenting demonstrations and content related to all of the awesome topics below:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Keynote: The ASP.NET Web Platform in Context  &lt;li&gt;What’s new in ASP.NET 4.5 and Visual Studio 2012  &lt;li&gt;Building and deploying websites with ASP.NET MVC 4  &lt;li&gt;Creating HTML5 Applications with jQuery  &lt;li&gt;Building a service layer with ASP.NET Web API  &lt;li&gt;Leveraging your ASP.NET development skills to build apps for Office  &lt;li&gt;Building and leveraging social web apps in ASP.NET  &lt;li&gt;Building for the mobile web  &lt;li&gt;Real-time communications with SignalR  &lt;li&gt;Leveraging Windows Azure and Windows Azure Web Sites&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;So if you’re an ASP.NET developer, or you’ve been thinking about learning more about the new stuff available in the ASP.NET stack, &lt;a href="https://msevents.microsoft.com/cui/EventDetail.aspx?culture=en-US&amp;amp;EventID=1032545560&amp;amp;IO=06yEqLapadXeFGsLZgvN8A%3d%3d" target="_blank"&gt;come on out&lt;/a&gt; and join Scott Hunter and I on Friday, April 5 in Dallas, TX. We’ve got a whole series of these events lined up lots of other places, so check out the other areas where we’ll be heading and join us at one of those great events, too.&amp;nbsp; &lt;/p&gt; &lt;ul&gt; &lt;li&gt;March 20 - &lt;strong&gt;Oslo&lt;/strong&gt;, Norway - &lt;a href="http://blog.syntaxc4.net/"&gt;Cory Fowler&lt;/a&gt;  &lt;li&gt;March 22 – &lt;strong&gt;Lisbon&lt;/strong&gt;, Portugul - &lt;a href="http://blog.syntaxc4.net/"&gt;Cory Fowler&lt;/a&gt;  &lt;li&gt;March 25 – &lt;strong&gt;London&lt;/strong&gt;, UK - &lt;a href="http://blog.syntaxc4.net/"&gt;Cory Fowler&lt;/a&gt;, &lt;a href="http://blog.stevensanderson.com/"&gt;Steve Sanderson&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/b/stuartleeks/"&gt;Stuart Leeks&lt;/a&gt;  &lt;li&gt;March 27 – &lt;strong&gt;Cambridge&lt;/strong&gt;, MA - &lt;a href="http://blog.ntotten.com/"&gt;Nathan Totten&lt;/a&gt;  &lt;li&gt;April 3 – &lt;strong&gt;Copenhagen&lt;/strong&gt;, Denmark - &lt;a href="http://weblogs.asp.net/jgalloway"&gt;Jon Galloway&lt;/a&gt; and &lt;a href="http://madskristensen.net/"&gt;Mads Kristensen&lt;/a&gt;  &lt;li&gt;April 5 – &lt;strong&gt;Dallas&lt;/strong&gt;, TX with &lt;a href="http://www.bradygaster.com/"&gt;Brady Gaster&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/b/scothu/"&gt;Scott Hunter&lt;/a&gt;  &lt;li&gt;April 6 – &lt;strong&gt;Istanbul&lt;/strong&gt;, Turkey - &lt;a href="http://weblogs.asp.net/jgalloway"&gt;Jon Galloway&lt;/a&gt;, &lt;a href="http://www.tugberkugurlu.com/"&gt;Tugberk Ugurlu&lt;/a&gt; and &lt;a href="http://blogs.msdn.com/b/umits/"&gt;Umit Sunar&lt;/a&gt;  &lt;li&gt;April 12 – &lt;strong&gt;Bellevue&lt;/strong&gt;, WA - &lt;a href="http://blog.ntotten.com/"&gt;Nathan Totten&lt;/a&gt; and &lt;a href="http://blog.syntaxc4.net/"&gt;Cory Fowler&lt;/a&gt;  &lt;li&gt;April 19 – &lt;strong&gt;Sunnyvale&lt;/strong&gt;, CA - &lt;a href="http://blog.ntotten.com/"&gt;Nathan Totten&lt;/a&gt; and &lt;a href="http://weblogs.asp.net/jgalloway"&gt;Jon Galloway&lt;/a&gt;  &lt;li&gt;April 26 – &lt;strong&gt;San Diego&lt;/strong&gt;, CA - &lt;a href="http://weblogs.asp.net/jgalloway"&gt;Jon Galloway&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Jon, myself, and the rest of the team welcome you to this great series of events. We hope to see you there!&lt;/p&gt;</description><pubDate>Tue, 19 Mar 2013 14:58:56 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/web-camps-dallas</guid></item><item><title>Solving Real-world Problems with Windows Azure Web Sites</title><link>http://www.bradygaster.com:80/solving-real-world-problems-with-windows-azure-web-sites</link><description>&lt;p&gt;I&amp;rsquo;ve been asked a lot of great questions about Windows Azure Web Sites since the feature launched in June. Things like on-premise integration, connecting to service bus, and having multiple environments (like staging, production, etc), are all great questions that arise on a pretty regular cadence. With this post, I&amp;rsquo;m going to kick off a series on solving real-world problems for web site and PaaS owners that will try to address a lot of these questions and concerns. I&amp;rsquo;ve got a few blog posts in the hopper that will address some of these questions, rather than just cover how certain things are done. Those posts are great and all (and a lot of fun to write), but they don&amp;rsquo;t answer some real-world, practical questions I&amp;rsquo;ve been asked this year. Stay tuned to this area of my site, as I&amp;rsquo;ll be posting these articles over the next few weeks and probably into the new year. As I post each of these solutions I&amp;rsquo;ll update this post so you have a one-stop shop to go to when you need to solve one of these problems.&lt;/p&gt;
&lt;h2&gt;Posts in this Series&lt;/h2&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/multiple-environments-with-windows-azure-web-sites" target="_blank"&gt;Multiple Environments with Windows Azure Web Sites&lt;/a&gt;&lt;br /&gt;In this post I demonstrate how to have production and staging sites set up for your web site so that you can test your changes in a sandbox site before pushing your production site and potentially causing damage to it (and your reputation). If you&amp;rsquo;ve wondered how to gate your deployments using Windows Azure Web Sites, this is a good place to start. You&amp;rsquo;ll learn how to use Windows Azure Web Sites with a GitHub.com repository and some creative branching strategies to maintain multiple environments for a site.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/managing-multiple-windows-azure-web-site-environments-using-visual-studio-publishing-profiles" target="_blank"&gt;Managing Multiple Windows Azure Web Site Environments using Visual Studio Publishing Profiles&lt;/a&gt;&lt;br /&gt;This post takes the same sort of scenario as presented in the first article. Rather than use GitHub.com as a means to executing a series of gated environment deployments it focuses on the awesome features within Visual Studio for web publishing. Specifically, you&amp;rsquo;ll see how to use publishing profiles to deploy to multiple Windows Azure Web Sites, so that a team of peers responsible for releasing a site can do so without ever needing to leave Visual Studio.&lt;/p&gt;
&lt;p&gt;This post also takes a look at the idea of release management and how this solution answers the question of doing proper release management with a cloud-hosted web site. If you&amp;rsquo;ve wondered how your SDLC could fit in the idea of continuously maintaining a series of environments for gating your releases using Visual Studio&amp;rsquo;s super-simple publishing features, this is a great place to start.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/windowsazurewebsites-onprem-servicebus" target="_blank"&gt;Connecting Windows Azure Web Sites to On-Premises Databases Using Windows Azure Service Bus&lt;/a&gt;&lt;br /&gt;This post introduces the idea creating a hybrid cloud setup using a Windows Azure Web Site and the Windows Azure Service Bus, to demonstrate how a web site hosted in Windows Azure can connect to your on-premises enterprise database. If you&amp;rsquo;ve been wondering how to save data from your Windows Azure Web Site into your local database but didn&amp;rsquo;t know how to do it, or if you&amp;rsquo;re thinking of taking baby steps in your move toward cloud computing, this post could provide some good guidance on how to get started.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://magnusmartensson.com/continuous-delivery-windowsazure-nomirosoft-teamcity"&gt;Continuous Delivery to Windows Azure Web Sites using TeamCity&lt;/a&gt;&lt;br /&gt;My good friend Magnus put together a very extensive and informative blog post on using Windows Azure Web Sites with &lt;a href="http://www.jetbrains.com/teamcity/"&gt;TeamCity&lt;/a&gt;. If you're a CI user, or a TeamCity user, you'll want to check this out, as it is a great recipe for implementing your CI builds against Windows Azure Web Sites. Magnus worked really hard on this blog post and started working on it for his Windows AzureConf talk, and I'm proud to see how it came together for him.&lt;/p&gt;
&lt;p&gt;Jim O'Neil's Blog Series on Integrating Windows Azure Web Sites and Notifications&lt;br /&gt;Jim's blog series - &lt;a href="http://blogs.msdn.com/b/jimoneil/archive/2012/11/07/windows-8-notifications-push-notifications-via-windows-azure-web-sites-part-1.aspx"&gt;part 1&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/b/jimoneil/archive/2012/11/07/windows-8-notifications-push-notifications-via-windows-azure-web-sites-part-2.aspx"&gt;part 2&lt;/a&gt;, and &lt;a href="http://blogs.msdn.com/b/jimoneil/archive/2012/11/07/windows-8-notifications-push-notifications-via-windows-azure-web-sites-part-3.aspx"&gt;part 3&lt;/a&gt; - are great if you're looking into implementing instant messaging with your Windows Azure Web Site. This series is great, and I feel it shows off some amazing potential and adds a whole new dimension to what's possible on the platform. Take a look at these posts, they're quite inspiring.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://devhammer.net/blog/building-back-end-data-and-services-for-windows-8-apps-asp.net-web-api" target="_blank"&gt;G. Andrew Duthie&amp;rsquo;s Series on Back-end Data Services with Windows 8 Applications&lt;/a&gt;&lt;br /&gt;The &lt;a href="http://twitter.com/devhammer" target="_blank"&gt;@devhammer&lt;/a&gt; himself has created an awesome series on putting your data in the cloud, so your Windows 8 applications have a common place from which to pull the data. In this series, he discusses how to use Windows Azure Web Sites to create an API that can be called by a Windows 8 application. If you&amp;rsquo;re delving into Windows 8 development and have been wondering how you could use Web Sites to create the APIs you&amp;rsquo;ll be calling, this series is a must-read.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://blog.maartenballiauw.be/post/2012/12/07/Configuring-IIS-verbs-for-ASPNET-Web-API-on-Windows-Azure-Websites-and-elsewhere.aspx" target="_blank"&gt;Maarten Balliauw on Configuring IIS Methods for ASP.NET Web API with Windows Azure Web Sites&lt;/a&gt;&lt;br /&gt;My good friend and dedicated MVP Maarten just wrote up a great post on configuring IIS within Windows Azure Web Sites to support additional HTTP methods like HEAD and PATCH using configuration files. If you&amp;rsquo;re trying to do some deeper Web API functionality and have struggled with getting these types of HTTP methods supported, this could solve your problem.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://wouterdekort.blogspot.com/2012/11/branches-team-foundation-service-and.html" target="_blank"&gt;Branches, Team Foundation Services, and Windows Azure Web Sites&lt;/a&gt;&lt;br /&gt;Wouter de Kort covers how to achieve the multiple-environment approach using Team Foundation Services online. If you're using TFS and you want to set up multiple branches that deploy to a variety of web sites, this article will help you get going. This is a great introduction to using TFS for multiple branches with Windows Azure Web Sites.&amp;nbsp;&lt;/p&gt;</description><pubDate>Mon, 25 Feb 2013 19:01:00 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/solving-real-world-problems-with-windows-azure-web-sites</guid></item><item><title>nopCommerce and Windows Azure Web Sites</title><link>http://www.bradygaster.com:80/nopcommerce-and-windows-azure-web-sites</link><description>&lt;p&gt;This week we announced support for &lt;a href="http://www.nopcommerce.com" target="_blank"&gt;nopCommerce&lt;/a&gt; in the Windows Azure Web Sites application gallery. Using the Windows Azure portal and with requiring &lt;em&gt;zero&lt;/em&gt; lines of code, you can set up nopCommerce on Web Sites and get your online store up in minutes. You’ll have your very own products database, shopping cart, order history – the works. On the nopCommerce web site you can learn a lot more about the &lt;a href="http://www.nopcommerce.com/featurelist.aspx" target="_blank"&gt;features&lt;/a&gt; nopCommerce offers. In this blog post, I’ll show you how to get your own store up and running on Windows Azure Web Sites. &lt;/p&gt; &lt;p&gt;I walked through this process today. As with other entries in the Web Sites application gallery, you really do have to do very little digging to figure out where to go to get started. It’s pretty much “start, new site, from gallery,” as you’ll see from the picture below. It shows you exactly which menu item to click in the Windows Azure portal to get started. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/1_2.png"&gt;&lt;img title="1" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="1" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/1_thumb.png" width="644" height="280"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The next step should be pretty self-explanatory. Select &lt;em&gt;nopCommerce&lt;/em&gt; from the list of available applications. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/2_2.png"&gt;&lt;img title="2" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="2" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/2_thumb.png" width="644" height="444"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The next step will ask you for some database connection information. This is what will be set in your nopCommerce installation once the process is complete. I’m going to create a new database solely for use with my nopCommerce site I’m creating for this demonstration. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/3_2.png"&gt;&lt;img title="3" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="3" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/3_thumb.png" width="644" height="445"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The next screen is one that appears in a few other application gallery entries, too. It’s the “where do you want to store your data today?” screen. I’m creating a new SQL Server database in this screen so I need to provide the database name, specify a new server’s creation, and provide the database username and password. Don’t bother writing this down, there’s a&lt;strike&gt;n&lt;/strike&gt; &lt;strike&gt;app&lt;/strike&gt; screen for that later in this post. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/4_2.png"&gt;&lt;img title="4" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="4" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/4_thumb.png" width="644" height="445"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once I click OK here, my site is created. First, the portal tells me it’s creating the site:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/5_2.png"&gt;&lt;img title="5" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="5" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/5_thumb.png" width="644" height="188"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once the site is up and running, Windows Azure lets me know:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/6_2.png"&gt;&lt;img title="6" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="6" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/6_thumb.png" width="644" height="180"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If I select my nopCommerce site and click the “Browse” button in the Windows Azure portal, the site will open up in a new browser instance and allow me the capability of specifying the database connection string it’ll use. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/7_2.png"&gt;&lt;img title="7" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="7" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/7_thumb.png" width="452" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now, I’ll go back to the Windows Azure portal’s dashboard for my nopCommerce demo site. In that dashboard page I’ll click the link labeled “View connection strings,” and a dialog will open. In that dialog I’ll see the connection string for my database. I can copy that from the dialog…&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/8_2.png"&gt;&lt;img title="8" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="8" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/8_thumb.png" width="644" height="445"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;… and paste it into the nopCommerce setup window.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/9_2.png"&gt;&lt;img title="9" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="9" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/9_thumb.png" width="441" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Of course, I’ve blocked out my site’s &lt;em&gt;real&lt;/em&gt; connection string in this picture, but the idea is – &lt;em&gt;it doesn’t get much easier. &lt;/em&gt;Once I click the “Install” button in the nopCommerce setup page, the site and database schema, as well as some sample data points, will be installed automatically and the site configured to access the database. Once the setup process is complete, I’ll be redirected to my very own store site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/10_2.png"&gt;&lt;img title="10" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="10" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/10_thumb.png" width="644" height="465"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In the navigation bar I’ll click on the “My Account” link, login, and then, at the &lt;em&gt;very tip-top&lt;/em&gt; of my browser I’ll see a link to get to the Administration panel of my new nopCommerce store site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/12_4.png"&gt;&lt;img title="12" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="12" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/12_thumb_1.png" width="644" height="118"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The administration portal for the nopCommerce product promises to give me just about everything I’d need to sell some stuff, know how my sales are doing, and so on. I can pretty much do whatever I need to do using their rich, extensive administration functionality. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/13_2.png"&gt;&lt;img title="13" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="13" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/nopCommerce-in-the_12341/13_thumb.png" width="644" height="324"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If you’ve been thinking of setting up a store, with a shopping cart, online, or you’ve been asked to do so and are more interested in getting it up and running quickly than you are with re-inventing the wheel by writing custom code, check out nopCommerce. Get your free Windows Azure &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;trial&lt;/a&gt; – &lt;a href="http://www.windowsazure.com/en-us/develop/net/aspnet/?WT.mc_id=A5A71FF5F" target="_blank"&gt;which comes with 10 free web sites for free&lt;/a&gt; – right &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;here&lt;/a&gt;, then set up your own nopCommerce site and have your products selling in your store. &lt;/p&gt;</description><pubDate>Wed, 06 Feb 2013 05:11:43 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/nopcommerce-and-windows-azure-web-sites</guid></item><item><title>Kicking off Web Camps India</title><link>http://www.bradygaster.com:80/kicking-off-web-camps-india</link><description>&lt;p&gt;Next week I’ll be speaking at the &lt;a href="http://www.devcamps.ms/web" target="_blank"&gt;Web Camps&lt;/a&gt; events in India. The web camps series, put together by my trusty teammate &lt;a href="https://twitter.com/jongalloway" target="_blank"&gt;Jon Galloway&lt;/a&gt;, offers web developers a glimpse into all the new web-related stuff the ASP.NET and Visual Studio teams have been cooking. I’m looking forward to the trip, as I’ve never been further East than Sweden. My team has this habit of coming up with nifty out-of-office emails so I decided to make a map, originally thinking I’d jam the map into an email. The image ending up being pretty huge so I’m sparing the team the extra room in their mailboxes by sharing it here instead. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/5175b4ef6379_14DEB/india-trip_4.png" target="_blank"&gt;&lt;img title="india-trip" 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="india-trip" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/5175b4ef6379_14DEB/india-trip_thumb_1.png" width="1044" height="526"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This should be a pretty neat trip. I’m thankful for the opportunities I get like this to talk about and demonstrate the awesome work the engineers do here. They make that part of the job easy. When you love a product as much as I’ve loved ASP.NET and Visual Studio for this long, the idea of showing folks how to use it and to give them some new tricks is &lt;strong&gt;cake.&lt;/strong&gt; This sort of thing – talking about how awesome our products are and about the &lt;em&gt;awesomer&lt;/em&gt; people involved in their creation – is the best part of my job.&amp;nbsp; &lt;/p&gt; &lt;p&gt;What makes that part of job difficult is the missing-of-family while I’m on the road. My wife is the most supportive woman you could have the luck to know and I’m the luckiest guy in the world for having her there to support &lt;em&gt;me&lt;/em&gt;. My sons always miss me, so that’s the saddest part of every trip, but they know how it works so they’re usually pretty forgiving, as the code below demonstrates. Coming home to this familiar program is without a doubt the &lt;strong&gt;icing on the cake. &lt;/strong&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/5175b4ef6379_14DEB/image_2.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/5175b4ef6379_14DEB/image_thumb.png" width="639" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;So tomorrow I’ll start my first trip to the other side of the globe. Wish me luck, and if you’re in the area, come on out to learn some great stuff about ASP.NET, Windows Azure and Visual Studio!&lt;/p&gt;</description><pubDate>Thu, 24 Jan 2013 08:34:10 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/kicking-off-web-camps-india</guid></item><item><title>Connecting Windows Azure Web Sites to On-Premises Databases Using Windows Azure Service Bus</title><link>http://www.bradygaster.com:80/windowsazurewebsites-onprem-servicebus</link><description>&lt;p&gt;The third post in the &lt;a href="http://www.bradygaster.com/solving-real-world-problems-with-windows-azure-web-sites" target="_blank"&gt;Solving Real-world Problems with Windows Azure Web Sites blog series&lt;/a&gt; I&amp;rsquo;ll demonstrate one manner in which a web site can be connected to an on-premises enterprise. A common use-case for a web site is to collect data for storage in a database in an enterprise environment. Likewise, the first thing most customers want to move into the cloud is their web site. Ironically, the idea of moving a whole enterprise architecture into the cloud can appear to be a daunting task. So, if one wants to host their site in the cloud but keep their data in their enterprise, what&amp;rsquo;s the solution? This post will address that question and point out how the Windows Azure Service Bus between a Windows Azure Web Site and an on-premises database can be a great glue between your web site and your enterprise.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;We have this application that&amp;rsquo;d be great as a cloud-based web application, but we&amp;rsquo;re not ready to move the database into the cloud. We have a few other applications that talk to the database into which our web application will need to save data, but we&amp;rsquo;re not ready to move everything yet. Is there any way we could get the site running in Windows Azure Web Sites but have it save data back to our enterprise? Or do we have to move everything or nothing works?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I get this question quite frequently when showing off Windows Azure Web Sites. People know the depth of what&amp;rsquo;s possible with Windows Azure,&amp;nbsp; but they don&amp;rsquo;t want to have to know everything there is to know about Windows Azure just to have a web site online. More importantly, most of these folks have learned that Windows Azure Web Sites makes it dirt simple to get their ASP.NET, PHP, Node.js, or Python web site hosted into Windows Azure. Windows Azure Web Sites provides a great starting point for most web applications, but the block on adoption comes when the first few options are laid out, similar to these:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;It is costing us increased money and time to manage our web sites so we&amp;rsquo;re considering moving them into Windows Azure Web Sites&lt;/li&gt;
&lt;li&gt;It will it cost us a lot of money to move our database into the cloud&lt;/li&gt;
&lt;li&gt;We don&amp;rsquo;t have the money to rework all the applications that use that database if moving it to the cloud means those applications have to change.&lt;/li&gt;
&lt;li&gt;We can&amp;rsquo;t lose any data, and the enterprise data must be as secure as it already was, at the very least.&lt;/li&gt;
&lt;li&gt;Our web sites need to scale and we can&amp;rsquo;t get them what we need unless we go to Windows Azure Web Sites.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is a common plight and question whenever I attend conferences. So, I chose to take one of these conversations as a starting point. I invented a customer situation, but one that emulates the above problem statement and prioritizations associated with the project we have on the table.&lt;/p&gt;
&lt;h2&gt;Solving the Problem using Windows Azure Service Bus&lt;/h2&gt;
&lt;p&gt;The first thing I needed to think about when I was brought this problem would be the sample scenario. I needed to come up with something realistic, a problem I had seen customers already experiencing. Here&amp;rsquo;s a high-level diagram of the idea in place. There&amp;rsquo;s not much to it, really, just a few simple steps.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/on-prem-data-flow_2.png"&gt;&lt;img width="640" height="315" title="on-prem-data-flow" style="display: inline;" alt="on-prem-data-flow" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/on-prem-data-flow_thumb.png" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In this diagram I point out how my web site will send data over to the Service Bus. Below the service bus layer is a Console EXE application that subscribes to the Service Bus Topic the web application will be publishing into the enterprise for persistence. That console EXE will then use Entity Framework to persist the incoming objects &amp;ndash; Customer class instances, in fact &amp;ndash; into a SQL Server database.&lt;/p&gt;
&lt;p&gt;The subscription internal process is also exploded in this diagram. The Console EXE waits for any instance of a &lt;em&gt;customer&lt;/em&gt; being thrown in, and it wakes up any process that&amp;rsquo;s supposed to handle the incoming instance of that object.&lt;/p&gt;
&lt;p&gt;The Console EXE that runs allows the program to subscribe to the Service Bus Topic. When customers land on the topics from other applications, the app wakes up and knows what to do to process those customers. In this first case, the handler component basically persists the data to a SQL Server installation on their enterprise.&lt;/p&gt;
&lt;h2&gt;Code Summary and Walk-through&lt;/h2&gt;
&lt;p&gt;This example code consists of three projects, and is &lt;a href="https://github.com/bradygaster/WebSitesAndOnPremWithServiceBus" target="_blank"&gt;all available for your perusal as a GitHub.com repository&lt;/a&gt;. The first of these projects is a simple MVC web site, the second is console application. The final project is a core project that gives these two projects a common language via a domain object and a few helper classes. Realistically, the solution could be divided into 4 projects; the core project could be divided into 2 projects, one being the service bus utilities and the other being the on-premises data access code. For the purposes of this demonstration, though, the common core project approach was good enough. The diagram below shows how these projects are organized and how they depend on one another.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/on-prem-project-structure_2.png"&gt;&lt;img width="411" height="484" title="on-prem-project-structure" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="on-prem-project-structure" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/on-prem-project-structure_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The overall idea is simple -&amp;nbsp; build a web site that collects customer information in a form hosted in a Windows Azure Web Site, then ship that data off to the on-premises database via the Windows Azure Service Bus for storage. The first thing I created was a domain object to represent the customers the site will need to save. This domain object serves as a contract between both sides of the application, and will be used by an Entity Framework context class structure in the on-premises environment to save data to a SQL Server database.&lt;/p&gt;
&lt;script type="text/javascript" src="https://gist.github.com/4109405.js?file=Customer.cs"&gt;&lt;/script&gt;
&lt;p&gt;With the domain language represented by the &lt;em&gt;Customer&lt;/em&gt; class I&amp;rsquo;ll need some Entity Framework classes running in my enterprise to save customer instances to the SQL database. The classes that perform this functionality are below. They&amp;rsquo;re not too rich in terms of functionality or business logic implementation, they&amp;rsquo;re just in the application&amp;rsquo;s architecture to perform CRUD operations via Entity Framework, given a particular domain object (the &lt;em&gt;Customer&lt;/em&gt; class, in this case).&lt;/p&gt;
&lt;script type="text/javascript" src="https://gist.github.com/4109405.js?file=DataAccessClasses.cs"&gt;&lt;/script&gt;
&lt;p&gt;This next class is sort of the most complicated spot in the application if you&amp;rsquo;ve never done much with the Windows Azure Service Bus. The good thing is, if you don&amp;rsquo;t &lt;em&gt;want &lt;/em&gt;to learn how to do a lot with the internals of Service Bus, this class could be reused in your own application code to provide a quick-and-dirty first step towards using Service Bus.&lt;/p&gt;
&lt;p&gt;The &lt;em&gt;ServiceBusHelper&lt;/em&gt; class below basically provides a utilitarian method of allowing for both the publishing and subscribing features of Service Bus. I&amp;rsquo;ll use this class on the web site side to publish Customer instances into the Service Bus, and I&amp;rsquo;ll also use it in my enterprise application code to subscribe to and read messages from the Service Bus whenever they come in. The code in this utility class is &lt;em&gt;far from perfect&lt;/em&gt;, but it should give me a good starting point for publishing and subscribing to the Service Bus to connect the dots.&lt;/p&gt;
&lt;script type="text/javascript" src="https://gist.github.com/4109405.js?file=ServiceBusHelper.cs"&gt;&lt;/script&gt;
&lt;p&gt;Now that the Service Bus helper is there to deal with both ends of the conversation I can tie the two ends together pretty easily. The web site&amp;rsquo;s code won&amp;rsquo;t be too complicated. I&amp;rsquo;ll create a view that site users can use to input their customer data. Obviously, this is a short form for demonstration purposes, but it could be any shape or size you want (within reason, of course, but you&amp;rsquo;ve got ample room if you&amp;rsquo;re just working with serialized objects).&lt;/p&gt;
&lt;script type="text/javascript" src="https://gist.github.com/4109405.js?file=Index.cshtml"&gt;&lt;/script&gt;
&lt;p&gt;If I&amp;rsquo;ve got an MVC view, chances are I&amp;rsquo;ll need an MVC action method to drive that view. The code for the &lt;em&gt;HomeController&lt;/em&gt; class is below. Note, the &lt;em&gt;Index&lt;/em&gt; action is repeated &amp;ndash; one to display the form to the user, the second to handle the form&amp;rsquo;s posting. The data is collected via the second &lt;em&gt;Index&lt;/em&gt; action method, and then passed into the Service Bus.&lt;/p&gt;
&lt;script type="text/javascript" src="https://gist.github.com/4109405.js?file=HomeController.cs"&gt;&lt;/script&gt;
&lt;p&gt;The final piece of code to get this all working is to write the console application that runs in my enterprise environment. The code below is all that&amp;rsquo;s needed to do this; when the application starts up it subscribes to the Service Bus topic and starts listening for incoming objects. Whenever they come in, the code then makes use of the Entity Framework classes to persist the &lt;em&gt;Customer &lt;/em&gt;instance to the SQL Server database.&lt;/p&gt;
&lt;script type="text/javascript" src="https://gist.github.com/4109405.js?file=Program.cs"&gt;&lt;/script&gt;
&lt;p&gt;Now that the code&amp;rsquo;s all written, I&amp;rsquo;ll walk you through the process of creating your Service Bus topic using the Windows Azure portal. A few configuration changes will need to be made to the web site and the on-premise console application, too, but the hard part is definitely over.&lt;/p&gt;
&lt;h2&gt;Create the Service Bus Topic&lt;/h2&gt;
&lt;p&gt;Creating a Service Bus topic using the Windows Azure portal is relatively painless. The first step is to use the &lt;strong&gt;New&lt;/strong&gt; menu in the portal to create the actual Service Bus topic. The screen shot below, from the portal, demonstrates the single step I need to take to create my own namespace in the Windows Azure Service Bus.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/creating-service-bus-topic_2.png"&gt;&lt;img width="644" height="429" title="creating-service-bus-topic" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="creating-service-bus-topic" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/creating-service-bus-topic_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Once I click the &lt;strong&gt;Create a New Topic&lt;/strong&gt; button, the Windows Azure portal will run off and create my very own area within the Service Bus. The process won&amp;rsquo;t take long, but while the Service Bus namespace is being created, the portal will make sure I know it hasn&amp;rsquo;t forgotten about me.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/service-%20bus-getting-created_2.png"&gt;&lt;img width="644" height="429" title="service- bus-getting-created" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="service- bus-getting-created" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/service-%20bus-getting-created_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;After a few seconds, the namespace will be visible in the Windows Azure portal. If I select the new namespace and click the button at the bottom of the portal labeled &lt;strong&gt;Access Key&lt;/strong&gt;, a dialog will open that shows me the connection string I&amp;rsquo;ll need to use to connect to the Service Bus.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_2.png"&gt;&lt;img width="644" height="428" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;ll copy that connection string out of the dialog. Then, I&amp;rsquo;ll paste that connection string into the appropriate place in the &lt;em&gt;Web.config&lt;/em&gt; file of the web application. The screen shot below shows the &lt;em&gt;Web.config &lt;/em&gt;file from the project, with the appropriate &lt;em&gt;appSettings&lt;/em&gt; node highlighted.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_4.png"&gt;&lt;img width="644" height="319" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb_1.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;A similar node also needs to be configured in the console application&amp;rsquo;s &lt;em&gt;App.config &lt;/em&gt;file, as shown below.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_6.png"&gt;&lt;img width="644" height="269" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb_2.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In all, there are only two &lt;em&gt;*.config&lt;/em&gt; files that need to be edited in the solution to get this working &amp;ndash; the console application&amp;rsquo;s &lt;em&gt;App.config&lt;/em&gt; file and the web application&amp;rsquo;s &lt;em&gt;Web.config&lt;/em&gt; file. Both of these files are highlighted in the solution explorer view of the solution included with this blog post.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_8.png"&gt;&lt;img width="326" height="484" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb_3.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;With the applications configured properly and the service bus namespace created, I can now run the application to see how things work.&lt;/p&gt;
&lt;h2&gt;Running the Code&lt;/h2&gt;
&lt;p&gt;Since I&amp;rsquo;ll be using Entity Framework to scaffold the SQL Server database on the fly, all I&amp;rsquo;ll need to do to set up my local enterprise environment is to create a new database. The screen shot below shows my new SQL database before running the console application on my machine. Note, there are no tables or objects in the database yet.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_12.png"&gt;&lt;img width="381" height="411" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb_5.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The first thing I&amp;rsquo;ll do to get running is to debug the console application in Visual Studio. I could just hit F5, but I&amp;rsquo;ll be running the web application in debug mode next. The idea here is to go ahead and fire up the console application so that it can create the database objects and prepare my enterprise for incoming messages.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_14.png"&gt;&lt;img width="644" height="449" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb_6.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The&amp;nbsp; console application will open up, but will display no messages until it begins processing Customer objects that land on the Service Bus. To send it some messages, I&amp;rsquo;ll now debug the web application, while leaving the console application running locally.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_16.png"&gt;&lt;img width="588" height="484" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb_7.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;When the web site fires up and opens in my web browser, I&amp;rsquo;ll be presented the simple form used to collect customer data. If I fill out that form and click the &lt;strong&gt;Save&lt;/strong&gt; button, the data will be sent into the Service Bus.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_18.png"&gt;&lt;img width="644" height="393" title="image" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/image_thumb_8.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;By leaving the console application running as I submit the form, I can see the data coming into my enterprise environment.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/SNAGHTMLcceb1f2.png"&gt;&lt;img width="644" height="346" title="SNAGHTMLcceb1f2" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="SNAGHTMLcceb1f2" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/SNAGHTMLcceb1f2_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Going back into SQL Server Management Studio and refreshing the list of tables I can see that the Entity Framework migrations ran&amp;nbsp; perfectly, and created the table into which the data will be saved. If I select the data out of that table using a SQL query, I can verify that indeed, the data was persisted into my on-premises database.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/SNAGHTMLcd1045e.png"&gt;&lt;img width="644" height="325" title="SNAGHTMLcd1045e" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border: 0px;" alt="SNAGHTMLcd1045e" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Connecting-Windows-Azure-Web-Sites-to-On_13D7D/SNAGHTMLcd1045e_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;At this point, I&amp;rsquo;ve successfully pushed data from my Windows Azure Web Site up into the Service Bus, and then back down again into my local enterprise database.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;One of the big questions I&amp;rsquo;ve gotten from the community since the introduction of Windows Azure Web Sites to the Windows Azure platform is on how to connect these sites to an enterprise environment. Many customers aren&amp;rsquo;t ready to move their whole enterprise into Windows Azure, but they want to take some steps towards getting their applications into the cloud. This sort of &lt;em&gt;hybrid cloud&lt;/em&gt; setup is one that&amp;rsquo;s perfect for Service Bus. As you&amp;rsquo;ve seen in this demonstration, the process of connecting a Windows Azure Web Site to your on-premises enterprise isn&amp;rsquo;t difficult, and it allows you the option of moving individual pieces as you&amp;rsquo;re ready. Getting started is easy, cheap, and will allow for infinite scaling opportunities. Find out how easy Windows Azure can be for Web Sites, mobile applications, or hybrid situations such as this by getting a &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;free trial account today&lt;/a&gt;. I&amp;rsquo;m sure you&amp;rsquo;ll see that pretty much anything&amp;rsquo;s possible with Windows Azure.&lt;/p&gt;</description><pubDate>Mon, 26 Nov 2012 17:06:00 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/windowsazurewebsites-onprem-servicebus</guid></item><item><title>Managing Multiple Windows Azure Web Site Environments using Visual Studio Publishing Profiles</title><link>http://www.bradygaster.com:80/managing-multiple-windows-azure-web-site-environments-using-visual-studio-publishing-profiles</link><description>&lt;p&gt;This is the second post in the &lt;a href="http://www.bradygaster.com/solving-real-world-problems-with-windows-azure-web-sites" target="_blank"&gt;Real World Problems with Windows Azure Web Sites&lt;/a&gt;. The first post summarized how one can &lt;a href="http://www.bradygaster.com/multiple-environments-with-windows-azure-web-sites" target="_blank"&gt;manage multiple environments (development, staging, production, etc) using a Git repository with a branching strategy&lt;/a&gt;. Not everyone wants to use Git, and most would prefer to stay in their favorite IDE – Visual Studio 2012 – all day to do pretty much everything. My buddy &lt;a href="http://www.sedodream.com/" target="_blank"&gt;Sayed Hashimi&lt;/a&gt; told me about Visual Studio profiles a few weeks ago and I’d been wanting to write up something on how it could work with Windows Azure Web Sites. This post follows up on the idea of managing multiple Windows Azure Web Sites, but rather than do it with Git, I’ll show you how to manage multiple sites with only Visual Studio’s awesome publishing-with-profiles features. &lt;/p&gt; &lt;h2&gt;Set Up the Environments&lt;/h2&gt; &lt;p&gt;The first step in the process is to have your multiple sites set up so that you have environmental isolation. In this case, I’m being thorough and requiring there are two gates prior to production release. All three of these sites are in the free zone, for this demonstration. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/01-sites-provisioned_2.png"&gt;&lt;img title="01-sites-provisioned" 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="01-sites-provisioned" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/01-sites-provisioned_thumb.png" width="644" height="481"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If this was fully realistic, the production zone would probably be at &lt;em&gt;least&lt;/em&gt; shared or reserved, so that it had a domain name mapped to it. That’s the only site that would cost money, so the development and staging sites would have no impact on the cost I’ll incur for this setup. &lt;/p&gt; &lt;p&gt;Once the sites have been created I’ll go into each site’s dashboard to download the site’s publish settings profile. The publish settings files will be used from within Visual Studio to inform the IDE how to perform a web deploy up to my Windows Azure Web Site environment.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/02-download-publish-profile_2.png"&gt;&lt;img title="02-download-publish-profile" 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="02-download-publish-profile" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/02-download-publish-profile_thumb.png" width="644" height="481"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once I’ve downloaded each of these files I’ll have them all lined up in my downloads folder. I’ll be using these files in a moment once I’ve got some code written for my web site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbb9ed58.png"&gt;&lt;img title="SNAGHTMLbb9ed58" 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="SNAGHTMLbb9ed58" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbb9ed58_thumb.png" width="644" height="236"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now that I’ve got all my environments set up and have the publishing settings downloaded I can get down to business and write a little code. &lt;/p&gt; &lt;h2&gt;Setting up the Web Application Project&lt;/h2&gt; &lt;p&gt;I know I’ll have some environmental variances in the deployment details of this web application. I’ll want to use different databases for each environment, so I’ll need to have three different connection strings each site will have to be configured to use for data persistence. There’ll be application settings and &lt;em&gt;details&lt;/em&gt; and stuff, so the first thing I’ll do in this simple ASP.NET MVC project is to prepare the different publishing profiles and the respective configuration for those environments. &lt;/p&gt; &lt;p&gt;To do this, I’ll just right-click my web project and select the &lt;strong&gt;Publish&lt;/strong&gt; menu item. I’m not going to publish anything just yet, but this is the super-easiest way of getting to the appropriate dialog. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_2.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb.png" width="585" height="278"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When the publishing dialog opens, I’ll click the &lt;strong&gt;Import&lt;/strong&gt; button to grab the first environment’s publish settings files. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbc3d1f0.png"&gt;&lt;img title="SNAGHTMLbc3d1f0" 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="SNAGHTMLbc3d1f0" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbc3d1f0_thumb.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll grab the first publish settings file I find in my downloads folder, for the site’s development environment. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbc4eff3.png"&gt;&lt;img title="SNAGHTMLbc4eff3" 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="SNAGHTMLbc4eff3" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbc4eff3_thumb.png" width="644" height="354"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once I click &lt;strong&gt;Open&lt;/strong&gt;, the wizard will presume I’m done and advance to the next screen. I’ll click the &lt;strong&gt;Profile&lt;/strong&gt; link in the navigation bar at this point one more time, to go back to the first step in the wizard. &lt;font color="#282828"&gt;&lt;/font&gt;&lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;&lt;font color="#282828"&gt;If, at any point during this process you’re asked if you want to saved the profile, click &lt;strong&gt;yes&lt;/strong&gt;. &lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbc7a83d.png"&gt;&lt;img title="SNAGHTMLbc7a83d" 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="SNAGHTMLbc7a83d" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbc7a83d_thumb.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll repeat the import process for the staging and production files. The idea here is, to get all of the publish settings files imported as separate profiles for the same Visual Studio web application project. Once I’ve imported all those files I’ll click the &lt;strong&gt;Manage Profiles&lt;/strong&gt; button. The dialog below should open up, which will show me all of the profiles I’ve imported. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbcad50b.png"&gt;&lt;img title="SNAGHTMLbcad50b" 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="SNAGHTMLbcad50b" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbcad50b_thumb.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This part isn’t a requirement for you or a recommendation, but I don’t typically need the FTP profile so I’ll go through and delete all of the *FTP profiles that were imported. Again, not a requirement, just a preference, but once I’m done with it I’ll have all the web deploy profiles left in my dialog. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbcc102b.png"&gt;&lt;img title="SNAGHTMLbcc102b" 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="SNAGHTMLbcc102b" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLbcc102b_thumb.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll just click &lt;strong&gt;Close&lt;/strong&gt; now that I’ve got the profiles set up. Now that the profiles are setup they’ll be visible under the &lt;strong&gt;Properties/PublishProfiles&lt;/strong&gt; project node in Visual Studio. This folder is where the XML files containing publishing details are stored. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_4.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_1.png" width="457" height="349"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;With the profile setup complete, I’m going to go ahead and set up the configuration specifics for each environment. By right-clicking on each &lt;em&gt;*.pubxml&lt;/em&gt; file and selecting the &lt;strong&gt;Add Config Transform&lt;/strong&gt; menu item, a separate &lt;em&gt;*.config&lt;/em&gt; will be created in the project. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_6.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_2.png" width="644" height="444"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Each file represents the transformations I’ll want to do as I’m deploying the web site to the individual environment sites. Once I’ve added a configuration transformation for each profile, there’ll be a few nodes under the Web.config file I’ll have the opportunity of configuring specific details for each site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_8.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_3.png" width="644" height="344"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now that I’ve got the publish profiles and their respective configuration transformation files set up for each profile, I’ll write some code to make use of an application setting so I can check to make sure the per-profile deployment does what I think it’ll do. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Now, if you’re thinking to yourself this isn’t very practical, since I couldn’t allow my developers to have the ability of deploying to production and you’re compelled to blow off the rest of this post since you feel I’ve completely jumped the shark at this point, keep on reading. I bring it back down to Earth and even talk a little release-management process later on. &lt;/p&gt;&lt;/blockquote&gt; &lt;h2&gt;Environmental Configuration via Profiles&lt;/h2&gt; &lt;p&gt;Now I’ll go into the Web.config file and add an &lt;em&gt;appSetting&lt;/em&gt; to the file that will reflect the message I want users to see whenever they browse to the home page. This setting will be specific per environment, so I’ll use the transformation files in a moment to make sure each environment has its very own welcome message.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_12.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_5.png" width="644" height="412"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This is the message that would be displayed to a user if they were to hit the home page of the site. I need to add some code to my controller and view to display this message. It isn’t very exciting code, but I’ve posted it below for reference. &lt;/p&gt; &lt;p&gt;First, the controller code that reads from configuration and injects the message into the view. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_14.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_6.png" width="644" height="412"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Then I’ll add some code to the view to display the message in the browser. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_16.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_7.png" width="644" height="412"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When I browse the site I’ll get the obvious result, a simple hello message rendered from the configuration file on my local machine. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd3eb220.png"&gt;&lt;img title="SNAGHTMLd3eb220" 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="SNAGHTMLd3eb220" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd3eb220_thumb.png" width="644" height="193"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll go into the development configuration profile file and make a few changes – I strip out the comments and stuff I don’t need, and then I add the &lt;em&gt;message&lt;/em&gt; &lt;em&gt;appSetting&lt;/em&gt; variable to the file and set the transformation to perform a replace when the publish happens. This basically replaces everything in the &lt;em&gt;Web.config&lt;/em&gt; file with everything in the &lt;em&gt;Web.MySite-Dev - Web Deploy.config&lt;/em&gt; file that has a &lt;em&gt;xdt:Transform &lt;/em&gt;attribute set to &lt;em&gt;Replace&lt;/em&gt;. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_18.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_8.png" width="644" height="246"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I do the same thing for the staging profile’s configuration file…&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_20.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_9.png" width="644" height="246"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;… and then for the production profile’s configuration file. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_22.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/image_thumb_10.png" width="644" height="246"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;With the environmentally-specific configuration attributes set up in the profile transformations and the publish profiles set up, everything should work whenever I need to do a deployment to any of the environments. Speaking of which, let’s wrap this up with a few deployments to our new environments!&lt;/p&gt; &lt;h2&gt;Deployment&lt;/h2&gt; &lt;p&gt;The final step will be to deploy the code for the site into each environment to make sure the profile configuration is correct. This will be easy, since I’ve already imported all of my environments’ configuration files. I’ll deploy development first by right-clicking the project and again selecting the &lt;strong&gt;Publish&lt;/strong&gt; context menu item. When the publish wizard opens up I need to select the development environment’s profile from the menu. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd55a0ea.png"&gt;&lt;img title="SNAGHTMLd55a0ea" 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="SNAGHTMLd55a0ea" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd55a0ea_thumb.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once the publish process completes the site will open up in my browser and I can see that the appropriate message is being displayed, indicating the configuration transformation occurred properly based on the publish profile I’d selected to deploy. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd572671.png"&gt;&lt;img title="SNAGHTMLd572671" 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="SNAGHTMLd572671" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd572671_thumb.png" width="644" height="146"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Next, I right-click the project and select Publish again, this time selecting the staging environment. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd585116.png"&gt;&lt;img title="SNAGHTMLd585116" 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="SNAGHTMLd585116" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd585116_thumb.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When the publish completes, the staging welcome message is displayed. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd59b886.png"&gt;&lt;img title="SNAGHTMLd59b886" 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="SNAGHTMLd59b886" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd59b886_thumb.png" width="644" height="150"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If I repeat the same steps for production, the appropriate message is displayed there, too. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd5aeeb4.png"&gt;&lt;img title="SNAGHTMLd5aeeb4" 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="SNAGHTMLd5aeeb4" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/SNAGHTMLd5aeeb4_thumb.png" width="644" height="150"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In a few short steps, I’m able to set up a series of environments and publish profiles, that work together to allow me separate deployment environments, with little extra work or overhead. Since the profiles are linked to the configuration transformations explicitly, it all just works when I deploy the site. &lt;/p&gt; &lt;h2&gt;Release Management&lt;/h2&gt; &lt;p&gt;As promised earlier in that &lt;em&gt;blockquote&lt;/em&gt; up there, I want to stay with the “these are real world scenarios as much as possible based on my real-world experiences and questions I’ve been asked” mantra, I feel it’s necessary to get into the idea of release management insomuch as how it’d apply here. In the previous example I was using Git branches to gate releases. In this example, I’m not using any centralized build solution, but rather assuming there’s a source control environment in between the team members – developers, testers, release management, and so on – but that the whole team just chooses to use the Web Deploy awesomesauce built into Visual Studio. &lt;/p&gt; &lt;p&gt;Think of a company with aggressive timelines but who still take care to gate releases but choose not (for whatever reason) to set up a centralized build system. This company still feels strongly about managing the release process and about maintaining separate chains of testing and signoff responsibility as code is moved through the environments on the way to a production release, but they love using Visual Studio and Web Deploy to get things into the environments as quickly as possible.&amp;nbsp; &lt;/p&gt; &lt;p&gt;The diagram below demonstrates one potential release cycle that could make use of the publish profile method of gating deployments through a series of environmental gates.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/deployment-strategy_2.png"&gt;&lt;img title="deployment-strategy" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="deployment-strategy" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/6c5682ed66e5_BB3F/deployment-strategy_thumb.png" width="697" height="732"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Assume the team has come to a few conclusions and agreements on how their release cycle will execute. &lt;/p&gt; &lt;ul&gt; &lt;li&gt;All the team members are relatively technical and comfortable using Visual Studio with web application projects  &lt;li&gt;The team uses a source control method to share source code and to distribute it internally between team members &lt;li&gt;The web application project checked into source control has with it the publish profile for deploying the site into the development Windows Azure Web Site &lt;li&gt;Testers maintain copies of the staging publish profile setting, are regarded as the owners of the staging environment, and are the only team members who can deploy code to the staging Windows Azure Web Site &lt;li&gt;Release managers maintain copies of the production publish settings files, are regarded as the owners of the production releases, and are the only team members who can deploy code to the production environment &lt;li&gt;As developers, testers, and RM’s complete their respective testing phases in the environments they own and are ready to sign off, they escalate the deployment process to the next level &lt;li&gt;Following escalation, the first general step is to test the previous environment for verification purposes, then to deploy to the next environment and to begin testing of the deployment in that environment&lt;br&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;Luckily, this sort of situation is quite possible using publish profiles and free Windows Azure Web Sites used as environmental weigh stations on the way to be deployed to a production site that’s deployed to multiple large reserved instances (for instance). &lt;/p&gt; &lt;h2&gt;Summary&lt;/h2&gt; &lt;p&gt;The convenient partnership between web publishing and Windows Azure Web Sites shouldn’t be regarded as an indicator of it creating the potential for cowboy coding, but more considered a tool that when coupled with a responsible release cycle and effective deployment gating can streamline and simplify the entire SDLC when your business is web sites. &lt;/p&gt; &lt;p&gt;I hope this post has introduced you to a method of controlling your deployment environments, while also allowing you to do the whole thing from within Visual Studio. Later on, I’ll follow up this post with an example of doing this sort of thing using Team Foundation Services. &lt;/p&gt; &lt;p&gt;Hopefully, you have enough ammunition to &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;get started with your very own Windows Azure Web Site account today, for free&lt;/a&gt;, and you feel confident you’ll be able to follow your very own release management process, without the process or architecture slowing you down. If you have any questions about this approach or the idea in general, feel free to use the comments form below. &lt;/p&gt; &lt;p&gt;Happy coding!&lt;/p&gt;</description><pubDate>Fri, 23 Nov 2012 07:10:36 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/managing-multiple-windows-azure-web-site-environments-using-visual-studio-publishing-profiles</guid></item><item><title>Multiple Environments with Windows Azure Web Sites</title><link>http://www.bradygaster.com:80/multiple-environments-with-windows-azure-web-sites</link><description>&lt;p&gt;This is the first post in the &lt;a href="http://www.bradygaster.com/solving-real-world-problems-with-windows-azure-web-sites" target="_blank"&gt;Real World Problems with Windows Azure Web Sites blog series&lt;/a&gt;, as it intends to answer one of the most common questions I receive when I’m doing presentations about Windows Azure Web Sites. This situation demonstrates a typical setup, wherein a site owner has multiple environments to which they push their web site. This setup is extremely valuable for staging site releases and for delivering solid web applications or for doing A-B testing of a site’s changes. In order to make sure your changes are okay, it helps to have a staging and production environment to use to make sure things are good before one makes their changes live in a production environment. My good friend and colleague Cory Fowler &lt;a href="http://blog.syntaxc4.net/post/2012/11/17/continuous-deployment-in-windows-azure-web-sites.aspx" target="_blank"&gt;blogged about continuous deployment with Windows Azure Web Sites&lt;/a&gt;, and my other good buddy Magnus Martensson did a &lt;a href="http://channel9.msdn.com/Events/WindowsAzureConf/2012/A05" target="_blank"&gt;great presentation at Windows AzureConf on the topic&lt;/a&gt;. I’ve done countless demonstrations of continuous deployment with Web Sites, but one question always comes up, that this post intends to answer. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;That’s all well and good and I know I can deploy my site automatically each time I make a change, but that’s not realistic. It’s like, if I use Windows Azure Web Sites to host my site, it’ll be deployed each time I check in code – even when I didn’t want to deploy the site. How do I control what gets deployed and control the deployment and maintain quality?&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;That’s a great question, and it’s one that most have struggled to answer. It’s also a barrier for many who are thinking of using Windows Azure Web Sites but who don’t want to manage their site like they’re running their company out of a garage. This “happy path” deployment mantra isn’t real-world, especially for site owners who want to stage changes, test them out, and be certain their changes won’t cause any problems following a hasty deployment process. &lt;/p&gt; &lt;h2&gt;Multiple Sites for Multiple Environments&lt;/h2&gt; &lt;p&gt;As with any multiple-environment setup, the first thing I need to do to support having multiple environments is to create multiple sites in Windows Azure Web Sites. Using the portal, this is quite simple. The screen shot below shows you what this would look like. Note, I’ve got a “real” site, that’s my production site area, and I’ve also added a staging site to the account. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_2.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb.png" width="644" height="306"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In particular, take note of how both of these sites are in the “free” tier. Let’s say you’ve got a production site in the “non-free” zone because you want to map your domain name to it, scale it up or out, or whatever else. I’ll leave my staging site in the free tier and not incur any charges on it. &lt;/p&gt; &lt;p&gt;Why is this important? &lt;strong&gt;Because I won’t need to pay anything additional for having multiple sites&lt;/strong&gt;. Since most users won’t have the staging URL, or it won’t matter what it is since it’ll just be for testing purposes, I don’t need to map a domain name to it, scale it, or anything like that. It’s just &lt;em&gt;there&lt;/em&gt; for whenever I need to do a deployment for testing purposes or verification purposes. This setup won’t require you to spend any more money. &lt;/p&gt; &lt;h2&gt;Using GitHub.com for Continuous Deployment&lt;/h2&gt; &lt;p&gt;In this example, I’ll be using GitHub.com to manage my source code. You don’t have to use GitHub.com for this, so if you’re new to Git don’t freak out, you have other options like CodePlex, BitBucket, or TFS. Heck, you could even automate an FTP deployment if you want to.&lt;/p&gt; &lt;p&gt;The first step in setting up GitHub.com integration with a web site is to load up the site’s dashboard and to click the Quick Link labeled “Set up Git publishing” as is illustrated in the screen shot below.&lt;br&gt;&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_6.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_2.png" width="227" height="209"&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Once the repository setup completes, the portal will allow me to specify what type of Git repository I want to connect to my site. I’ll select GitHub.com from the list of options, as you’ll see below. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/associating-prod-with-git_4.png"&gt;&lt;img title="associating-prod-with-git" 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="associating-prod-with-git" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/associating-prod-with-git_thumb_1.png" width="585" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If this is the first time I’ve tried to connect a GitHub.com repository to a web site, I’ll be asked to allow the partnership to take place. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/authorize-azure-to-git_2.png"&gt;&lt;img title="authorize-azure-to-git" 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="authorize-azure-to-git" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/authorize-azure-to-git_thumb.png" width="478" height="342"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;By clicking the &lt;strong&gt;Allow&lt;/strong&gt; button, I let GitHub.com know I’m okay with the partnership. The final step in tying a repository to a site is to select the repository I want to be associated with the site, which you’ll see in the screen shot below. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_8.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_3.png" width="600" height="501"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll repeat this process for the staging site, too, and I’ll associate it with the exact same repository. This is important, as I’ll be pushing code to one repository and wanting the deployment to happen according to which site I want to publish. &lt;/p&gt; &lt;h2&gt;Two Sites, One Repository? Really?&lt;/h2&gt; &lt;p&gt;Sounds weird, right? I’ve got two sites set up now, one for the production site, the other for the staging site, but I’ve associated both sites with the same repository. Seems a little weird, as each time I push code to the repository, I’ll be deploying both sites automatically. The good part is, there’s this awesome feature in Git that I can use to make sure I’m deploying to the right spot. That feature is called &lt;strong&gt;branching&lt;/strong&gt;, and if you’re acquainted with any modern source control management product, you probably already know about branching. You probably already use branching to control deviations in your code base, or to fix features and bugs. With Windows Azure Web Sites’ support for branches, you can use them for environmentally-specific deployment practices too. The best part is, it’s quite easy to set up, and that’s just what I’ll show you next. &lt;/p&gt; &lt;h2&gt;Configuring Branch Associations&lt;/h2&gt; &lt;p&gt;Before I write any code, I’ll need to set up the branch “stuff” using the portal. To do this, I’ll go into my production site’s dashboard and click the &lt;strong&gt;Configure&lt;/strong&gt; link in the navigation bar. Scrolling down about half way, I can see that the production site’s set up to use the &lt;strong&gt;master&lt;/strong&gt; branch. The master branch is the default branch for any Windows Azure Web Site, but as you’ll see here, the portal gives me the ability to change the branch associated with an individual web site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_14.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_6.png" width="644" height="138"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now, I’ll go into my staging site and I’ll set the associated branch for that site to &lt;strong&gt;staging&lt;/strong&gt;. This means that, each time I check code into the master branch, it’ll be deployed to the production site, and each time I check code into the staging branch, it’ll be deployed to the staging site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_12.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_5.png" width="644" height="139"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;With the setup out of the way I’ll be able to write some code that’ll be deployed automatically when I need it to be deployed, and to the right place. &lt;/p&gt; &lt;h2&gt;Code, Commit, Deploy&lt;/h2&gt; &lt;p&gt;Now that my sites are all configured and pointing to the right branches I’ll need to set up local Git repository, write some code, and check that code into the repository. Once that’s all done I’ll create a second branch called &lt;strong&gt;staging&lt;/strong&gt; that I’ll use to push code to my staging site. &lt;/p&gt; &lt;p&gt;The first step is, obviously, to write some code. I won’t do much complicated stuff for this demo. Instead I’ll just make a simple MVC site with one view. In this view I’ll just put a simple message indicating the site to which I intend to deploy the code. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_16.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_7.png" width="662" height="338"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now, I’ll open up Powershell to do my Git &lt;em&gt;stuff.&lt;/em&gt; As &lt;a href="http://haacked.com/archive/2011/12/13/better-git-with-powershell.aspx" target="_blank"&gt;Phill Haack points out in this epic blog post on the topic&lt;/a&gt;, &lt;a href="https://github.com/dahlbyk/posh-git" target="_blank"&gt;posh-git&lt;/a&gt; is a great little tool if you’re a Powershell fan who also uses Git as a source control method. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML52be3f4.png"&gt;&lt;img title="SNAGHTML52be3f4" 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="SNAGHTML52be3f4" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML52be3f4_thumb.png" width="1001" height="209"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;I’ll initialize my Git repository using &lt;strong&gt;git init&lt;/strong&gt;, then I’ll tell the Git repository where to push the code whenever I do a commit using the &lt;strong&gt;git remote add origin [URL]&lt;/strong&gt; command. Finally, I’ll use the &lt;strong&gt;git add&lt;/strong&gt; and &lt;strong&gt;git commit&lt;/strong&gt; commands to push all of my changes into my local repository. All of the files in this changeset will scroll up the screen, and when the commit completes I’ll push the changes back up to GitHub.com, to the master branch, using the &lt;strong&gt;git push origin [branch]&lt;/strong&gt; command. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML5383630.png"&gt;&lt;img title="SNAGHTML5383630" 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="SNAGHTML5383630" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML5383630_thumb.png" width="1001" height="317"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once the commit finishes and the code is pushed up to GitHub.com, Windows Azure Web Sites will see the commit and perform a deployment. If you’re watching the portal when you do the commit you’ll see the deployment take place [almost magically]. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_18.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_8.png" width="644" height="316"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If I click the &lt;strong&gt;Browse &lt;/strong&gt;button at the bottom of the portal the site will open up in a browser and I can verify that the change I just committed was deployed. So far, so good. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/production-site-up-and-edited_2.png"&gt;&lt;img title="production-site-up-and-edited" 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="production-site-up-and-edited" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/production-site-up-and-edited_thumb.png" width="621" height="296"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Setting Up the Staging Branch&lt;/h2&gt; &lt;p&gt;Now that the production site’s been deployed I need to set up the staging environment. To do this, I’ll go back into my favorite Git client, Powershell, and I’ll create a new branch using the &lt;strong&gt;git checkout –b [branch]&lt;/strong&gt; command. This will create a new branch in my local Git repository. Then, it’ll switch to that repository and make it active. If I type &lt;strong&gt;git branch&lt;/strong&gt; in Powershell, it’ll show me all the branches in my local repository. The green line indicates the branch I’m currently working on. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML53f8690.png"&gt;&lt;img title="SNAGHTML53f8690" 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="SNAGHTML53f8690" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML53f8690_thumb.png" width="1001" height="317"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Now that the branch has been created, I’ll make some small change in the code of the site. Once this change has been made I’ll be pushing it up to GitHub.com again, but this time I’ll be pushing it into the newly-created staging branch, so the production branch code in the master branch is safe and sound. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_20.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_9.png" width="690" height="361"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Switching back to Powershell, I’ll commit the changes to the staging branch in my local repository. Then, I’ll push that code back up to GitHub.com, this time specifying the staging branch in my &lt;strong&gt;git push&lt;/strong&gt; command. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML545785b.png"&gt;&lt;img title="SNAGHTML545785b" 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="SNAGHTML545785b" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML545785b_thumb.png" width="1001" height="353"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This time, I’ll watch the staging site in the portal. As soon as the publish is complete, the portal will reflect that a deployment is taking place. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_22.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_10.png" width="644" height="258"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once the deployment completes, I can check the changes by clicking the &lt;strong&gt;Browse&lt;/strong&gt; button at the bottom of the portal page. When the staging site opens up, I can see that the changes were pushed to the site successfully. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/staging-site-up_2.png"&gt;&lt;img title="staging-site-up" 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="staging-site-up" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/staging-site-up_thumb.png" width="714" height="208"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If go back to the production site, it still says &lt;strong&gt;Production&lt;/strong&gt; on it. Pushing to the staging site didn’t affect my production site, and vice-versa. I’ve got dual-environment deployments, based on source code branches, and I’m able to test things out in one environment before pushing those changes to production. Everyone wins!&lt;/p&gt; &lt;h2&gt;Local Git Branch Niftiness&lt;/h2&gt; &lt;p&gt;One of the neat things about using Git branches (at least it was nifty to me), is that all the code for all the branches is stored in your local repository. Switching between branches automatically results in the source code being restored on your local drive. The whole thing happens automatically. Demonstrating how this works is as easy as switching branches while you have a source code file open in Visual Studio. &lt;/p&gt; &lt;p&gt;So let’s say I still have the staging branch set as my working branch and I’ve got the source code open up in Visual Studio. If I got to my Powershell client again and switch the branch using the &lt;strong&gt;git checkout [branch] &lt;/strong&gt;command, Git changes the branch on the fly for me. In so doing, all the files in the local directory are replaced with the files from the newly-selected branch. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML54d7c5b.png"&gt;&lt;img title="SNAGHTML54d7c5b" 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="SNAGHTML54d7c5b" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML54d7c5b_thumb.png" width="1001" height="353"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The moment I switch back to Visual Studio, it warns me that the file has changed on disk and asks me if I’d like to reload it. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML54e6e2d.png"&gt;&lt;img title="SNAGHTML54e6e2d" 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="SNAGHTML54e6e2d" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/SNAGHTML54e6e2d_thumb.png" width="580" height="202"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;If I click the &lt;strong&gt;Yes &lt;/strong&gt;button and then look at my file, I’ll see that the file has been changed to the one resident in the new branch. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_24.png"&gt;&lt;img title="image" 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="image" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/4e473fe17420_73EE/image_thumb_11.png" width="690" height="361"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In this way, Git keeps all the branches of my source code in my local repository, so I can make changes to the branches as needed and then commit those changes back to the local repository. Once I’m ready, I can push those files back up to the origin (in this case, GitHub.com), and everything’s cool.&lt;/p&gt; &lt;h2&gt;Summary&lt;/h2&gt; &lt;p&gt;Web site environments are a real-world method of controlling, gating, and reverting deployments. Using multiple environments, development shops can make sure their changes took place properly before crashing a production site with poor changes. Windows Azure Web Sites is a real-world web hosting platform that can be used to solve real web site challenges. With a little thought and planning, it’s easy to use Windows Azure Web Sites to host multiple versions of a web site. Testing can happen live, without affecting production deployments. I hope this post has introduced a good method of achieving separate site environments, and that you can see yet another way Windows Azure Web Sites can help you get your site up and running, keep it continually deployed, and reduce your concerns over the nature of continuously deploying to a production web site environment using simple tricks like Git branches. &lt;/p&gt;</description><pubDate>Wed, 21 Nov 2012 18:50:31 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/multiple-environments-with-windows-azure-web-sites</guid></item><item><title>AzureConf Reflections</title><link>http://www.bradygaster.com:80/azureconf-reflections</link><description>&lt;p&gt;I had a great opportunity last week to work with some Windows Azure community leaders in Redmond at Channel 9 studios to put on &lt;a href="http://channel9.msdn.com/Events/WindowsAzureConf/2012"&gt;Windows AzureConf&lt;/a&gt;. These community members travelled from all over the world to put on some great presentations. This post summarizes the event and thanks some folks for all their hard work. The event was a great day, and really gave me an opportunity to do my favorite thing in this role – work with the community to create awesome content for the community. &lt;/p&gt; &lt;h2&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/960cfcbd7383_141E3/clip_image001%5B5%5D.jpg"&gt;&lt;img title="clip_image001[5]" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="clip_image001[5]" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/960cfcbd7383_141E3/clip_image001%5B5%5D_thumb.jpg" width="644" height="460"&gt;&lt;/a&gt;&lt;/h2&gt; &lt;h2&gt;Thanks for the Inspiration&lt;/h2&gt; &lt;p&gt;My good friend and teammate &lt;a href="http://weblogs.asp.net/jgalloway/"&gt;Jon Galloway&lt;/a&gt; inspired a lot of us with what he made possible through &lt;a href="http://www.aspconf.net/"&gt;aspConf&lt;/a&gt;, so we followed he and his team’s been able to do with that event and drew inspiration from the idea during the planning of AzureConf.&amp;nbsp; We had a smaller-sized goal in mind for the first (and hopefully not last) AzureConf than what Jon was able to achieve with aspConf, especially this past year, which was a huge event featuring tons of sessions and presenters. &lt;/p&gt; &lt;p&gt;aspConf was, absolutely, the inspiration behind AzureConf, so when I brought the idea to Jon he had tons of great experience from which I learn, and as always, Jon was happy and eager to give me some advice. I’d like to thank him, Eric, and Javier, and all the other aspConf presenters and organizers for their hard work. Your output was an inspiration to me and the team of people who put on AzureConf, and we thank you for setting an amazing standard to work towards and for all the wisdom and advice you provided during AzureConf’s planning. &lt;/p&gt; &lt;h2&gt;Thanks for the Support&lt;/h2&gt; &lt;p&gt;&lt;a href="http://weblogs.asp.net/scottgu/"&gt;Scott Guthrie&lt;/a&gt;, &lt;a href="http://channel9.msdn.com/"&gt;Channel 9&lt;/a&gt;, and countless other people at Microsoft and in the community made AzureConf possible and successful. All along the way, various folks helped in so many ways. &lt;a href="https://twitter.com/markjbrown"&gt;Mark Brown&lt;/a&gt; gathered videos for filler breaks, &lt;a href="http://blog.syntaxc4.net/"&gt;Cory Fowler&lt;/a&gt; and &lt;a href="http://chrisrisner.com/"&gt;Chris Risner&lt;/a&gt; managed the question/answer features, &lt;a href="http://www.hanselman.com/blog/"&gt;Hanselman&lt;/a&gt; mentioned the event at //build/, &lt;a href="https://twitter.com/jamescon"&gt;James Conard&lt;/a&gt; believed I would be able to pull it off and had faith in me to do so, &lt;a href="http://scottcate.com/"&gt;Scott Cate&lt;/a&gt; helped with the facilitation, the community blogged and tweeted about the event to build steam... &lt;/p&gt; &lt;p&gt;The list goes on and on and on and I could never name anyone, but you get the point. The team of people who worked to put on AzureConf and make it a success were absolutely vital to it happening. No one who works for Microsoft or who does business with Microsoft is &lt;em&gt;unbusy,&lt;/em&gt; so I want to let everyone know who helped, how much I appreciate your doing so. Time is something none of us seem to have any more, but so many people stepped up in so many ways to make the event a success. &lt;/p&gt; &lt;p&gt;Whether you spoke, tweeted, forward a meeting invitation, or mentioned it in your own speaking engagements to help drum up support for the event, your contribution to the event is something that was absolutely vital &lt;strong&gt;to&lt;/strong&gt; the event, so thank you for your time and your help. &lt;/p&gt; &lt;h2&gt;Thanks for the Effort&lt;/h2&gt; &lt;p&gt;Giving our community members a stage to do what they do for a larger audience than normal was the driving force for me behind AzureConf. They work so, so, so hard volunteering to keep the Windows Azure brand’s growth continuing, and we wanted to give them one of those &lt;em&gt;bucket list moments&lt;/em&gt; with Windows AzureConf. Anyone who loves Microsoft’s development world probably loves or at least has some interest in what happens on Channel 9, so we figured the best way to thank someone for all the work they do evangelizing Windows Azure would be…&lt;/p&gt; &lt;p&gt;Give them free reign in Channel 9 for a day to evangelize about Windows Azure! Brilliant, right?&lt;/p&gt; &lt;p&gt;We thought so, and &lt;em&gt;brilliance&lt;/em&gt; is a good word for what all these guys did. You can see for yourself on the &lt;a href="http://channel9.msdn.com/Events/WindowsAzureConf/2012"&gt;Windows AzureConf Channel 9 event page&lt;/a&gt;, where we have all the content* posted for your on-demand viewing pleasure. &lt;/p&gt; &lt;p&gt;For now, I’d like to thank all the amazing speakers who took time out of their work schedules (many lost billable time, too), sacrificed time with their families, and travelled great distances for 1-2 hours in the studio to talk about one of the things they love using – Windows Azure. &lt;/p&gt; &lt;ul&gt; &lt;li&gt;&lt;a href="http://blog.elastacloud.com/"&gt;Andy Cross&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://ericdboyd.com/blog/"&gt;Eric Boyd&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://magnusmartensson.com/"&gt;Magnus Martensson&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://michaelcollier.wordpress.com/"&gt;Michael Collier&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.avaelgo.ro/"&gt;Mihai Tataran&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.kefalidis.me/"&gt;Panagiotis Kefalidis&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://rickgaribay.net/"&gt;Rick Garibay&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://www.selagroup.com/Office/Sasha_Goldshtein"&gt;Sasha Goldshtein&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="http://johnny.io/"&gt;Johnny Halife&lt;/a&gt;&lt;br&gt;&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;You guys totally rocked out all day, you were a joy to work with, and you made the event a success with your enthusiasm and willingness to deliver such awesome sessions. Thanks so, so much for all you put into your presentations, and for coming all the way to Redmond to deliver them in person. &lt;/p&gt; &lt;p&gt;&lt;em&gt;* Johnny’s talk was eaten by the hungry honey badgers that roam the Channel 9 studios hunting for prey. We’re going to have him back in the studio on his next trip to Redmond to re-record the session. When it’s done it’ll be posted on the event page. &lt;/em&gt;&lt;/p&gt; &lt;h2&gt;Thanks to the Community&lt;/h2&gt; &lt;p&gt;Finally, this post wouldn’t be complete without thanking you guys for watching, tweeting, and lifting us up. The event trended on Twitter for a little while, got some amazing feedback, and overall seemed to have a great, positive impact in the community. I’m so proud of you guys for helping us spread the word about the event. It made it all worthwhile, and sure does bring a smile to my face to have had such great support from the community. &lt;/p&gt;</description><pubDate>Wed, 21 Nov 2012 07:53:43 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/azureconf-reflections</guid></item><item><title>Introducing Windows AzureConf</title><link>http://www.bradygaster.com:80/introducing-windows-azureconf</link><description>&lt;p&gt;The best part of my job as a Technical Evangelist is working with the community members. Hands down, this is the best way for any evangelist to learn about their product and how it is being used in the wild. The Windows Azure community is a great one, with huge technical depth and experience, and it is my honor to be working on a great community event that highlights what real developers are doing with Windows Azure. I’d like to introduce you to Windows AzureConf, the first all-community Windows Azure event executed by the community at Channel 9 Studios.&lt;/p&gt; &lt;h2&gt;What is AzureConf?&lt;/h2&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Introducing-Windows-AzureConf_6F0F/MS1621_Banner_220x165_r05_2.jpg"&gt;&lt;img title="MS1621_Banner_220x165_r05" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; float: left; padding-top: 0px; padding-left: 0px; margin: 0px 5px 5px 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="MS1621_Banner_220x165_r05" align="left" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Introducing-Windows-AzureConf_6F0F/MS1621_Banner_220x165_r05_thumb.jpg" width="224" height="169"&gt;&lt;/a&gt;On November 14, 2012, Microsoft will be hosting &lt;a href="http://windowsazureconf.net"&gt;Windows AzureConf&lt;/a&gt;, a free event for the &lt;a href="http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=A8EF27E48"&gt;Windows Azure&lt;/a&gt; community. This event will feature a keynote presentation by &lt;a href="http://weblogs.asp.net/scottgu" target="_blank"&gt;Scott Guthrie&lt;/a&gt;, along with numerous sessions executed by Windows Azure community members. Streamed live for an online audience on &lt;a href="http://channel9.msdn.com"&gt;Channel 9&lt;/a&gt;, the event will allow you to see how developers just like you are using Windows Azure to develop applications on the best cloud platform in the industry. Community members from all over the world will join Scott in the Channel 9 studios to present their own ideas, innovations inventions and experiences. These presentations will provide you the opportunity to see how your peers in the community are doing great things using Windows Azure offerings like Mobile Services, Web Sites, Service Bus, virtual machines, and more. Whether you’re just learning &lt;a href="http://www.windowsazure.com/en-us/pricing/free-trial/?WT.mc_id=A8EF27E48"&gt;Windows Azure&lt;/a&gt; or you’ve already achieved success on the platform, you won’t want to miss this special event. For more information on Windows AzureConf or to register for the event, please visit &lt;a href="http://www.windowsazureconf.net"&gt;http://www.windowsazureconf.net&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;Some great &lt;a href="http://www.windowsazureconf.net/speakers" target="_blank"&gt;community members&lt;/a&gt; will be participating in the event, and they’ve got some mind-blowing &lt;a href="http://www.windowsazureconf.net/sessions" target="_blank"&gt;sessions&lt;/a&gt; lined up that demonstrate everything from attaching the &lt;a href="http://netduino.com" target="_blank"&gt;Netduino&lt;/a&gt; microcontroller to Windows Azure, to writing your very own Windows 8 application that uses Windows Azure as a data-storage layer or middle tier. Here’s a run-down of the speakers who will be presenting and the topics you’ll get to see at this event.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Build Speedy Azure Applications with HTML 5 and Web Sockets Today&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/rickggaribay" target="_blank"&gt;Rick Garibay&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In the world of HTML5 development, interoperability is king. Unfortunately, sometimes interoperability can be at the expense of performance. With support for bi-directional, full-duplex messaging simply out of the reach of the HTTP protocol, messaging support in HTML5 can be severely limited. Fortunately, standards groups including the W3C and IETF are hard at work on a standard specification called WebSockets which aims to bring these much needed capabilities to the masses.&lt;/p&gt; &lt;p&gt;Come learn how Microsoft is leading the innovation behind this exciting capability with an interactive presentation covering Microsoft’s implementation of the HTML5 WebSockets API and how you can provide the performance and functionality required to deliver great user experiences with HTML5, ASP.NET, WCF, Node.js and Windows Azure today.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Building Cross-Platform Media Apps using Windows Azure Media Services&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/EricDBoyd" target="_blank"&gt;Eric Boyd&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Applications with rich video and audio are increasing popular, but preparing and delivering this media to consumers has historically required lots of costly infrastructure and setup. Windows Azure Media Services enables you to outsource your media management to the cloud to let you focus on developing your applications instead of this costly infrastructure. In this session, Eric will walk through building a cross-platform HTML5 media application for the web, Windows 8 and other devices you may use day-to-day.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Building Elastic, Autoscalable Solutions with Windows Azure &lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/mihai_tataran" target="_blank"&gt;Mihai Tataran&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In this session you will learn how to implement true elasticity for your Windows Azure solutions. You will see how to automate the scaling of your Worker/Web Role instances depending on predictable usage patterns. Whether you expect high load during business hours and low load during the nights, or have different resource allocation needs, this session on using the Enterprise Library Integration Pack for Windows Azure's Autoscale Application Block will show you how your Windows Azure solutions can achieve higher levels of elasticity.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Continuous Delivery Zen with Windows Azure&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/noopman" target="_blank"&gt;Magnus Martensson&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Ever felt that you spend more time packing deployments, configuring test environments and deploying the latest build in order to please the testers than you spend writing actual code? Had your flow interrupted by the boss wanting a demo environment set up for a customer demo? Fortunately built into the Windows Azure Platform there is great support for Continuous Delivery of the greatness that you just built. With little work, you can set up automated builds, test runs and deployments so that you may focus on what’s important - your next delivery. If you want full control of your whole process you can use third-party continuous integration options with Windows VMs. Through Power Shell there is support for any scenario. For those who are really brave you can even set up push from your development box via Git to live production environments with no downtime! In this word of high demand for delivery and agility everything that can be automated must be automated. Automate, automate, automate!&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Elevating Windows Azure Deployments&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/michaelcollier" target="_blank"&gt;Michael Collier&lt;/a&gt;&lt;/p&gt; &lt;p&gt;One of the core tenet for working with cloud services is automation. When it comes to deploying our new cloud solutions, we want to automate the process as much as possible. Though Visual Studio and the Windows Azure online management portal make deployments pretty easy, they don't automate the deployment process. This session will demonstrate techniques like PowerShell, TFS, and more, for handling the automated updating of cloud services. Coming away from this session you'll have a solid understanding, backed by practical real-world examples, of handling service deployments and updates.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;How Mural.ly Achieves Great Performance for a Low Cost&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/johnnyhalife" target="_blank"&gt;Johnny Halife&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Come on and see how we are serving 80K request per hour per server on only two small instances. We'll share our secrets on how Mural.ly uses a canonical operation model that converts into MongoDB statements that it uses to keep the murals updated while sorting out concurrency issues. Throughout the sessions we'll show the different patterns that we've applied to achieve this and we'll share all our secrets on how to optimize for performance on the client/server interaction. By the end of the session you will understand how we built mural.ly from Client/Server/DB I/O interaction, and which tools and metrics, you can use to understand what's going on.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;JavaScript, Meet Cloud: Node.js on Windows Azure&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/goldshtn" target="_blank"&gt;Sasha Goldshtein&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Node.js is an incredibly popular open-source framework for writing event-based server applications in JavaScript. With hundreds of modules and vibrant ecosystem, Node.js is quickly catching up to other server-based frameworks, and makes it extremely easy to deploy Web applications. The June 2012 refresh introduces Node.js support on Windows Azure. In this talk we'll build a Node.js application from scratch and deploy it to Windows Azure in a matter of seconds. We'll use Node, express, nstore, SQL Azure, MongoDB, and might even see a glimpse of integration with Windows Azure Mobile Services.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Solving Security and Compliance Challenges with Hybrid Clouds&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/EricDBoyd" target="_blank"&gt;Eric Boyd&lt;/a&gt;&lt;/p&gt; &lt;p&gt;When considering public clouds, many industries and companies have concerns about security, intellectual property and regulatory compliance challenges. The good news is a hybrid cloud can often solve these challenges. In this session, Eric D. Boyd will teach you how to use Windows Azure and still protect sensitive information and achieve regulatory and compliance mandates, like PCI compliance, by combining on-premise data centers and private clouds with the Windows Azure public cloud. There are a number of ways to achieve this using messaging and networking technologies and during this presentation Eric will walk through the options and provide you with guidance on when to choose each.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Windows Azure + Twilio == A Happy Tale to Tell&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/pkefal" target="_blank"&gt;Panagiotis Kefalidis&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Taking advantage of Twilio’s awesomeness and Windows Azure’s scalability, we decided to build a phone and SMS center in the cloud. It was finished with some salt from ASP.NET MVC Web API and bonded with SignalR and knockout.js. The end result was tasty and I’m here to share the tale and the recipe of creating a highly scalable phone and SMS Solution using only but cloud services.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Windows Azure and Embedded Devices&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/andybareweb" target="_blank"&gt;Andy Cross&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This talk will demonstrate the Internet of Things with Windows Azure. Using embedded devices that interact with Windows Azure cloud technologies, the Internet of Things ideology is enabled with scalable and resilient cloud systems that imbue the resource constrained devices with elastic, on-demand additional computing power that allows any network connected device to achieve amazing computational feats. The talk features three main device/cloud interactions: persisting unbounded data from sensors, communicating through resilient channels and interacting directly with the Windows Azure cloud to provision and control cloud based infrastructure.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Windows Azure Mobile Services - Backend for Your Windows 8, iOS, and Android Apps&lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/goldshtn" target="_blank"&gt;Sasha Goldshtein&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Mobile app developers don't need to care about servers and clouds, push notification services and databases. Windows Azure Mobile Services is a cloud-based offering that provides a complete backend for mobile apps including data access and push notifications, enabling you to focus on the mobile app infrastructure and code and forget about the server management intricacies. In this talk we'll build a backend for a Windows 8 app, an iOS app, and an Android app -- all accessing the same data store and server-side triggers.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Windows Azure Services Throttling and Fault Handling &lt;/strong&gt;&lt;br&gt;&lt;a href="https://twitter.com/mihai_tataran" target="_blank"&gt;Mihai Tataran&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In this session you will understand how Windows Azure components being exposed as services from a multi-tenant environment can throttle or generate transient faults because of heavy loads on the resources in Microsoft’s datacenters, or because of networking problems. Then you will find out how to deal with those situations using Transient Fault Handling Application Block, part of Enterprise Library Integration Pack for Windows Azure.&lt;/p&gt; &lt;h2&gt;Real Windows Azure Solutions, by Real Windows Azure Users&lt;/h2&gt; &lt;p&gt;If you’re wondering how you can roll Windows Azure into your own enterprise, or if you’re a startup wondering how it can help you bootstrap your young business, &lt;a href="https://windowsazureconf.net" target="_blank"&gt;Windows AzureConf&lt;/a&gt; is for you. You’ll see how other community members are making use of Windows Azure to be more successful than ever, and how they’re solving real-world problems by using cloud computing. &lt;/p&gt;</description><pubDate>Thu, 01 Nov 2012 14:59:00 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/introducing-windows-azureconf</guid></item><item><title>Build a Location API Using Entity Framework Spatial and Web API, on Windows Azure Web Sites</title><link>http://www.bradygaster.com:80/ef-spatial-and-webapi</link><description>&lt;p&gt;As &lt;a href="http://weblogs.asp.net/scottgu/archive/2012/10/25/net-4-5-now-supported-with-windows-azure-web-sites.aspx" target="_blank"&gt;announced by Scott Guthrie recently&lt;/a&gt;, Windows Azure Web Sites now supports the .NET Framework 4.5. Some awesome ASP.NET features are now available to web developers who want to host their ASP.NET applications on Windows Azure following the web sites offering getting support for .NET 4.5. One feature I’m especially excited about is Entity Framework Spatial support. Only available in .NET 4.5, EF Spatial is something that gives developers who want to build location-aware applications the ability to easily save and retrieve location data without having to invent crazy solutions using SQL code. I’ve implemented the &lt;a href="http://en.wikipedia.org/wiki/Haversine_formula" target="_blank"&gt;Haversine formula&lt;/a&gt; using a SQL stored procedure in the past, and I can speak from experience when I say that EF Spatial is about 10,000 times easier and more logical. Don’t take my word for it, though. Take a look at the sample code I’ll show you in this blog post, which demonstrates how you can develop a location-aware API using ASP.NET Web API, EF Spatial, and host the whole thing on Windows Azure Web Sites. &lt;/p&gt; &lt;h2&gt;Creating the Site in Windows Azure&lt;/h2&gt; &lt;p&gt;Before diving into code I’ll go out to the Windows Azure portal and create a new web site. For this API example, I create a site with a database, as I’ll want to store the data in a Windows Azure SQL Database. The screen shot below shows the first step of creating a new site. By simply selecting the new web site option, then selecting “with database,” I’m going to be walked through the process of creating both assets in Windows Azure in a moment. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/1_2.png"&gt;&lt;img title="1" 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="1" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/1_thumb.png" width="644" height="401"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The first thing Windows Azure will need to know is the URL I’ll want associated with my site. The &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;free Windows Azure Web Sites offer&lt;/a&gt; defaults to &lt;strong&gt;[yoursitename].azurewebsites.net&lt;/strong&gt;, so this first step allows me to define the URL prefix associated with my site. &lt;/p&gt; &lt;p&gt;Simultaneously, this first step gives me the opportunity to define the name of the connection string I’ll expect to use in my Web.config file later, that will connect the site to the Windows Azure SQL Database I’ll create in a moment. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/2_2.png"&gt;&lt;img title="2" 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="2" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/2_thumb.png" width="644" height="426"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The last steps in the site creation process will collect the username and SQL Server information from you. In this example, I’m going to create a new database &lt;strong&gt;and &lt;/strong&gt;a new SQL Server in the Windows Azure cloud. However, you can select a pre-existing SQL Server if you’d prefer during your own setup process. &lt;/p&gt; &lt;p&gt;I specifically unchecked the “Configure Advanced Database Settings” checkbox, as there’s not much I’ll need to do to the database in the portal. As you’ll see in a moment, I’ll be doing all my database “stuff” using EF’s Migrations features. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/3_2.png"&gt;&lt;img title="3" 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="3" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/3_thumb.png" width="644" height="429"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once I’ve entered the username I’d like to use, the password, and selected (or created) a SQL server, I click the check button to create the site and the SQL database. In just a few seconds, both are created in Windows Azure, and I can get started with the fun stuff – the &lt;strong&gt;c0d3z&lt;/strong&gt;!&lt;/p&gt; &lt;h2&gt;&lt;/h2&gt; &lt;h2&gt;Preparing for Deployment&lt;/h2&gt; &lt;p&gt;Just so I have a method of deploying the site once I finish the code, I’ll select the new site from the Windows Azure portal by clicking on it’s name once the site-creation process completes. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/4_2.png"&gt;&lt;img title="4" 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="4" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/4_thumb.png" width="644" height="118"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;The site’s dashboard will open up in the browser. If I scroll down, the &lt;strong&gt;Quick Glance&lt;/strong&gt; links are visible on the right side of the dashboard page. Clicking the link labeled &lt;strong&gt;Download Publish Profile&lt;/strong&gt; will do just that – download a publish settings file, which contains some XML defining how &lt;a href="http://www.microsoft.com/visualstudio/" target="_blank"&gt;Visual Studio&lt;/a&gt; or &lt;a href="http://www.microsoft.com/web/webmatrix/" target="_blank"&gt;WebMatrix 2&lt;/a&gt; (or the Web Deploy command line) should upload the files to the server. Also contained within the publish settings file is the metadata specific to the database I created for this site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/5_2.png"&gt;&lt;img title="5" 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="5" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/5_thumb.png" width="295" height="287"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;As you’ll see in a moment when I start the deployment process, everything I need to know about deploying a site and a database backing that site is outlined in the publish settings file. When I perform the deployment from within Visual Studio 2012, I’ll be given the option of using Entity Framework Migrations to populate the database live in Windows Azure. Not only will the site files be published, &lt;strong&gt;the database will be created, too. &lt;/strong&gt;All of this is possible via the publish settings file’s metadata. &lt;/p&gt; &lt;h2&gt;Building the API in Visual Studio 2012&lt;/h2&gt; &lt;p&gt;The code for the location API will be relatively simple to build (thanks to the Entity Framework, ASP.NET, and Visual Studio teams). The first step is to create a new ASP.NET MVC project using Visual Studio 2012, as is shown below. If you’d rather just grab the code than walk through the coding process, I’ve created a &lt;a href="https://github.com/bradygaster/Web-API-using-EF-Spatial-and-WAWS" target="_blank"&gt;public GitHub.com repository for the Spatial Demo solution&lt;/a&gt;, so clone it from there if you’d rather view the completed source code rather than create it from scratch. &lt;/p&gt; &lt;p&gt;Note that I’m selecting the &lt;strong&gt;.NET Framework 4.5&lt;/strong&gt; in this dialog. Previous to the 4.5 support in Windows Azure Web Sites, this would always need to be set at 4.0 or my deployment would fail. As well, I would have had compilation issues for anything relating to Entity Framework Spatial, as those libraries and namespaces are also only available under .NET 4.5. Now, I can select the 4.5 Framework, satisfy everyone, and keep on trucking. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/new-project_2.png"&gt;&lt;img title="new-project" 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="new-project" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/new-project_thumb.png" width="644" height="394"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;In the second step of the new MVC project process I’ll select &lt;strong&gt;Web API&lt;/strong&gt;, since my main focus in this application is to create a location-aware API that can be used by multiple clients. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/web-api-project_2.png"&gt;&lt;img title="web-api-project" 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="web-api-project" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/web-api-project_thumb.png" width="534" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;By default, the project template comes with a sample controller to demonstrate how to create Web API controllers, called &lt;strong&gt;ValuesController.cs. &lt;/strong&gt;Nothing against that file, but I’ll delete it right away, since I’ll be adding my own functionality to this project. &lt;/p&gt; &lt;h3&gt;Domain Entities&lt;/h3&gt; &lt;p&gt;The first classes I’ll add to this project will represent the entity domains pertinent to the project’s goals. The first of these model classes is the &lt;strong&gt;LocationEntity&lt;/strong&gt; class. This class will be used in my Entity Framework layer to represent individual records in the database that are associated with locations on a map. The LocationEntity class is quite simple, and is shown in the gist below. &lt;/p&gt; &lt;p&gt;&lt;script src="https://gist.github.com/3969576.js?file=LocationEntity.cs"&gt;&lt;/script&gt;&lt;/p&gt; &lt;p&gt;Some of the metadata associated with a &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.spatial.dbgeography.aspx" target="_blank"&gt;DbGeography&lt;/a&gt; object isn’t easily or predictably serialized, so to minimize variableness (okay, I’m a control freak when it comes to serialization) I’ve also created a class to represent a Location object on the wire. This class, the &lt;strong&gt;Location&lt;/strong&gt; class, is visible in the following gist. Take note, though, it’s not that much different from the typical LocationEntity class aside from one thing. I’m adding the explicit Latitude and Longitude properties to this class. &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.spatial.dbgeography.aspx" target="_blank"&gt;DbGeography&lt;/a&gt; instances offer a good deal more functionality, but I won’t need those in this particular API example. Since all I need is latitude and longitude in the API side, I’ll just work up some code in the API controller I’ll create later to convert the entity class to the API class. &lt;/p&gt; &lt;p&gt;&lt;script src="https://gist.github.com/3969576.js?file=Location.cs"&gt;&lt;/script&gt;&lt;/p&gt; &lt;p&gt;Essentially, I’ve created a data transfer object and a view model object. Nothing really new here aside from the Entity Framework Spatial additions of functionality from what I’ve done in previous API implementations which required the database entity be loosely coupled away from the class the API or GUI will use to display (or transmit) the data. &lt;/p&gt; &lt;h3&gt;Data Context, Configuring Migrations, and Database Seeding&lt;/h3&gt; &lt;p&gt;Now that the models are complete I need to work in the Entity Framework “plumbing” that gives the controller access to the database via EF’s magic. The first step in this process is to work up the Data Context class that provides the abstraction layer between the entity models and the database layer. The data context class, shown below, is quite simple, as I’ve really only got a single entity in this example implementation. &lt;/p&gt; &lt;p&gt;&lt;script src="https://gist.github.com/3969576.js?file=SpatialDemoContext.cs"&gt;&lt;/script&gt;&lt;/p&gt; &lt;p&gt;Take note of the constructor, which is overridden from the &lt;a href="http://msdn.microsoft.com/en-us/library/gg679467(v=vs.103).aspx" target="_blank"&gt;base’s constructor&lt;/a&gt;. This requires me to make a change in the web.config file created by the project template. By default, the web.config file is generated with a single connection string, the name of which is &lt;strong&gt;DefaultConnection&lt;/strong&gt;. I need to either create a secondary connection string with the right name, change the default one (which I’ve done in this example), or use Visual Studio’s MVC-generation tools to create an EF-infused controller, which will add a new connection string to the web.config automatically. Since I’m coding up this data context class manually, I just need to go into the Web.config and change the &lt;strong&gt;DefaultConnection&lt;/strong&gt; connection string’s name attribute to match the one I’ve added in this constructor override, &lt;strong&gt;SpatialDemoConnectionString&lt;/strong&gt;. Once that’s done, this EF data context class will use the connection string identified in the configuration file with that name. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;During deployment, this becomes a very &lt;strong&gt;nifty&lt;/strong&gt; facet of developing ASP.NET sites that are deployed to Windows Azure Web Sites using the Visual Studio 2012 publishing functionality. We’ll get to that in a moment, though…&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;EF has this awesome feature called Migrations that gives EF the ability of setting up and/or tearing down database schema objects, like tables and columns and all indexes (oh my!).&amp;nbsp; So the next step for me during this development cycle is to set up the EF Migrations for this project. &lt;a href="http://channel9.msdn.com/Shows/Web+Camps+TV/Rowan-Miller-Demonstrates-Entity-Framework-5-Using-ASPNET-MVC-4" target="_blank"&gt;Rowan Miller does a great job of describing how EF Migrations work in this Web Camps TV episode&lt;/a&gt;, and Robert Green’s &lt;a href="http://channel9.msdn.com/Shows/Visual-Studio-Toolbox" target="_blank"&gt;Visual Studio Toolbox&lt;/a&gt; show has a ton of &lt;a href="http://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Visual-Studio-Toolbox-Entity-Framework-Part-1" target="_blank"&gt;great&lt;/a&gt; &lt;a href="http://channel9.msdn.com/Shows/Visual-Studio-Toolbox/Visual-Studio-Toolbox-Entity-Framework-Part-2" target="_blank"&gt;content&lt;/a&gt; on EF, too, so check out those resources for more information on EF Migrations’ awesomeness. The general idea behind Migrations, though, is simple – it’s a way of allowing EF to scaffold database components up and down, so I won’t have to do those items using SQL code. &lt;/p&gt; &lt;p&gt;What’s even better than the fact the EF has Migrations is that I don’t need to memorize how to do it because the NuGet/PowerShell/Visual Studio gods have made that pretty easy for me.&amp;nbsp; To turn Migrations on for my project, which contains a class that derives from EF’s data context class (the one I just finished creating in the previous step), I simply need to type the command &lt;strong&gt;enable-migrations&lt;/strong&gt; into the NuGet package management console window. &lt;/p&gt; &lt;p&gt;Once I enable migrations, a new class will be added to my project. This class will be added to a new Migrations folder, and is usually called &lt;strong&gt;Configuration.cs&lt;/strong&gt;. Within that file is contained a constructor and a method I can implement however I want called – appropriately – &lt;strong&gt;Seed.&lt;/strong&gt; In this particular use-case, I enable automatic migrations and add some seed data to the database. &lt;/p&gt; &lt;p&gt;&lt;script src="https://gist.github.com/3969576.js?file=Configuration.cs"&gt;&lt;/script&gt;&lt;/p&gt; &lt;p&gt;Enabling automatic migrations basically assumes any changes I make will automatically be reflected in the database later on (again, this is super-nifty once we do the deployment, so stay tuned!). &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Quick background on what types of locations we’ll be saving… My wife and I moved from the Southeast US to the Pacific Northwest region recently. Much to our chagrin, there are far fewer places to pick up great chicken wings than there were in the Southeast. So, I decided I needed to use our every-Sunday-during-football snack of chicken wings as a good use-case for a location-based app. What a better example than to give you a list of good chicken wing restaurants listed in order of proximity? Anyway, that’s the inspiration for the demo. Dietary recommendation is not implied, BTW.&lt;/p&gt;&lt;/blockquote&gt; &lt;h2&gt;The API Controller Class&lt;/h2&gt; &lt;p&gt;With all the EF plumbing and domain models complete, the last step in the API layer is to create the API controller itself. I simply add a new Web API controller to the &lt;strong&gt;Controllers&lt;/strong&gt; folder, and change the code to make use of the plumbing work I’ve completed up to now. The dialog below shows the first step, when I create a new &lt;strong&gt;LocationController&lt;/strong&gt; Web API controller.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/8_2.png"&gt;&lt;img title="8" 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="8" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/8_thumb.png" width="644" height="474"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This controller has one method, that takes the latitude and longitude from a client. Those values are then used in conjunction with EF Spatial’s &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.spatial.dbgeography.distance.aspx" target="_blank"&gt;DbGeography.Distance&lt;/a&gt; method to sort the records from closest in proximity, then the first five records are returned. The result of this call is that the closest five locations are returned with a client provides its latitude and longitude coordinates to the API method. The &lt;a href="http://msdn.microsoft.com/en-us/library/system.data.spatial.dbgeography.distance.aspx" target="_blank"&gt;Distance method&lt;/a&gt; is used again to determine how far away each location is from the provided coordinates. The results are then returned using the API-specific class rather than the EF-specific class (thereby separating the two layers and easing some of the potential serialization issues that could arise), and the whole output is formatted to either XML or JSON and sent down the wire via HTTP. &lt;/p&gt; &lt;p&gt;&lt;script src="https://gist.github.com/3969576.js?file=LocationController.cs"&gt;&lt;/script&gt;&lt;/p&gt; &lt;p&gt;At this point, the API is complete and can be deployed to Windows Azure directly from within Visual Studio 2012 using the great publishing features created by the Visual Studio publishing team (my buddy &lt;a href="http://twitter.com/sayedihashimi" target="_blank"&gt;Sayed Hashimi&lt;/a&gt; loves to talk about this stuff, so ping him on Twitter if you have any questions or suggestions on this awesome feature-set). &lt;/p&gt; &lt;h3&gt;Calling the Location API using an HTML 5 Client&lt;/h3&gt; &lt;p&gt;In order to make this a more comprehensive sample, I’ve added some HTML 5 client code and &lt;a href="http://knockoutjs.com/" target="_blank"&gt;Knockout.js&lt;/a&gt;-infused JavaScript code to the Home/Index.cshtml view that gets created by default with the ASP.NET MVC project template. This code makes use of the HTML 5 geospatial capabilities to read the user’s current position. The latitude and longitude are then used to call directly the location API, and the results are rendered in the HTML client using a basic table layout. &lt;/p&gt; &lt;p&gt;&lt;script src="https://gist.github.com/3969576.js?file=index.cshtml"&gt;&lt;/script&gt;&lt;/p&gt; &lt;p&gt;The final step is to deploy the whole thing up to Windows Azure Web Sites. This is something I wasn’t able to do until last week, so I’m super-stoked to be able to do it now and to share it with you on a demo site, the URL of which I’ll hand out at the end of this post. &lt;/p&gt; &lt;h3&gt;One Last NuGet to Include&lt;/h3&gt; &lt;p&gt;Entity Framework Spatial has some new data types that add support for things like… well... latitude and longitude, in this particular case. By default, these types aren’t installed into a Windows Azure instance, as they’re part of the database SDK. Most times, those assemblies aren’t needed on a web server, so by default you won’t have them when you deploy. To work around this problem and to make Entity Framework Spatial work on the first try following your deployment to Windows Azure, install the &lt;a href="http://nuget.org/packages/microsoft.sqlserver.types" target="_blank"&gt;Microsoft.SqlServer.Types NuGet package&lt;/a&gt; into your project by typing &lt;strong&gt;install-package Microsoft.SqlServer.Types&lt;/strong&gt; in the Package Manager Console or by manually finding the package in the “Manage NuGet References” dialog. &lt;/p&gt; &lt;blockquote&gt; &lt;p&gt;Thanks to Scott Hunter for this extremely valuable piece of information, which I lacked the first time I tried to do this. This solution was so obvious I hid in my car with embarrassment after realizing how simple it was and that I even had to ask. NuGet, again, to the rescue!&lt;/p&gt;&lt;/blockquote&gt; &lt;p&gt;Once this package is installed, deploying the project to Windows Azure will trigger automatic retrieval of that package, and the support for the location data types in SQL Server will be added to your site. &lt;/p&gt; &lt;h2&gt;Publishing from Visual Studio 2012 is a Breeze&lt;/h2&gt; &lt;p&gt;You’ve probably seen a ton of demonstrations on how to do deployment from within Visual Studio 2012, but it never ceases to amaze me just how quick and easy the team has made it to deploy sites – with databases – directly up to Windows Azure in so few, simple steps. To deploy to a site from within Visual Studio 2012, I just right-click the site and select – get this – &lt;strong&gt;Publish. &lt;/strong&gt;The first dialog that opens gives me the option to import a publish settings file, which I downloaded earlier just after having created the site in the Windows Azure portal. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/publish-1_4.png"&gt;&lt;img title="publish-1" 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="publish-1" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/publish-1_thumb_1.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Once the file is imported, I’m shown the details so I have the chance to verify everything is correct, which I’ve never seen it &lt;em&gt;not be, &lt;/em&gt;quite frankly. I just click Next here to move on. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/publish-2_4.png"&gt;&lt;img title="publish-2" 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="publish-2" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/publish-2_thumb_1.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;This next step is where all the magic happens that I’ve been promising you’d see. This screen, specifically the last checkbox (highlighted for enthusiasm), points to the database I created earlier in the first step when I initially created the “site with database” in the Windows Azure portal. If I check that box, when I deploy the web site, &lt;em&gt;the database schema will be automatically created for me, and the seed data will be inserted and be there when the first request to the site is made&lt;/em&gt;. All that, just by publishing the site! &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/publish-3_2.png"&gt;&lt;img title="publish-3" 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="publish-3" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/ac6f2c93769a_B101/publish-3_thumb.png" width="621" height="484"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;Can you imagine anything more convenient? I mean seriously. I publish my site and the database is automatically created, seeded, and everything wired up for me using Entity Framework, with a minimal amount of code. Pretty much magic, right?&lt;/p&gt; &lt;h2&gt;Have at it!&lt;/h2&gt; &lt;p&gt;Now that the .NET 4.5 Framework is supported by Windows Azure Web Sites, you can make use of these and other new features, many of which are discussed or demonstrated on at &lt;a href="http://www.asp.net/vnext"&gt;www.asp.net’s page set aside just on the topic of ASP.NET 4.5 awesomeness&lt;/a&gt;. If you want to get started building your own location API’s built on top of Entity Framework Spatial, &lt;a href="http://bit.ly/windowsazuretrial"&gt;grab your very own Windows Azure account here&lt;/a&gt;, that offers all kinds of awesomeness for free. You can take the sample code for this blog, or copy the gists and tweak them however you want. &lt;/p&gt; &lt;p&gt;Happy Coding!&lt;/p&gt;</description><pubDate>Tue, 30 Oct 2012 05:32:29 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/ef-spatial-and-webapi</guid></item><item><title>Gallery Server Pro and Windows Azure Web Sites</title><link>http://www.bradygaster.com:80/gallery-server-pro-and-windows-azure-web-sites</link><description>&lt;p&gt;The Windows Azure Web Sites team has added another web application to the growing list of options available for pre-configured web sites and applications you can use to get your site up and running in minutes. Today&amp;rsquo;s addition is &lt;a href="http://www.galleryserverpro.com/" target="_blank"&gt;Gallery Server Pro&lt;/a&gt;, a web-based tool for managing your image or video library. This post will walk you through the process of getting Gallery Server Pro running in Windows Azure Web Sites, so if you have a huge collection of images you&amp;rsquo;d like to post online, you won&amp;rsquo;t want to miss this post.&lt;/p&gt;
&lt;h2&gt;The Gallery&lt;/h2&gt;
&lt;p&gt;Windows Azure Web Sites makes it easy to get started with a new web site, and you can&amp;rsquo;t beat the price and the ability to upgrade your horsepower whenever you need (or to downgrade whenever you don&amp;rsquo;t need it). The web application gallery in the Windows Azure portal adds the sugary sweet ability to get up and running with a completely-built and pre-configured application in seconds. In most cases you won&amp;rsquo;t even need to write a line of code. Think of all those hours of your life you&amp;rsquo;ve spent configuring a CMS or blogging tool to get it working on your server &amp;ndash; the gallery provides point-and-click creation and deployment of many of these types of tools.&lt;/p&gt;
&lt;p&gt;Below, for instance, you can see how easy it is for me to start building a brand new blog using Gallery Server Pro in Windows Azure. Just click the &lt;strong&gt;New&lt;/strong&gt; button at the bottom of the portal, then select the &lt;strong&gt;From Gallery&lt;/strong&gt; option, and select Gallery Server Pro from the list of applications available.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/BlogPost/galsrvpro-1.png" alt="" width="700" height="414" /&gt;&lt;/p&gt;
&lt;p&gt;Once you select Gallery Server Pro and click the &lt;strong&gt;Next &lt;/strong&gt;button, you&amp;rsquo;ll be asked to give the site a name and to provide the username and password for the administrative user.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/BlogPost/galsrvpro-2.png" alt="" width="700" height="414" /&gt;&lt;/p&gt;
&lt;p&gt;Once the application is selected, a new site will be provisioned using the Gallery Server Pro application code. Within a minute, the application is created and your new online gallery will be ready for images.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/BlogPost/galsrvpro-3.png" alt="" width="700" height="414" /&gt;&lt;/p&gt;
&lt;h2&gt;Using Gallery Server Pro&lt;/h2&gt;
&lt;p&gt;As far as web gallery applications are concerned, Gallery Server Pro is a breeze to use. The screen shot below shows the application running on Windows Azure Web Sites. The menu system makes the process of creating and editing galleries a snap. Below, you&amp;rsquo;ll see an empty gallery in the application&amp;rsquo;s administration console.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://www.bradygaster.com/Media/Default/BlogPost/galsrvpro-5.png" alt="" width="700" height="443" /&gt;&lt;/p&gt;
&lt;p&gt;In under 5 minutes, I was able to create a brand new online image gallery, into which I uploaded a few sample pictures. Note, I&amp;rsquo;d never used Gallery Server Pro prior to this, and it was super-simple to get up and running. I didn&amp;rsquo;t even need to read the help file for the application, the process was so lightweight and easy to use.&lt;/p&gt;
&lt;p&gt;&lt;img src="/Media/Default/BlogPost/galsrvpro-6.png" alt="" width="700" height="443" /&gt;&lt;/p&gt;
&lt;p&gt;Whether you're just posting pictures of your family or you&amp;rsquo;re an aspiring artist or designer who wants to publish their photos and artwork online for people to see, Gallery Server Pro is a great choice. Their web site offers &lt;a href="http://www.galleryserverpro.com/support.aspx" target="_blank"&gt;documentation and an extensive user guide and administration reference&lt;/a&gt;, and the product promises to continue adding new features and functionality. With Windows Azure Web Sites now as the easiest hosting option around for creating these types of sites and with deployment never being as easy as it is using the web sites application gallery, now is a good time to try out Gallery Server Pro for your online gallery needs.&lt;/p&gt;
&lt;h2&gt;Start Simple. Scale Up as Needed&lt;/h2&gt;
&lt;p&gt;If you haven&amp;rsquo;t &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;tried&lt;/a&gt; Windows Azure yet, you can &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;get started right now&lt;/a&gt;, for free, and stay free for a year if all you really need is a gallery site. In 5 minutes you&amp;rsquo;ll have your own online gallery up and running, without writing a single line of code or performing any complex configuration tasks. When you pair the ease of setup and deployment Windows Azure Web Sites and the application gallery provide with the simplicity Gallery Server Pro provide, you can&amp;rsquo;t go wrong.&lt;/p&gt;</description><pubDate>Mon, 15 Oct 2012 16:42:35 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/gallery-server-pro-and-windows-azure-web-sites</guid></item><item><title>BlogEngine.NET and Windows Azure Web Sites</title><link>http://www.bradygaster.com:80/blogengine.net-and-windows-azure-web-sites</link><description>&lt;p&gt;The Windows Azure Web Sites team has been hard at work looking at various applications and working with vendors and community contributors to add some great applications to the web sites gallery. If you&amp;rsquo;re a blogger and you&amp;rsquo;d like to get started for free with a simple, yet extensible blogging tool, you might want to check this out. Starting this week you can install &lt;a href="http://www.dotnetblogengine.net/" target="_blank"&gt;BlogEngine.NET&lt;/a&gt; into a free instance of a Windows Azure Web Site. I&amp;rsquo;ll walk you through the process in this post.&lt;/p&gt;
&lt;h2&gt;The Gallery&lt;/h2&gt;
&lt;p&gt;Windows Azure Web Sites makes it easy to get started with a new web site, and you can&amp;rsquo;t beat the price and the ability to upgrade your horsepower whenever you need (or to downgrade whenever you &lt;strong&gt;don&amp;rsquo;t&lt;/strong&gt; need it). The web application gallery in the Windows Azure portal adds the sugary sweet ability to get up and running with a &lt;strong&gt;completely-built and pre-configured application in seconds&lt;/strong&gt;. In most cases you won&amp;rsquo;t even need to write a line of code. Think of all those hours of your life you&amp;rsquo;ve spent configuring a CMS or blogging tool to get it working on your server &amp;ndash; the gallery provides point-and-click creation and deployment of many of these types of tools.&lt;/p&gt;
&lt;p&gt;Below, for instance, you can see how easy it is for me to start building a brand new blog using BlogEngine.NET in Windows Azure.&lt;/p&gt;
&lt;p&gt;&lt;a href="$be.net-1[7].png" target="_blank"&gt;&lt;img src="/Media/Default/BlogPost/be.net-1.png" alt="be.net-1" width="644" height="364" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Installing BlogEngine.NET&lt;/h2&gt;
&lt;p&gt;Once you select BlogEngine.NET and click the next arrow button, the gallery installer will need to get some pretty basic information from you and provision the site. The next step in the installation process gets your site&amp;rsquo;s name, which will serve as the prefix in the &lt;em&gt;[prefix].azurewebsites.net&lt;/em&gt; manner.&lt;/p&gt;
&lt;p&gt;&lt;a href="$be.net-2[7].png"&gt;&lt;img src="/Media/Default/BlogPost/be.net-2.png" alt="be.net-2" width="644" height="364" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Since BlogEngine.NET&amp;rsquo;s default storage mechanism doesn&amp;rsquo;t require a database (but you can, of course, customize your installation later to use SQL if you&amp;rsquo;d like), but that&amp;rsquo;s basically &lt;strong&gt;the last step in the process&lt;/strong&gt;. Two steps, and a brand new BlogEngine.NET blog will be created and deployed into Windows Azure Web Sites. Below you&amp;rsquo;ll see how the portal reflects the status of the deployment.&lt;/p&gt;
&lt;p&gt;&lt;a href="$be.net-3[3].png"&gt;&lt;img src="/Media/Default/BlogPost/be.net-3.png" alt="be.net-3" width="644" height="364" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;In a few moments, the site will be completely deployed, and by clicking on the browse button at the bottom of the portal when you&amp;rsquo;ve got your freshly-deployed blog selected&amp;hellip;&lt;/p&gt;
&lt;p&gt;&lt;a href="$be.net-4[3].png"&gt;&lt;img src="/Media/Default/BlogPost/be.net-4.png" alt="be.net-4" width="644" height="359" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;ll be impressed at how easy the process is when you&amp;rsquo;re running BlogEngine.NET on Windows Azure Web Sites. In seconds, your new blog will be ready, deployed, and willing to record your every contemplation.&lt;/p&gt;
&lt;p&gt;&lt;a href="$be.net-5[3].png"&gt;&lt;img src="/Media/Default/BlogPost/be.net-5.png" alt="be.net-5" width="644" height="363" /&gt;&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Using BlogEngine.NET&lt;/h2&gt;
&lt;p&gt;BlogEngine.NET is great, the administrative interface a breeze, and the whole experience painless when you install it this way. I&amp;rsquo;ve not used the product in a number of years. Though I don&amp;rsquo;t recall the installation and configuration process as a difficult one, it sure as heck wasn&amp;rsquo;t &lt;strong&gt;this&lt;/strong&gt;&lt;em&gt; &lt;/em&gt;easy the last time I installed it on a server.&lt;/p&gt;
&lt;p&gt;The first thing you&amp;rsquo;ll want to do is to log in as &lt;strong&gt;admin&lt;/strong&gt; (password by default is also &lt;strong&gt;admin&lt;/strong&gt;), &lt;a href="http://blogengine.codeplex.com/wikipage?title=Installation" target="_blank"&gt;according to the BlogEngine.NET installation documentation&lt;/a&gt;, and change your password. The administration dashboard is quite simple, and blogging using the product is a breeze.&lt;/p&gt;
&lt;p&gt;&lt;a href="$be.net-6[3].png"&gt;&lt;img src="/Media/Default/BlogPost/be.net-6.png" alt="be.net-6" width="644" height="349" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;As simple as BlogEngine.NET is on the surface, it has a great community and huge list of extensions and resources available. The extensions page in the BlogEngine.NET administration console should give you an idea of what&amp;rsquo;s available for your use if you&amp;rsquo;re into the idea of customizing the functionality.&lt;/p&gt;
&lt;p&gt;&lt;a href="$be.net--7[3].png"&gt;&lt;img src="/Media/Default/BlogPost/be.net--7.png" alt="be.net--7" width="644" height="349" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So in seconds &amp;ndash; it literally took me less than 1 minute on the first try &amp;ndash; you can have a brand new blog running in Windows Azure Web Sites, for free or for however much you need whenever you need it, that&amp;rsquo;s simple to use and extensible with a great plug-in model.&lt;/p&gt;
&lt;h2&gt;Start Simple. Go Big When You Need To&lt;/h2&gt;
&lt;p&gt;If you haven&amp;rsquo;t &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;tried&lt;/a&gt; Windows Azure yet, you can &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;get started right now&lt;/a&gt;, for free, and stay free for a year if all you really need is a &lt;a href="http://www.dotnetblogengine.net/" target="_blank"&gt;BlogEngine.NET&lt;/a&gt; site. In 5 minutes you&amp;rsquo;ll have your own site up and running, without writing a single line of code or performing &lt;strong&gt;any complex configuration tasks&lt;/strong&gt;. When you pair the ease of setup and deployment Windows Azure Web Sites and the application gallery provide with the blogging simplicity and elegance &lt;a href="http://www.dotnetblogengine.net/" target="_blank"&gt;BlogEngine.NET&lt;/a&gt; provide, you can&amp;rsquo;t go wrong.&lt;/p&gt;</description><pubDate>Fri, 12 Oct 2012 07:04:23 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/blogengine.net-and-windows-azure-web-sites</guid></item><item><title>Eurotrip 2012</title><link>http://www.bradygaster.com:80/eurotrip-2012</link><description>&lt;p&gt;Last week I had the pleasure of attending a few community events in Europe. The trip was fantastic, with some talks to be done in front of various groups throughout Belgium and Sweden. In this post I will summarize the event, provide some links to the slides I created, and thank all the great people who made the trip one of the more memorable. &lt;/p&gt; &lt;h2&gt;Belgium Nerd Dinner &amp;amp; User Group&lt;/h2&gt; &lt;p&gt;I flew from Seattle to Belgium Sunday/Monday, and arrived to find my new friend &lt;a href="https://twitter.com/pkefal" target="_blank"&gt;Panagiotis&lt;/a&gt; awaiting my arrival at the airport. Panos is not only an amazing Windows Azure developer with skills to make even the most hardened cloud developer whimper in terror, but he’s a certifiable race car driver. The &lt;a href="http://www.azug.be/" target="_blank"&gt;Belgium User Group&lt;/a&gt; is one of the most hospitable I’ve had the pleasure of knowing, and Panos is the welcoming party for their group. He picked me up, drove me to dinner, between meetings, and all the while talked Windows Azure. &lt;/p&gt; &lt;p&gt;Our first stop was dinner at a local brewery (yes, we &lt;em&gt;did &lt;/em&gt;eat dinner) known throughout the region and beyond for its well-cooked meals and of course, Belgian brews. We sipped a few, talked about the upcoming conferences, and of course, discussed various things we’re all doing or wanting to do using Windows Azure and ASP.NET. Some of my favorite Tweeple (forgive me) were in attendance at the dinner and the user group meeting Tuesday night. &lt;a href="https://twitter.com/TechMike2kX" target="_blank"&gt;Mike Martin&lt;/a&gt; and &lt;a href="https://twitter.com/KvdM" target="_blank"&gt;Kris van der Mast&lt;/a&gt;, who I need to thank for bringing me over and for putting on such a great event were there to support me at the event, as well as &lt;a href="https://twitter.com/kristofrennen" target="_blank"&gt;Kristof Rennen&lt;/a&gt;, &lt;a href="https://twitter.com/chton" target="_blank"&gt;Bram de Buyser&lt;/a&gt;, and &lt;a href="https://twitter.com/xavierdecoster" target="_blank"&gt;Xavier Decoster&lt;/a&gt;, who I found myself talking with about &lt;a href="http://www.myget.org/" target="_blank"&gt;MyGet&lt;/a&gt; throughout the remainder of the week. MyGet is an awesome service that extends the already-awesome NuGet service by adding in build functionality, private and subscription-based feeds, and all other sorts of good stuff. My chat with Xavier inspired me to really take a deeper look at MyGet throughout the week, and their level of support and commitment to helping me understand and implement as many of its features as possible is amazing.&lt;/p&gt; &lt;p&gt;The topic of the Belgium User Group on Tuesday night was a deep dive into Windows Azure Web Sites. I recounted some of the lessons &lt;a href="https://twitter.com/nirmsk" target="_blank"&gt;Nir Mashkowski&lt;/a&gt; has taught me from hosting him on &lt;a href="http://channel9.msdn.com/Shows/Web+Camps+TV" target="_blank"&gt;Web Camps TV&lt;/a&gt;, and answered quite a few questions about the Shared tier enhancements. The deck contained a few links to these shows and other resources, and as usual some of my own humor (or whatever you call it). If you’d like to peek at the deck, download it &lt;a href="http://bradystorage.blob.core.windows.net/decks/Web-Sites-Deep-Dive.pptx" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt; &lt;h2&gt;Sweden .NET User Group&lt;/h2&gt; &lt;p&gt;On Wednesday morning I flew from Belgium to Stockholm, Sweden, to give a developer-focused talk on Windows Azure Web Sites. Hosted at the gorgeous &lt;a href="http://www.connecta.se/" target="_blank"&gt;Connecta&lt;/a&gt; office in Stockholm, Sweden, the Sweden .NET User Group was full of programmers who are learning how to use Windows Azure Web Sites to solve their web development and hosting challenges. I was greeted by &lt;a href="https://twitter.com/Apeoholic" target="_blank"&gt;Jimmy Engstrom&lt;/a&gt;, who shares a hand in leading the group. Jimmy is delving into all sorts of interesting areas with embedded technology, so he and I found ourselves talking about &lt;a href="http://www.netduino.com/" target="_blank"&gt;Netduino&lt;/a&gt;, &lt;a href="http://www.netmf.com/gadgeteer/" target="_blank"&gt;.NET Gadgeteer&lt;/a&gt;, and shared stories of our inventions and ideas with one another. The other half of probably the most adorable geek-couples I’ve met, &lt;a href="https://twitter.com/grytlappen" target="_blank"&gt;Jessica Engstrom&lt;/a&gt;, was also in attendance at the event. Together they told a great story of sitting in front of their computers frantically trying to get tickets to this year’s &lt;a href="http://www.buildwindows.com/" target="_blank"&gt;Build&lt;/a&gt; conference. The Engstroms and myself, along with my new Finnish friends &lt;a href="https://twitter.com/fincooper" target="_blank"&gt;Karl Ots&lt;/a&gt; and &lt;a href="https://twitter.com/TapanilaT" target="_blank"&gt;Teemu Tapanila&lt;/a&gt;, talked until late in the evening after the user group about Windows Azure, Windows Phone, new hardware, and all other kinds of geekery. I’m sure Jimmy, Karl, and Teemu and I will be trading embedded-development tricks over email from now on. &lt;/p&gt; &lt;p&gt;The presentation went well and the participants allowed me to go a little longer in the presentation than I’d planned (thanks!). Like the Belgian User Group, this group had many questions and suggestions on how Windows Azure Web Sites could be improved and gave me some great insight into what how our community is enjoying the Web Sites offering and also gave me some ideas on how it can be an even greater platform. I showed off some interesting new features for Visual Studio 2012 web developers my good friend &lt;a href="https://twitter.com/sayedihashimi" target="_blank"&gt;Sayed Hashimi&lt;/a&gt; is putting together, and got some great feedback for the publishing team on new feature ideas. If you’d like to grab a copy of the slides I used for the talk, you can grab them &lt;a href="http://bradystorage.blob.core.windows.net/decks/WebSites-For-Developers.pptx" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt; &lt;h2&gt;CloudBurst 2012&lt;/h2&gt; &lt;p&gt;Thursday and Friday in Stockholm would provide a great ending to an already-inspirational tour, at the &lt;a href="http://www.azureug.se/CloudBurst2012/" target="_blank"&gt;CloudBurst 2012&lt;/a&gt; conference. Organized by &lt;a href="https://twitter.com/noopman" target="_blank"&gt;Magnus Martensson&lt;/a&gt; and &lt;a href="https://twitter.com/alansmith" target="_blank"&gt;Alan Smith&lt;/a&gt; and hosted at the Microsoft Sweden office in Stockholm, CloudBurst was absolutely full of amazing presentations that were &lt;a href="http://www.streamshed.com/microsoft/cloudburst.htm" target="_blank"&gt;streamed live&lt;/a&gt; by Swedish-based, Windows Azure-backed &lt;a href="http://www.streamshed.com/" target="_blank"&gt;StreamShed&lt;/a&gt;. Alan Smith put on an amazing talk in which he used 256 cores in Windows Azure to do ray-tracing, and he tied in a Kinect device to add to the awesomeness of his demonstration. A &lt;a href="http://channel9.msdn.com/posts/Grid-Computing-with-256-Windows-Azure-Worker-Roles" target="_blank"&gt;video explaining his solution is available on Channel 9&lt;/a&gt; if you’re interested in how he achieved amazing results in a multiple-instance Windows Azure Cloud Service. His talk, along with a few amazing data-centric talks by the ever-eloquent (and hilarious) &lt;a href="https://twitter.com/NunoGodinho" target="_blank"&gt;Nuno Godinho&lt;/a&gt;, a pair of absolutely inspirational talks on enterprise architectural patterns by &lt;a href="https://twitter.com/cnayoung" target="_blank"&gt;Charles Young&lt;/a&gt;, a great Service Bus presentation by &lt;a href="https://twitter.com/christianweyer" target="_blank"&gt;Christian Weyer&lt;/a&gt;, and the final talk of the event by Magnus on Continuous Delivery with Windows Azure Web Sites, all demonstrated for me that the European community is pushing the envelope of what’s possible with Windows Azure. The most comical session of all was put on by my good friend &lt;a href="https://twitter.com/maartenballiauw" target="_blank"&gt;Maarten Balliauw&lt;/a&gt;, who covered how to Brew Beer with Windows Azure. Maarten also helped me work through a few MyGet questions throughout the week and maintained the level of support I’ve already raved about. He also saved the day, as my alarm clock decided to go into “silent mode” the last day of the trip. I awoke to the sound of Maarten banging on my door saying “dude we’re having breakfast where are you?!?!?!” (Thanks, buddy!)&lt;/p&gt; &lt;p&gt;I had a demo explosion during my session right at the end, but the audience was gracious enough to hang out during the break between my session and the next so that I could reboot and re-run the code (I’d locked up some processes, apparently). My session outlined the development of a Cloud Service monitoring application, which was released just yesterday as the newest Windows Azure Evangelism Team code sample, known as &lt;a href="http://www.bradygaster.com/the-cloudmonitr-sample" target="_blank"&gt;CloudMonitR&lt;/a&gt;. If you’d like to grab a copy of the slides I used during the talk, you can download them &lt;a href="http://bradystorage.blob.core.windows.net/decks/CloudMonitR.pptx" target="_blank"&gt;here&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;The enthusiasm and motivation on the part of these conference attendees to really raise the level of understanding in their communities around Windows Azure is inspiring. I engaged in quite a few conversations during the event that indicated to me just how excited everyone is around Microsoft’s new commitment to being open in the cloud computing space. These communities are genuinely appreciative of our direction with Windows Azure, Windows Phone, and so many other areas. I anticipate much more from the CloudBurst team and look forward to – hopefully – being a part of CloudBurst 2013 next year. &lt;/p&gt; &lt;h2&gt;Summary&lt;/h2&gt; &lt;p&gt;This trip was inspiring. I am continually motivated when I attend these community events, as I get to see how Windows Azure is being used by our creative community members. The enthusiasm these folks have for Microsoft is contagious, and my involvement with these community leaders and technologists is definitely the best part of my job. This tour, along with so many other sessions and meetings with our dedicated community members, reminds me of what’s possible when we work together to create the best products in the marketplace. It is easy to succeed when you have the best communities in the marketplace, who support us and educate us, and welcome us with such enthusiasm. &lt;/p&gt; &lt;p&gt;Thanks, Europe! Keep staying classy!&lt;/p&gt;</description><pubDate>Tue, 02 Oct 2012 15:44:28 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/eurotrip-2012</guid></item><item><title>The CloudMonitR Sample</title><link>http://www.bradygaster.com:80/the-cloudmonitr-sample</link><description>&lt;p&gt;The next Windows Azure code sample released by the Windows Azure Evangelism Team is the CloudMonitR sample. This code sample demonstrates how Windows Azure Cloud Services can be instrumented and their performance analyzed in real time using a &lt;a href="http://signalr.net/" target="_blank"&gt;SignalR&lt;/a&gt; Hub residing in a web site hosted with Windows Azure Web Sites. Using &lt;a href="http://twitter.github.com/bootstrap/" target="_blank"&gt;Twitter Bootstrap&lt;/a&gt; and &lt;a href="http://highcharts.com/" target="_blank"&gt;Highcharts&lt;/a&gt; JavaScript charting components, the web site provides a real-time view of performance counter data and trace output. This blog post will introduce the CloudMonitR sample and give you some links to obtain it. &lt;/p&gt; &lt;h2&gt;Overview&lt;/h2&gt; &lt;p&gt;Last week I had the pleasure of travelling to Stockholm, Sweden to speak at a great community-run conference, &lt;a href="http://www.azureug.se/CloudBurst2012/" target="_blank"&gt;CloudBurst 2012&lt;/a&gt; (as well as a few other events, which will be covered in a future post &lt;em&gt;very very soon&lt;/em&gt;). I decided to release a new Windows Azure code sample at the conference, and to use the opportunity to walk through the architecture and implementation of the sample with the participants. As promised during that event, this is the blog post discussing the CloudMonitR sample, which you can obtain either as a ZIP file download from the &lt;a href="http://code.msdn.microsoft.com/CloudMonitR-6e224501" target="_blank"&gt;MSDN Code Gallery&lt;/a&gt; or directly from its &lt;a href="https://github.com/WindowsAzure-Samples/CloudMonitR" target="_blank"&gt;GitHub.com repository&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;Below, you’ll see a screen shot of CloudMonitR in action, charting and tracing away on a running Windows Azure Worker Role. &lt;/p&gt; &lt;p&gt;&lt;img title="35[1]" style="border-top: 0px; border-right: 0px; border-bottom: 0px; border-left: 0px; display: inline" border="0" alt="35[1]" src="http://www.bradygaster.com/Media/Default/WindowsLiveWriter/TheCloudMonitRSample_DF44/35%5B1%5D_3.png" width="704" height="428"&gt; &lt;/p&gt; &lt;p&gt;The architecture of the CloudMonitR sample is similar to a previous sample I recently blogged about, the &lt;a href="http://www.bradygaster.com/sitemonitr" target="_blank"&gt;SiteMonitR&lt;/a&gt; sample. Both samples demonstrate how &lt;a href="http://signalr.net/" target="_blank"&gt;SignalR&lt;/a&gt; can be used to connect Windows Azure Cloud Services to web sites (and back again), and both sites use &lt;a href="http://twitter.github.com/bootstrap/" target="_blank"&gt;Twitter Bootstrap&lt;/a&gt; on the client to make the GUI simple to develop and customizable via CSS. &lt;/p&gt; &lt;p&gt;The point of CloudMonitR, however, is to allow for simplistic performance analysis of single- or multiple-instance Cloud Services. The slide below is from the &lt;a href="http://bradystorage.blob.core.windows.net/decks/CloudMonitR.pptx" target="_blank"&gt;CloudBurst presentation deck&lt;/a&gt;, and shows a very high-level overview of the architecture. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/WindowsLiveWriter/TheCloudMonitRSample_DF44/CloudMonitR_4.png"&gt;&lt;img title="CloudMonitR" style="border-left-width: 0px; border-right-width: 0px; border-bottom-width: 0px; display: inline; border-top-width: 0px" border="0" alt="CloudMonitR" src="http://www.bradygaster.com/Media/Default/WindowsLiveWriter/TheCloudMonitRSample_DF44/CloudMonitR_thumb_1.png" width="828" height="468"&gt;&lt;/a&gt; &lt;/p&gt; &lt;p&gt;As each instance of the Worker (or Web) Role you wish to analyze comes online, it makes an outbound connection to the SignalR Hub running in a Windows Azure Web Site. Roles communicate with the Hub to send up tracing information and performance counter data to be charted using the &lt;a href="http://highcharts.com/" target="_blank"&gt;Highcharts&lt;/a&gt; JavaScript API. Likewise, user interaction initiated on the Windows Azure Web Sites-hosted dashboard to do things like add additional performance counters to observe (or to delete ones no longer needed on the dashboard) is communicated back to SignalR Hub. Performance counters selected for observation are stored in a Windows Azure Table Storage table, and retrieved as the dashboard is loaded into a browser. &lt;/p&gt; &lt;h2&gt;Available via NuGet, Too!&lt;/h2&gt; &lt;p&gt;The &lt;a href="https://nuget.org/packages/CloudMonitR" target="_blank"&gt;CloudMonitR&lt;/a&gt; solution is also available as a pair of NuGet packages. The first of these packages, the simply-named CloudMonitR package, is the one you’d want to pull down to reference from a Web or Worker Role for which you need the metrics and trace reporting functionality. Referencing this package will give you everything you need to start reporting the performance counter and tracing data from within your Roles. &lt;/p&gt; &lt;p&gt;The &lt;a href="https://nuget.org/packages/CloudMonitR.Web" target="_blank"&gt;CloudMonitR.Web&lt;/a&gt; package, on the other hand, won’t bring down a ton of binaries, but will instead provide you with the CSS, HTML, JavaScript, and a few image files required to run the CloudMonitR dashboard in any ASP.NET web site. &lt;/p&gt;</description><pubDate>Mon, 01 Oct 2012 22:58:13 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/the-cloudmonitr-sample</guid></item><item><title>The SiteMonitR Sample</title><link>http://www.bradygaster.com:80/sitemonitr</link><description>&lt;p&gt;The newest sample from the Windows Azure Evangelism Team (WAET) is a real-time, browser-based web site monitor. The SiteMonitR front-end is blocked out and styled using &lt;a href="http://twitter.github.com/bootstrap/" target="_blank"&gt;Twitter Bootstrap&lt;/a&gt;, and &lt;a href="http://knockoutjs.com/" target="_blank"&gt;Knockout.js&lt;/a&gt; was used to provide MVVM functionality. A cloud service pings sites on an interval (10 seconds by default, configurable in the worker&amp;rsquo;s settings) and notifies the web client of the sites&amp;rsquo; up-or-down statuses via server-side SignalR conversations. Those conversations are then bubbled up to the browser using client-side SignalR conversations. The client also fires off SignalR calls to the cloud service to manage the storage functionality for the URL&amp;rsquo;s to be monitored. If you&amp;rsquo;ve been looking for a practical way to use SignalR with Windows Azure, this sample could shed some light on what&amp;rsquo;s possible.&lt;/p&gt;
&lt;h2&gt;Architectural Overview&lt;/h2&gt;
&lt;p&gt;The diagram below walks through the various method calls exposed by the SiteMonitR SignalR Hub. This Hub is accessed by both the HTML5 client application and by the Cloud Service&amp;rsquo;s Worker Role code. Since SignalR supports both JavaScript and Native .NET client connectivity (as well as a series of other platforms and operating systems), both ends of the application can communicate with one another in an asynchronous fashion.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/WindowsLiveWriter/TheSiteMoni_143A5/SiteMonitR-Diagram.png" target="_blank"&gt;&lt;img width="700" height="516" title="SiteMonitR Architectural Diagram" style="display: inline; border-width: 0px;" alt="SiteMonitR Architectural Diagram" src="http://www.bradygaster.com/Media/Default/WindowsLiveWriter/TheSiteMoni_143A5/SiteMonitR-Diagram_thumb.png" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Each tier makes a simple request, then some work happens. Once the work is complete, the caller can call events that are handled by the opposite end of the communication. As the Cloud Service observes sites go up and down, it sends a message to the web site via the Hub indicating the site&amp;rsquo;s status. The moment the messages are received, the Hub turns around and fires events that are handled on the HTML5 layer via the SignalR jQuery plug-in. Given the new signatures and additional methods added in &lt;a href="http://blogs.msdn.com/b/webdev/archive/2012/08/22/announcing-the-release-of-signalr-0-5-3.aspx" target="_blank"&gt;SignalR 0.5.3&lt;/a&gt;, the functionality is not only identical in how it behaves, the syntax to make it happen in both native .NET code and JavaScript are almost identical, as well. The result is a simple GUI offering a real-time view into any number of web sites' statuses all right within a web browser. Since the GUI is written using Twitter Bootstrap and HTML5 conventions, it degrades gracefully, performing great on mobile devices.&lt;/p&gt;
&lt;h2&gt;Where You Can Get SiteMonitR&lt;/h2&gt;
&lt;p&gt;As with all the other samples released by the WAET, the SiteMonitR source code is available for download on the &lt;a href="http://code.msdn.microsoft.com/SiteMonitR-dd4fcf77" target="_blank"&gt;MSDN Code Gallery site&lt;/a&gt;. You can view or clone the source code in the &lt;a href="https://github.com/WindowsAzure-Samples/SiteMonitR" target="_blank"&gt;GitHub.com repository&lt;/a&gt; we set up for the SiteMonitR source. Should you find any changes or improvements you&amp;rsquo;d like to see, feel free to submit a pull request, too. Finally, if you find anything wrong with the sample submit an issue via &lt;a href="https://github.com/WindowsAzure-Samples/SiteMonitR/issues" target="_blank"&gt;GitHub&amp;rsquo;s issue tab&lt;/a&gt;, and we&amp;rsquo;ll do what we can to fix the issues reported. The GitHub.com repository contains a &lt;a href="https://github.com/WindowsAzure-Samples/SiteMonitR/blob/master/GettingStarted.md" target="_blank"&gt;Getting Started document&lt;/a&gt; that walks you through the whole process &amp;ndash; with screen shots &amp;ndash; of setting up the SiteMonitR live in your very own Windows Azure subscription (if you don&amp;rsquo;t have one, get a free 90-day trial &lt;a href="http://bit.ly/windowsazuretrial" target="_blank"&gt;here&lt;/a&gt;).&lt;/p&gt;
&lt;h2&gt;Demonstration Video&lt;/h2&gt;
&lt;p&gt;Finally, the video below walks you through the process of downloading, configuring, and deploying the SiteMonitR to Windows Azure. In less than 10 minutes you&amp;rsquo;ll see the entire process, have your very own web site monitoring solution running in the cloud, and you&amp;rsquo;ll be confident you&amp;rsquo;ll be the first to know when any of your sites crash since you&amp;rsquo;ll see their statuses change in real-time. If the video doesn't load properly for you, feel free to &lt;a href="http://channel9.msdn.com/posts/SiteMonitR-Sample" target="_blank"&gt;head on over to the Channel 9 post containing the video&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;video width="640" height="400" controls="controls"&gt;&lt;source src="http://media.ch9.ms/ch9/4d54/8183440a-8056-4854-b0d4-d809372a4d54/SiteMonitRSample.mp4" type="video/mp4" /&gt;&lt;/video&gt;&lt;/p&gt;
&lt;h2&gt;Updates&lt;/h2&gt;
&lt;p&gt;A few days after the SiteMonitR sample was released, &lt;a href="https://twitter.com/woloski" target="_blank"&gt;Matias Wolowski&lt;/a&gt; added in some awesome functionality. Specifically, he added in the ability for users to add &lt;a href="http://phantomjs.org/" target="_blank"&gt;PhantomJS&lt;/a&gt; scripts that can be executed dynamically when sites statuses are received. &lt;a href="https://github.com/woloski/SiteMonitR" target="_blank"&gt;Check out his fork of the SiteMonitR repository on GitHub.com&lt;/a&gt;. I'll be reviewing the code changes over the next few days to determine if the changes are low-impact enough that they can be pulled into the main repository, but the changes Matias made are awesome and demonstrate how any of the Windows Azure Evangelism Team's samples can be extended by the community. Great work, Matias!&amp;nbsp;&lt;/p&gt;</description><pubDate>Mon, 27 Aug 2012 23:15:00 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/sitemonitr</guid></item><item><title>Windows Azure Web Sites Log Cleaner</title><link>http://www.bradygaster.com:80/windows-azure-web-sites-log-cleaner</link><description>&lt;p&gt;Windows Azure Web Sites customers who run web sites in shared instance mode have a generous amount of storage space to use for multiple web sites. The 1GB limit for free customers is more than enough to get a site up and running with lots of room left over for storage. A site&amp;rsquo;s log files contribute to the amount of space being used by a site. If a site has a lot of traffic, the log files could grow and eat into the space available for the important assets for a site &amp;ndash; the HTML, executables, images, and other relevant assets. That&amp;rsquo;s the sole purpose for the Windows Azure &lt;a href="https://nuget.org/packages/WindowsAzure.WebSites.LogCleaner" target="_blank"&gt;Web Sites Log Cleaner&lt;/a&gt;, a &lt;a href="https://nuget.org/" target="_blank"&gt;NuGet&lt;/a&gt; utility you can grab and use in your site with little impact or work.&lt;/p&gt;
&lt;h2&gt;Potential Impacts of Not Backing Up Logs&lt;/h2&gt;
&lt;p&gt;Log analysis is important. It can show all sorts of things, from how much traffic you have to each section of your site, or if you&amp;rsquo;re getting strange requests that indicate some sort of intrusion. If your logs are important to you, there are some important things to remember about Windows Azure Web Sites:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Once the logs reach 35mb in size, logging will be disabled&lt;/li&gt;
&lt;li&gt;If a site&amp;rsquo;s logging functions are toggled off, it could take a few minutes for the logging to re-activate (or deactivate). So if logging is turned off because you exceeded 35mb, then you realize it and clean out your log files, it might take a few seconds for the service to start logging again, resulting in visitors you don&amp;rsquo;t capture in your logs&lt;/li&gt;
&lt;li&gt;If your site starts to spew unhandled exceptions, the failed request and exception logging logs will reflect extensive information about each request, on a file-per-request basis. If the log count &amp;ndash; as in &lt;em&gt;number of files &amp;ndash; &lt;/em&gt;exceeds 50 for either of these types of logs, the logging service for the type of log exceeding 50 (failed request or exception logging, specifically) will be disabled.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For these reasons, it&amp;rsquo;s very helpful to set up a utility such as this to automatically backup and clean out your log files. This utility makes that a snap, and since you can fire it via the execution of a simple URL, there are countless scheduling options, which I introduce later on in this post. For now, let&amp;rsquo;s take a look at how to get started.&lt;/p&gt;
&lt;h2&gt;How to Set it Up&lt;/h2&gt;
&lt;p&gt;Given the convenient features made available via the NuGet team, the installation of this package will make a few changes to your Web.config file. An appSetting node will be added to your file, and an HTTP handler will be registered. The handler, which by default answers requests at the URL &lt;strong&gt;/CleanTheLogs.axd&lt;/strong&gt;, will zip up your log files in a flattened ZIP file, then send that ZIP file into Windows Azure Blob Storage in a conveniently-named file for as long as you&amp;rsquo;ll need it and delete the files from your sites&amp;rsquo; storage space. All you need to do is to hit the URL, and magic happens.&lt;/p&gt;
&lt;script type="text/javascript" src="https://gist.github.com/3300590.js"&gt;&lt;/script&gt;
&lt;p&gt;All you need to do is to create a storage account using the Windows Azure Web Sites portal and to put the account name and key into the your Web.config file. The NuGet package adds placeholders to the file to point out what you&amp;rsquo;ll need to add on your own. Once it&amp;rsquo;s configured, you could set up a scheduled task to hit the URL on intervals, and you back up your logs and keep your sites tidy.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Windows-Azure-Web-Sites-Cleaner_117C1/web-config_2.png"&gt;&lt;img title="Click to expand" style="background-image: none; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-width: 0px;" border="0" alt="Placeholders in Web.config" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Windows-Azure-Web-Sites-Cleaner_117C1/web-config_thumb.png" width="644" height="244" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Sounds too easy? If you have any issues or want a little more detailed explanation of exactly what happens, check out the video below. It&amp;rsquo;ll walk you through the whole process, from creating a site to peeking at the downloaded ZIP file.&lt;/p&gt;
&lt;p&gt;&lt;video controls="controls" height="400" width="640"&gt;&lt;source type="video/mp4" src="http://bradystorage.blob.core.windows.net/screencasts/log-file-cleaner.mp4" /&gt;&lt;/video&gt;&lt;/p&gt;
&lt;h2&gt;Scheduling&lt;/h2&gt;
&lt;p&gt;There are a multitude of methods you could use to schedule the call to the URL and execute the log cleanup process. You could script a Powershell cmdlet to do it, write some C# code, or use a separate Cron Job service to run the task routinely for you. Nathan Totten wrote a &lt;a href="http://blog.ntotten.com/2012/08/05/task-scheduling-with-windows-azure-web-sites-using-a-cron-job-service/" target="_blank"&gt;great blog post on how to achieve task scheduling using a Cron Job service&lt;/a&gt;. Whatever your choice, one call to a URL does the entire job of saving and clearing your logs.&lt;/p&gt;
&lt;p&gt;I can&amp;rsquo;t guide you on how often you should schedule your logs; each site is different. The guarantee is, if you put a site out there, you&amp;rsquo;ll get some traffic even if it&amp;rsquo;s only robot or search engine traffic, and with traffic comes log data. If you&amp;rsquo;re getting a lot of traffic it stands to reason you could reach the 35mb limit in very little time. With a scheduled job like the one Nathan demonstrates in his post, you could set the log backup URL to be called as often as every 10 minutes.&lt;/p&gt;
&lt;h2&gt;Summary&lt;/h2&gt;
&lt;p&gt;You&amp;rsquo;ve got a lot more room in Windows Azure Storage space than you do in your web site folders, and you can use that space to store your logs permanently without using up your web site space. Hopefully this utility will solve that problem for you. If you have any issues setting it up, submit a comment below or &lt;a href="https://twitter.com/bradygaster" target="_blank"&gt;find me on Twitter&lt;/a&gt;.&lt;/p&gt;
&lt;h2&gt;Update&lt;/h2&gt;
&lt;p&gt;The Windows Azure Web Sites Log Cleaner source code has been published into a &lt;a href="https://github.com/WindowsAzure-Samples/WindowsAzure-WebSites-LogCleaner" target="_blank"&gt;GitHub.com public repository&lt;/a&gt;. If you want to see how it works, or you have an interest in changing the functionality in some way, feel free to clone the source code repository.&amp;nbsp;&lt;/p&gt;</description><pubDate>Thu, 09 Aug 2012 03:29:00 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/windows-azure-web-sites-log-cleaner</guid></item><item><title>PhluffyFotos on Windows Azure</title><link>http://www.bradygaster.com:80/phluffyfotos-on-windows-azure</link><description>&lt;p&gt;In keeping with the Windows Azure Evangelism Team’s mission of providing samples that demonstrate how to use various aspects of the Windows Azure platform, I’d like to introduce you to the PhluffyFotos application. The idea behind PhluffyFotos is to offer an image-sharing application that allows users to upload, tag, and share images on line. The &lt;a href="http://www.bradygaster.com/the-mypictures-sample" target="_blank"&gt;MyPictures&lt;/a&gt; application sample introduced you to the idea of storing images in Windows Azure Blob Storage via Web API, but PhluffyFotos takes the idea of an image-sharing application a few steps further architecturally. Take a look at this sample if you want to see how various Windows Azure components – Web Sites, Cloud Services, and Windows Azure Storage – to see how to add background processing to your web application, all hosted in the cloud.&lt;/p&gt; &lt;h2&gt;Architecture&lt;/h2&gt; &lt;p&gt;The PhluffyFotos application runs as a Windows Azure Web Site used to let visitors upload images. Those images and their metadata are sent over to Windows Azure for processing. The Cloud Service picks up information stored in Windows Azure Storage Queues, and processes that information so it can be stored in Windows Azure Table Storage. The image content itself, like was done in MyPictures, is stored in binary blobs using Windows Azure Blob Storage. The web site allows for multiple user profiles, which are stored in a Windows Azure SQL Database and accessed using the &lt;a href="https://nuget.org/packages/Microsoft.AspNet.Providers" target="_blank"&gt;Universal Profile Providers&lt;/a&gt;, which are available via &lt;a href="https://nuget.org/" target="_blank"&gt;NuGet&lt;/a&gt;. Everything image-centric is actually stored in Windows Azure Storage, once it has been processed via the Cloud Service. &lt;/p&gt; &lt;h2&gt;Links and Video&lt;/h2&gt; &lt;p&gt;As with all the other Windows Azure Evangelism Team samples and demonstrations, &lt;a href="https://github.com/WindowsAzure-Samples/PhluffyFotos" target="_blank"&gt;the source code for PhluffyFotos is stored in its very own GitHub.com repository&lt;/a&gt;. If you notice any issues with the code, please feel free to use &lt;a href="https://github.com/WindowsAzure-Samples/PhluffyFotos/issues" target="_blank"&gt;repository’s Issues feature&lt;/a&gt; to let me know what you find. Likewise, if you feel you have a change that’d improve the sample, feel free to make your own fork in which you can change the code, and submit a pull request. &lt;a href="http://code.msdn.microsoft.com/PhluffyFotos-Sample-7ecffd31" target="_blank"&gt;The sample is available on the MSDN samples site&lt;/a&gt;, too, so you can use that link to submit questions and to download a zip file containing the code for the sample. I’ve also published &lt;a href="http://channel9.msdn.com/posts/The-PhluffyFotos-Windows-Azure-Sample" target="_blank"&gt;a Channel9 video that demonstrates how you can get the sample running, step-by-step&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;I and the rest of the Windows Azure Evangelism Team hope you enjoy this example of what's possible with Windows Azure! Happy Coding!&lt;/p&gt;</description><pubDate>Tue, 07 Aug 2012 22:32:12 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/phluffyfotos-on-windows-azure</guid></item><item><title>Running Nancy on Windows Azure Web Sites</title><link>http://www.bradygaster.com:80/running-nancy-on-windows-azure-web-sites</link><description>&lt;p&gt;I’m a huge fan of finding cleaner ways to build web applications. Simplicity is a really good thing. &lt;a href="https://github.com/NancyFx/Nancy" target="_blank"&gt;Nancy&lt;/a&gt; is a simple little web framework inspired by Ruby’s &lt;a href="http://www.sinatrarb.com/" target="_blank"&gt;Sinatra&lt;/a&gt;. Nancy is open source, hosted on GitHub.com, and distributed like any other awesome .NET open source library – via &lt;a href="http://nuget.org/packages?q=nancy" target="_blank"&gt;NuGet&lt;/a&gt; packages. When a coding challenge landed on my desk this week that I’ll be responsible for prototyping, Nancy seemed like a good option, so I’ve taken the time to tinker with it a little. I’ll spare you the details of the coding assignment for this post. Instead, I’ll focus on the process of getting Nancy working in your own Windows Azure Web Site. &lt;/p&gt; &lt;p&gt;To start with, I’ve created an empty web site using the Windows Azure portal. This site won’t use a database, so I just logged into the portal and selected &lt;strong&gt;New –&amp;gt; Web Site –&amp;gt; Quick Create&lt;/strong&gt; and gave it a pretty logical name. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/1_2.png"&gt;&lt;img title="1" 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="1" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/1_thumb.png" width="704" height="440"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Once the site was finished cooking, I grab the publish profile settings from the site’s dashboard. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/2_2.png"&gt;&lt;img title="2" 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="2" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/2_thumb.png" width="704" height="440"&gt;&lt;/a&gt;&lt;/p&gt; &lt;h2&gt;Getting Started with Nancy&lt;/h2&gt; &lt;p&gt;First, I create an empty ASP.NET web application. To make sure everything’s as clean as it could be, I remove a good portion of the files and folders from the site. Since I’ll be creating the most basic level functionality in this example, I don’t need a whole lot of extraneous resources and functionality in the site. The project below shows what I have left over once I ransacked the project’s structure. Take note of the &lt;em&gt;Uninstall-Package&lt;/em&gt; command I made in the Package Manager Console. I ran similar commands until I had as bare-bones a project structure as possible. Then I removed some stuff from the Web.config until it literally was quite minimalistic.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/3_2.png"&gt;&lt;img title="3" 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="3" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/3_thumb.png" width="704" height="441"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;To run Nancy on Windows Azure Web Sites, I’ll need to install 2 packages from NuGet. The first of these is the &lt;a href="http://nuget.org/packages/Nancy" target="_blank"&gt;Nancy core package&lt;/a&gt;. The second package I’ll need is the package that enables &lt;a href="http://nuget.org/packages/Nancy.Hosting.Aspnet" target="_blank"&gt;Nancy hosting on ASP.NET&lt;/a&gt;. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/4_2.png"&gt;&lt;img title="4" 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="4" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/4_thumb.png" width="753" height="305"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;In my web project I create a new folder called NancyStuff and add a new class called &lt;em&gt;HelloWorldModule&lt;/em&gt;. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/5_4.png"&gt;&lt;img title="5" 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="5" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/5_thumb_1.png" width="283" height="338"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;This class is a very basic Nancy Module, and I learned how to create it by perusing the &lt;a href="https://github.com/NancyFx/Nancy/wiki/Exploring-the-nancy-module" target="_blank"&gt;Nancy project’s GitHub.com Wiki&lt;/a&gt;. I basically want to have a route that, when called, will just say hello to the user. You don’t get much simpler than this for assigning functionality to a given route. When the user requests the &lt;strong&gt;/hello&lt;/strong&gt; route using an HTTP GET request, the message &lt;strong&gt;Hello World&lt;/strong&gt; is rendered to the response stream. The &lt;em&gt;HelloWorldModule &lt;/em&gt;class will extend &lt;em&gt;NancyModule. &lt;/em&gt;In Nancy, routes are handled by classes which inherit from &lt;em&gt;NancyModule. &lt;/em&gt;According to the Nancy documentation, &lt;em&gt;&lt;a href="https://github.com/NancyFx/Nancy/wiki/Exploring-the-nancy-module" target="_blank"&gt;Modules are the lynchpin of any given Nancy application&lt;/a&gt;. &lt;/em&gt;&amp;nbsp;&lt;/p&gt;&lt;script src="https://gist.github.com/3184077.js?file=HelloWorldModule.cs"&gt;&lt;/script&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;At this point, everything should work, so I’ll go ahead and deploy the web site up to Windows Azure. To do this, I select the &lt;em&gt;Publish &lt;/em&gt;context menu item from within Visual Studio 2012. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/6_2.png"&gt;&lt;img title="6" 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="6" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/6_thumb.png" width="704" height="415"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Then, I import the publish settings file using the &lt;em&gt;Import &lt;/em&gt;feature on the publishing dialog. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/7_2.png"&gt;&lt;img title="7" 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="7" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/7_thumb.png" width="704" height="549"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Once I find the .&lt;em&gt;publishsettings &lt;/em&gt;file I downloaded from the Windows Azure portal and import it, I’m ready to publish. Clicking the publish button in the dialog at this point will result in the site being deployed up to my Windows Azure Web Site. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/8_2.png"&gt;&lt;img title="8" 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="8" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/8_thumb.png" width="704" height="549"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;The site will open once the deployment has completed and will &lt;em&gt;probably &lt;/em&gt;present me with a 404 error, indicating there’s no route configured to answer requests to the root of the site. Changing the URL to hit &lt;strong&gt;/hello&lt;/strong&gt; will result with the module answering the request and doing what I expected it to do:&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/9_2.png"&gt;&lt;img title="9" 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="9" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/9_thumb.png" width="714" height="252"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;h2&gt;Enabling Static File Browsing&lt;/h2&gt; &lt;p&gt;With this first module functioning properly I want to create a static file from which the Nancy module could be called using jQuery on the client. The idea is, now that I have this Nancy module working, I might want to make calls to it using some AJAX method to display the message it returns to the user. So I add a new static HTML page to my solution. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/10_4.png"&gt;&lt;img title="10" 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="10" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/10_thumb_1.png" width="704" height="431"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;The problem here is that, since Nancy’s handing requests to my site and using the modules I create to respond to those requests, the ability to browse to static files is… well… sort of &lt;em&gt;turned off. &lt;/em&gt;So attempts to hit a seemingly innocent-enough page results with a heinous – yet adorable in a self-loathing sort of way - response. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/11_2.png"&gt;&lt;img title="11" 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="11" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/11_thumb.png" width="615" height="402"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Thanks to the Nancy documentation, it was pretty easy to find a solution to this behavior. See, Nancy basically starts intercepting requests to my site, and it takes precedence over the default behavior of “serving up static files when they’re requested.” Nancy’s routing engine listens for requests and if one’s made to the site for which no module has been created and routed, the site has no idea how to handle the request. &lt;/p&gt; &lt;p&gt;To solve this problem, I need to create another class that extends the &lt;em&gt;DefaultNancyBootstrapper &lt;/em&gt;class. This class, explained pretty thoroughly in the &lt;a href="https://github.com/NancyFx/Nancy/wiki/Managing-static-content" target="_blank"&gt;GitHub.com Nancy Wiki’s article on managing static content&lt;/a&gt;, is what I’ll need to use to instruct Nancy on how to route to individual static files. For now I’m only in need of a class to handle this one particular static file, but setting up a bootstrapper to allow static browsing in a directory is possible. Other options exist too, such as routes that use regular expressions, but that’s something I’ll look at in a later episode of this series. For now, I just want to tell Nancy to serve up the page &lt;em&gt;Default.html &lt;/em&gt;whenever a request is made to &lt;em&gt;/Default.html&lt;/em&gt;. I’m also enabling static file browsing out of the &lt;strong&gt;/scripts &lt;/strong&gt;folder of the site. The main thing to look at here is the call to the &lt;em&gt;StaticContentsConventions.Add&lt;/em&gt; method, into which I pass the name of the file and the route on which it should be served up. &lt;/p&gt;&lt;script src="https://gist.github.com/3184722.js"&gt; &lt;/script&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Now, I’ll add some jQuery code to the static page that calls the &lt;em&gt;HelloWorldModule&lt;/em&gt; and displays whatever it responds with in an HTML element on the page. &lt;/p&gt;&lt;script src="https://gist.github.com/3185033.js?file=Default.html"&gt;&lt;/script&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;When the static file loads up in the browser, the jQuery code makes an AJAX request back to the server to the &lt;strong&gt;/hello&lt;/strong&gt; route, and then drops the response right into the page. When I deploy the site again to Windows Azure Web Sites and hit the &lt;em&gt;Default.html&lt;/em&gt; file, the behavior is just what I’d expected it would be; the page loads, then the message is obtained via AJAX and displayed. &lt;/p&gt; &lt;p&gt;&lt;a href="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/12_2.png"&gt;&lt;img title="12" 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="12" src="http://www.bradygaster.com/Media/Default/Windows-Live-Writer/Running-NancyFx-on-Windows-Azure-Web-Sit_A703/12_thumb.png" width="704" height="147"&gt;&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&amp;nbsp;&lt;/p&gt; &lt;p&gt;Hopefully this introduction has demonstrated the support Windows Azure Web Sites has for Nancy. Since Nancy can be hosted under ASP.NET, and since Windows Azure Web Sites support the ASP.NET pipeline, everything works. I’ll continue to tinker with Nancy from here as I work on the coding project for which I chose it to be a puzzle piece. Hopefully during that development work I’ll learn more about Nancy, have the time to demonstrate what I learn, and ease someone’s day when they decide to move their Nancy site over to Windows Azure Web Sites. &lt;/p&gt; &lt;p&gt;Happy coding!&lt;/p&gt;</description><pubDate>Thu, 26 Jul 2012 22:43:35 GMT</pubDate><guid isPermaLink="true">http://www.bradygaster.com:80/running-nancy-on-windows-azure-web-sites</guid></item></channel></rss>