The Marriage of Cloud and Mobility

Tags

, , ,

Anybody that follows me or my blog knows that I’m a huge proponent of using a cloud platforms such as Windows Azure to power new mobility applications.  Windows Azure offers so many great features that it seems silly to me to not even at least consider Windows Azure as a way to power a Windows Phone, iOS, or Android application.

Recently I had the opportunity to sit down with Tim Huckaby for a Bytes by MSDN video.  In this session Tim and I discuss helping customers to adopt Windows Azure, creating logical environments (development, QA, production, etc.) in Windows Azure, and some insights into using Windows Azure with Windows Phone applications.

Bytes by MSDN Interview - Michael Collier

Be sure to follow the links below for a quick way to get started today with Windows Azure and Windows Phone.

Windows Azure Kick Start – Returning to Columbus

Tags

, ,

The Windows Azure Kick Start tour this spring has been a fairly successful event.  The tour hit 13 cities across the Midwest and Central parts of the United States.  The purpose of the these kick starts was to introduce people to Windows Azure and give them the basic foundation they need to build applications on Windows Azure.

On Saturday, June 9th there will be another Windows Azure Kick Start event held in Columbus, OH.  If you missed the one earlier this spring (on April 5th), now is your chance!

During the day we’ll show you how sign up for Windows Azure (leveraging your MSDN benefits if applicable), how to build a basic ASP.NET application and connect it to SQL Azure, ways to leverage cloud storage, and even some common scenarios for using Windows Azure.  As if that’s not enough, lunch and prizes will also be provided!

What are you waiting for?  Step away from the landscaping and step into a comfy air conditioned office and learn about Windows Azure.  We’ll have fun – I promise!!

Register now at http://columbuswaks.eventbrite.com/

Podcast Interview on Migrating Applications to Windows Azure

Tags

Recently I had the opportunity to join Michael Surkan from Uhuru Software for an episode of the Uhuru podcast.  Michael and I spent a few minutes talking about some basic concepts and process for migrating applications to Windows Azure, options for handling operating system updates, and the focus on building great applications and less on the infrastructure.

Take about 14 minutes and check it out at http://bit.ly/uhrpodnp01.

Sending Text Messages from Your Windows Azure Service

Tags

, , ,

Recently I was waiting at O’Hare for a flight back to Columbus.  I fired up Evernote to catch up on some Windows Azure articles I wanted to read (I save a lot of things to Evernote).  One of the first articles I read was a CodeProject article by Luke Jefferson at Red Gate.  Luke’s article provides a really nice basis for using Cerebrata’s PowerShell Cmdlets and Twilio for sending SMS messages when your Windows Azure service has “issues”.

This got me thinking – could I write something similar (I was inspired) before I returned home to Columbus?  I’d like to tweak it a little to run as a Windows Azure worker role.  I would have to do most of the writing without the crutch of the Internet (remember – no WiFi at O’Hare and no WiFi on my plane).  I would have a brief internet connection before getting on the plane if I used my awesome Nokia Lumia 900 for tethering.  This is doable!

The timing couldn’t have been better!  I remembered seeing a Twitter message earlier in the day from @WindowsAzure announcing a new promotion from Twilio to get some free messages for Windows Azure customers.  Perfect time to try this out!


By the way, if you don’t have Windows Azure yet, now is a good time to get it.


While Luke’s article on CodeProject uses PowerShell cmdlets, I wanted to try it with regular C# code and run the solution in a simple Windows Azure worker role.  To do so I would need to work with the Windows Azure Service Management API.  As Luke points out in his article, the Windows Azure Service Management API is a  REST API.  He does a great job of explaining the basics, so be sure to check it out and head over to MSDN for all the details.

Unfortunately there is not yet a nice .NET wrapper for this API.  I took at look at Azure Fluent Management library, but it didn’t yet have all the features needed for this little pet project (but looks to be cool – something to keep an eye on).  Thankfully, I remembered I had read Neil Mackenzie’s excellent Microsoft Windows Azure Development Cookbook and it contained a recipe for getting the properties of a hosted service.  Bingo!  This recipe is a very helpful one (like many in Neil’s book) and I had the code standing by in a sample project I put together while reading Neil’s book.  With the starting point for using the Windows Azure Service Management API in place, the only thing I needed now was an API for working with Twilio

Time to fire up the phone tethering feature, sign up for Twilio, and download their API.  I decided to use the twilio-csharp client library and installed that via NuGet.  Easy enough.  With everything that I needed downloaded, it was time to power down and get on the plane.

