blog.smarx.com

Steve Marx's blog about cloud development

Manage Your Windows Azure Application From PowerShell

Are you reading Ryan Dunn’s blog?  If not, go subscribe to his RSS feed now.  Ryan’s the Technical Evangelist for Windows Azure.  Among other things, he’s constantly releasing useful tools for Windows Azure developers.  Last week it was myazurestorage.com, a tool for viewing your tables in the browser.  This week, it’s PowerShell cmdlets for managing your Windows Azure applications.

cmdlets screenshot

I haven’t gotten to play with them yet, but I’m eager to.  From Ryan’s post:

As of today, you can download some Powershell cmdlets that wrap this API and make managing your Windows Azure applications simple from script.  With these cmdlets, you can script your deploys, upgrades, and scaling operations very easily.

You can download the cmdlets from MSDN Code Gallery page.


What Makes a Great Developer Website? Help Me Improve http://dev.windowsazure.com!

dev.windowsazure.com screenshot Did you see the new http://windowsazure.com?  I think the site has a much cleaner look and makes it easier to find what you’re looking for.

http://dev.windowsazure.com takes you directly to the Windows Azure developer site, which is the place developers go for information about Windows Azure.

My responsibility is to play curator for that site.  I’m going to try to find the best content available and organize it in a way that developers can find the information they need as quickly and easily as possible.  I’d like your help doing that.

Three questions every product website should answer

When I’m investigating a new development technology, these are the questions I immediately ask (and the time I’m willing to spend answering each):

  1. What is this? (30 seconds)
  2. Is it useful to me? (5 minutes)
  3. How can I get started? (15 minutes)

I’d like http://dev.windowsazure.com to deliver great answers to these questions for a developer audience and then provide organized, deeper content for people who decide to invest their time learning the platform.

I need your help!

I’ve set up a Writeboard page (basically a one-page wiki) with the password “azure” where you can contribute to this effort by helping me collect the right content and organize it.  There’s also a section on the page for you to tell me about the best developer websites you’ve seen and why you like them.

Here’s a screenshot of the page at the time of this writing:

writeboard screenshot

To contribute

Browse to http://123.writeboard.com/4b893890aa0ca3a65 and enter the password “azure”.


Transcript from Today’s Windows Azure Lounge Chat

WAZL chat word cloud This afternoon I spent three hours hanging out in the Windows Azure Lounge.  With a longer period of time to chat and less hype, we had a more relaxed and social chat than the first time.  I like that, and that’s part of the reason I want to do these more regularly.

(Interesting stat: this chat had 530 messages over three hours.  The first chat had 572 messages in just one hour!)

As came up again in this chat, time zones are a pain, so I vow to do one of these at night (for me) so the rest of the world has a chance to hang out during normal waking hours.

For those who missed out on the fun (or were there and want to relive it!), the transcript is available:

The word cloud on the right is courtesy of wordle.net and accurately reflects the meandering nature of the conversation. :)


Chat About Windows Azure Tomorrow

Remember the Windows Azure Lounge?  I’ll be hanging out there (maybe with a few coworkers) tomorrow, September 4th, from 12:00 PM to 3:00 PM PDT.  Feel free to stop by and chat about whatever’s on your mind.  Unlike the first chat, this one will be a little less structured.  Just show up and hang out, any time noon to three.

I look forward to chatting with you tomorrow!


Simple Example of Twilio and Windows Azure

As you may have already seen, Twilio chose Windows Azure as this week’s category for their developer contest.  (UPDATE: Now more like two weeks!)  In addition to Twilio’s normal prize of a netbook, we’ve kicked in a couple additional prizes for this week: a copy of Windows 7 and $500 of free Windows Azure use after our commercial launch in November.

To help give everyone a head start on getting their contest entry ready, I thought I’d put together a simple example of using Twilio from a Windows Azure application.  While not quite as cool as my earlier experiment with Twilio (The CIA Pickup), this example should serve as a basic, how-to-make-it-work sample.

The Application

wazsong screenshotEarly in the days of the Windows Azure CTP, Tobias Zimmergren recorded a song called “I Can (Windows) Azure You.”  It’s kind of catchy.

My sample Twilio + Windows Azure application calls you at a phone number you specify and plays the song to you over the phone.  Play with it at http://wazsong.cloudapp.net and download the full source.

What You’ll Need

  1. A Windows Azure account (Register for your invitation code, and get it instantly!)
  2. A paid Twilio account with one Outgoing CallerID Number (This sample makes outbound phone calls, which free trial accounts can’t do.) UPDATE [9/2/2009 @ 5:15PM]: I got this wrong initially.  Trial accounts can do this as long as you put in a valid Caller ID Number of your own.  See Dennis’s comment below.
  3. The Windows Azure SDK and tools (These require Windows Server 2008, Vista, or Windows 7.)

The Code

There’s exactly one page to this application.  The markup isn’t terribly interesting; it’s basically just a text box and a submit button.  The code-behind handles making the call to Twilio (using Twilio’s C# helper library).  Here’s the full code-behind (default.aspx.cs):

using System;
using System.Collections;
using Microsoft.ServiceHosting.ServiceRuntime;
using TwilioRest;

namespace WindowsAzureSong_WebRole
{
    public partial class _Default : System.Web.UI.Page
    {
        protected void singButton_Click(object sender, EventArgs e)
        {
            var id = RoleManager.GetConfigurationSetting("TwilioID");
            var token = RoleManager.GetConfigurationSetting("TwilioToken");
            var account = new Account(id, token);
            var vars = new Hashtable();
            vars["Caller"] = RoleManager.GetConfigurationSetting("OutboundNumber");
            vars["Called"] = phoneNumber.Text;
            vars["Url"] = string.Format("http://{0}{1}", Request.Url.Host, ResolveUrl("~/callscript.xml"));
            vars["Method"] = "GET";
            account.request(string.Format("2008-08-01/Accounts/{0}/Calls", id), "POST", vars);
            submittedLabel.Visible = true;
        }
    }
}

As you can see, it generates a reference to callscript.xml, which just looks like this:

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
  <Play>http://cdn.blog.smarx.com/files/WindowsAzureYou.mp3</Play>
</Response>

That URL is where I’ve stored the song (in a public container in Windows Azure blob storage), but you could put it anywhere (including in your app).

Links

Play with the sample at http://wazsong.cloudapp.net and download the full source code.  Enjoy, and good luck if you enter the contest!