The basics of what I wanted to do are pretty simple:

  1. Get the properties of a specific Windows Azure hosted service
  2. Check if the service is Running or not
  3. If the service is not Running, send a SMS message to me to let me know that something is not right.
  4. Sleep for a little bit and then repeat the process.

Get Hosted Service Properties

private HostedServiceProperties GetHostedServiceProperties(string subscriptionId, string serviceName, string thumbprint)
{
String uri = String.Format(ServiceOperationFormat, subscriptionId, serviceName);

ServiceManagementOperation operation = new ServiceManagementOperation(thumbprint);
XDocument hostedServiceProperties = operation.Invoke(uri);

var deploymentInformation = (from t in hostedServiceProperties.Elements()
select new
{
DeploymentStatus = (from deployments in t.Descendants(WindowsAzureNamespace + "Deployments")
select deployments.Element(WindowsAzureNamespace + "Deployment").Element(WindowsAzureNamespace + "Status").Value).First(), RoleCount = (from roles in t.Descendants(WindowsAzureNamespace + "RoleList")
select roles.Elements()).Count(), InstanceCount = (from instances in t.Descendants(WindowsAzureNamespace + "RoleInstanceList")
select instances.Elements()).Count()
}).First();

var properties = new HostedServiceProperties
{
Status = deploymentInformation.DeploymentStatus,
RoleCount = deploymentInformation.RoleCount,
InstanceCount = deploymentInformation.InstanceCount
};

return properties;
}

Send a Message if Not Running

     // Get the hosted service
     var serviceProperties = GetHostedServiceProperties(subscriptionId, hostedServiceName, managementCertificateThumbprint);

     // If the service is not running.
     if (serviceProperties.Status != "Running")
     {
          string message = string.Format("Service '{0}' is not running.  Current status is '{1}'.",
                                                   hostedServiceName, serviceProperties.Status);

          // Send the SMS message
          twilio.SendSmsMessage(fromPhoneNumber, toPhoneNumber, message);
     }
}

Putting it All Together

 private readonly XNamespace WindowsAzureNamespace = "http://schemas.microsoft.com/windowsazure";
 private const string ServiceOperationFormat = "https://management.core.windows.net/{0}/services/hostedservices/{1}?embed-detail=true";

public override void Run()
 {
 Trace.WriteLine("Staring Windows Azure Notifier Role", "Information");

// Get the configuration settings needed to work with the hosted service.
 var hostedServiceName = GetConfigurationValue("HostedServiceName");
 var subscriptionId = GetConfigurationValue("SubscriptionId");
 var managementCertificateThumbprint = GetConfigurationValue("ManagementCertificateThumbprint");

// Get the configuration settings for Twilio.
 var twilioId = GetConfigurationValue("TwilioId");
 var twilioToken = GetConfigurationValue("TwilioToken");
 var fromPhoneNumber = GetConfigurationValue("FromPhoneNumber");
 var toPhoneNumber = GetConfigurationValue("ToPhoneNumber");

// Create an instance of the Twilio client.
 var twilio = new TwilioRestClient(twilioId, twilioToken);

while (true)
 {
 // Get the hosted service
 var serviceProperties = GetHostedServiceProperties(subscriptionId, hostedServiceName, managementCertificateThumbprint);

 // If the service is not running.
 if (serviceProperties.Status != "Running")
 {
  string message = string.Format("Service '{0}' is not running. Current status is '{1}'.",
  hostedServiceName, serviceProperties.Status);

 // Send the SMS message
 twilio.SendSmsMessage(fromPhoneNumber, toPhoneNumber, message);
 }

 Thread.Sleep(TimeSpan.FromMinutes(5));
 Trace.WriteLine("Working", "Information");
 }
 

I had most of this put together before the stewardess informed me it was time to power down in preparation for landing. The only things I needed yet was a Windows Azure subscription ID, a Windows Azure management certificate thumbprint, and a hosted service to test this against. I have several Windows Azure hosted services running for various reasons, so all this was easy enough to get.

With all the necessary bits in place, it’s time to test this out.  In order to get this working in Windows Azure (as opposed to my local emulator) I would need to include my management certificate as part of the role I’m deploying.  When using the emulator, the certificate is already on my development machine so I didn’t need to do anything special.

Add the certificate to the role

I would also upload this certificate as a service certificate.

Windows Azure Hosted Service Certificates

With the certificates in place, I was ready to deploy the service as an Extra Small worker role.  I then picked one of my demo apps and told Windows Azure to shut it down.  Shortly after that, I received a new text message from my Twilio account!

While this was just a simple proof-of-concept, it was pretty cool and can be pretty powerful.

If you’d like the whole source code for this project, you can download it here.

CloudDevelop Conference

Tags

,

I was attending the first M3 Conference last November when I started talking with a few buddies there about what we thought of M3.  The attendance, sessions, and general “buzz” during M3 as people discussed, debating, learned, and compared the various mobile platforms was great!  As guys with a passion for cloud computing, we were thinking that there really should be something similar to M3 but for cloud computing.

Fast forward a few months and the inaugural CloudDevelop Conference is born!  CloudDevelop 2012 will be held on Friday, August 3rd in Columbus, OH in The Ohio State University’s Ohio Union.

The goal with CloudDevelop is to be the Midwest’s premier conference for cloud technologies and application development.  I feel it is important to point out that CloudDevelop is cloud vendor / technology neutral.  CloudDevelop will feature sessions that cover all cloud platforms and services.  By having a mixture of cloud computing vendors, technologies, and topics at CloudDevelop, the organizers feel that will provide a dynamic and engaging conference for all attendees.

If you would like to speak at CloudDevelop, I would encourage you to get your best Windows Azure, Amazon AWS, Heroku, AppHarbor, Google AppEngine, etc. session abstract ready and submit a few sessions today!  Please submit sessions at http://clouddevelop.org/SubmitProposal.html.  The call for speakers closes on May 10th.

CloudDevelop wouldn’t be possible without the generous support of sponsors.  If you’re a cloud provider or tool vendor and would like to be a sponsor of CloudDevelop, please view the sponsor prospectus at http://clouddevelop.org/CloudDevelopProspectus2012.pdf to learn more about the opportunities available.

Understanding Windows Azure Security

Tags

,

Whenever I talk with clients about Windows Azure or lead a training class on Windows Azure security is always one of the first, and most passionate, topics discussed.  People want, even need, to feel comfortable that the data and application logic is going to be safe when they give up physical control of that data or logic (the “secret sauce”).  When it comes to cloud computing, there is a lot of FUD about security.  In order to feel comfortable and knowledgeable about the security aspects of Windows Azure, it’s important to spend some time educating yourself on the security aspects of the platform.

Microsoft has recently published several great resources for learning more about Windows Azure security.  The first place I’d recommend checking out is the Windows Azure Trust Center.  The Windows Azure Trust Center provides security, compliance, trust, and FAQs related to Windows Azure.  This should provide the current answers and information on security for Windows Azure.  There is a lot of guidance and whitepapers here related to security of the Windows Azure datacenters, the platform itself, and developing secure applications on Windows Azure.

The Cloud Security Alliance (CSA) also has a Cloud Controls Matrix (CCM) that provides a framework which aligns to the CSA’s guidance for cloud security.  The CCM is part of the CSA’s Security, Trust & Assurance Registry (STAR).  Microsoft has recently provided a document which outlines how the core Windows Azure services meet the requirements outlined in the CSA’s Cloud Controls Matrix.  The document contains a lot of good information – check it out here.  You can also get the same document as it applies to Office 365 and Microsoft Dynamics CRM Online by going here.

Finally, for the developers amongst us, there is a great series on the ISV Developer Community Blog that discusses many aspects of Windows Azure security and how to incorporate secure application development into the development lifecycle.  Be sure to check out the entire seven-part “Windows Azure Security Best Practices” series:

In the end, security is a partnership.  Those producing applications for cloud platforms such as Windows Azure need to develop robust, secure applications.  Hosting an insecure application in the cloud doesn’t magically make it secure.  Likewise, cloud computing providers and platforms, such as Microsoft’s Windows Azure platform, need to provide provide robust and secure platforms.  They need to provide information about the platform so those looking to use the platform can feel comfortable with it.  It’s about trust.

Once you’re comfortable with the security aspects of Windows Azure, download the tools and sign up for a free trial account (if you don’t already have an account or Windows Azure benefits through a program like MSDN).  Happy coding!

Where is my Windows Azure Diagnostics Data?!?!!

Tags

,

I was recently deploying a Windows Azure project where I used a different Windows Azure storage account for diagnostic data than for application data.  After publishing the project to Windows Azure I noticed the diagnostic data wasn’t showing up as expected – there was nothing in the storage account I set up to collect diagnostic data.  I checked the storage account for the application, and the diagnostic data was being collected there.

Well, that’s odd.  I checked the value of the ‘Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString’ connection string, and sure enough it was set to the storage account for the application, not the account I set for diagnostic data.

I had set the diagnostic connection string to use the ’findabathroomdiag’ storage account.

<Role name="FindABathroom.Web">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=findabathroomdiag;AccountKey=b" />
<Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=findabathroom;AccountKey=a"/>
  </ConfigurationSettings>
</Role>

I would then publish the project using the publishing wizard in Visual Studio.  In this wizard I would set the storage account to publish to ‘findabathroom’, the storage account for the application.

Looking at the ServiceConfiguration.cscfg file in the Windows Azure management portal I noticed the ‘Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString’ connection string was set to use ‘findabathroom’, and not ‘findabathroomdiag’ as I had expected.

What?  Somebody’s playing tricks on me!

No tricks.  I had forgotten about a change made to the Windows Azure tools for Visual Studio.  If you open up the properties for your Windows Azure role, go to the Configuration tab.  In the Diagnostics area you’ll find the “Use publish storage account as connection string when you publish to Windows Azure” check box.  This option is checked by default!

This little check box setting will cause Visual Studio to change your diagnostics connection string to match the connection string used during publishing of the application.

If you don’t want Visual Studio to change your diagnostics connection string, then be sure to uncheck that box!

Detroit Day of Azure – Presentations

Tags

,

On Saturday (3/24/2012) I was honored to be a speaker at Day of Azure in Detroit.  The community in the Heartland is amazing!  The event sold out!!  It is great to see 144 passionate people attend a daylong event to learn more about the possibilities with cloud computing and Windows Azure.

A huge “thank you” should go out to David Giard and the other volunteers at Day of Azure for putting on such a great event. They really did a wonderful spreading the word and hosting the event.  Oh, and the BBQ for lunch . . . oh so very good!

I gave two sessions at Day of Azure – “Windows Phone 7 and Windows Azure – A Match Made in the Cloud” and “Building Hybrid Applications with Windows Azure”.  I was asked by several attendees if I’d be making the presentation available, and so I am.  You can take a look these, and a few other of my presentations, over on SlideShare.

The Hybrid Windows Azure Application

Windows Phone 7 and Windows Azure – A Match Made in the Cloud

Learn Windows 8 at a Windows 8 Developer Camp

Tags

You know it is coming. You have seen the fresh new interface. You have talked about the things you like, and maybe the things you don’t like. But, have you tried to write an application for it?

It is time to change that. Coming to Columbus on Thursday, April 26th is a Windows 8 developer camp. This promises to be a great opportunity to get hands-on experience developing an application for Windows 8.

To learn more, and sign up for this free, full day event, just click here.

Additional Windows 8 Developer Camps

Note: This is being cross-posted at www.coccug.org

Windows Azure Kick Start Tour

Tags

,

When I talk with people about Windows Azure and show them some of the really cool things you can do with Windows Azure, one of first questions I’ll get is “how do I get started?”

Microsoft is also holding a series of Windows Azure Kick Start events to help you get ramped up on working with Windows Azure.  These will be day long events were you will learn how to build web applications that run in Windows Azure.  You will learn how to sign up for Windows Azure (if you haven’t already) and how to build an app using the tools and techniques you’re already familiar with.  You’ll also get to learn more about Windows Azure web roles, storage, SQL Azure, and other common tasks and scenarios with Windows Azure.

If you don’t already have a Windows Azure account, now is a great time to get one!

Windows Azure Kick Start Schedule

Here is the current schedule for the Windows Azure Kick Start events.  Click the location to get more details and to register.  These are free events!  Act fast before seats are gone!!

Location Date
Edina, MN Mar. 30
Independence, OH Apr. 3
Columbus, OH  (I’ll be here) Apr. 5
Overland Park, KS Apr. 10
Omaha, NE Apr. 12
Mason, OH  (I’ll be here) Apr. 13
Southfield, MI Apr. 19
Houston, TX Apr. 25
Creve Coeur, MO May 1
Downers Grove, IL  (I’ll be here) May 1
Franklin, TN May 2
Chicago, IL May 3
Edina, MN May 8

What To Bring
Windows Azure Kick Starts will be hands-on events (after all, actually using the bits is the best way to learn).  You’ll want to bring your favorite laptop with the required components installed and ready to go.

  • A computer or laptop: Operating Systems Supported: Windows 7 (Ultimate, Professional, and Enterprise Editions); Windows Server 2008; Windows Server 2008 R2; Windows Vista (Ultimate, Business, and Enterprise Editions) with either Service Pack 1 or Service Pack 2
  • Your favorite IDE, like Visual Studio 2010.
  • SQL Server Express (or SQL Server)
  • Install the Windows Azure SDK.
  • Consider bringing a power strip or extension cord – you’ll be using your laptop most of the day.
Follow

Get every new post delivered to your Inbox.

Join 1,035 other followers