Screencast: Creating a Windows Azure WordPress Website

With the new Windows Azure Website feature, announced 07.06.2012 by Scott Gu at Meet Azure, creating a Windows Azure hosted WordPress blog site is now a matter of a few clicks. In this screencast, Andy Cross demonstrates the power of this awesome new Windows Azure feature.

Cloud 2.0+: Windows Azure comes of age …

Wow! I’ve known about this for a while now being a somewhat privileged position and having foresight :-) But really anyone with half a brain could see something special coming. The SDK releases have been good and shown improvement but have been completely mediocre for a long time. So here we are; Microsoft have come along and fulfilled everyone’s expectations and more.

The level of flexibility and capability Microsoft has now built into Azure is phenomenal. Linux/Windows, tooling from anywhere, support for multiple languages, full support for secure hybrid networking, etc. etc. TBH I’m blown away. Amazon is beginning to look like a third rate host. The EC2 weekly feature update describing everything from some simple workflow service to the CTO blowing his nose, we watched and waited and the awesome has finally come in response! (Incidentally Andy and I were headhunted by Amazon who thought we have good EC2 skills and are precisely the kind of people they need!)

Anyway, summer is going to be fun and playful for us. We’ll be posting lots of things on our findings. We’ll be looking at some of the new features in our June 12th meeting. Will be much more personalised because the conference has turned out to be very popular indeed.

To start using the new Preview Features like Virtual Network and Web Sites, request access on the ‘Preview Features’ page under the ‘account’ tab, after you log into your Windows Azure account. Don’t have an account? Sign-up for a free trial here

If you saw Scott’s talk last night let Microsoft know what you thought about it and the new Azure offering at http://www.facebook.com/windowsazure

Azure Fluent Management v 0.4 Released

If you haven’t tried Fluent Management yet try it now! It’s beginning to shape up into quite a powerful library. There are several features which are on cards for the lib between v0.4 and v0.5 most of which revolve around ServiceSystemWatchers and Upgrades but the deployment side of things is done now. We’re also going to update the Service Bus side of things to create multiple service identities with new queue creation. There are a few updates which need to be done to support rdp, ssl enablements across multiple roles instead of a single one as well as an error router which will deal with common web exceptions through a notification interface but on the whole it can do some pretty good things in a very easy to understand manner. We’ve had 187 downloads so hopefully people are using it even though we haven’t had that much feedback.

A common scenario we’re using it for now are as follows:

  • Upload a package to Blob storage
  • Auto-update the configs (.cscfg, .csdef on the fly using business rules)
  • Deploy the package with 3 roles, rdp support and an autgenerated self-signed SSL/RD certificate in the name of the role
  • Create a SQL Azure instance, logins, firewall rules, single database, new admin user and populate the database
  • Add a storage account and return the keys

Of course the beauty around these scenarios is that this is an all or nothing thing so we’ll have a rollback occur if there is a failure at any point. The logging support is okay at the moment to help determine the failure scenarios but it will be much better by the next v0.5 release.

Hope you enjoy using this. Remember this is beta and it was released to try and get feedback from the community so if you have any comments or suggestions let us know.

UPDATE: Added the framework this morning for watching things. It should be really easy now to drop in a watcher to keep an eye on whether someone deletes your database, database server, storage account, hosted service, deployment in staging or production etc. can lead to some very useful scenarios.

The only one I’ve implemented is the one that Michael Collier from Neudesic requested since I think it may be useful for a number of people but when I get time I’ll add the others because it would be nice to have a simple monitoring and supporting reference service off the back of the lib.

Anyway, the code from my test looks like this (it will poll every 15 seconds by default) – if you haven’t got it Azure Fluent Management from nuget:


var man = new ManualResetEvent(false);

var subscriptionManager = new SubscriptionManager(TestConstants.LwaugSubscriptionId); var manager = subscriptionManager.GetRoleStatusChangedWatcher(TestConstants.LwaugServiceName, TestConstants.LwaugRoleName,                  DeploymentSlot.Staging, TestConstants.LwaugThumbprint);

manager.RoleStatusChangeHandler += (status, oldStatus) =>  {

Assert.AreNotEqual(oldStatus, status);

man.Set();

};

man.WaitOne(10000);

Azure Fluent Management v0.3.9.9: New stuff really!!

One thing that recurs with me is that I always make mistakes with my deployments. Then I have to do them again time and time over. I’ve got used to deleting parts of the deployments which generally because we put together bespoke HPC implementations entail several SQL Azure instances, several storage account instances, ACS and Service Bus Queues. Of course that’s on top tens of cores in use by the deployment over three roles. The tedium of doing these things manually drove me to build in a transaction scope for deployments for Fluent Management. v0.4 will make the coming of age of Fluent Management. We’ve just uploaded v0.3.9.9 – yes we’re running out of numbers! This is now downloadable from nuget and can be used in an application preferably not production until we come out of beta but use it at your own risk.

Speaking of beta. We will be coming out beta by the end of June which should hopefully mark v0.5. This beautiful piece of software will be a lot more resilient and we’ll tying down the interface as much as we can going forward but probably won’t standardise it completely until v1. v0.3.9.9 is missing a transaction scope for deployments but includes it for storage and databases. You can couple as many creates as you want for these two types of service and if there is a failure at any point it will rollback. There are several other things that we’ve included as well such as low level control over config and support for plugins to name a couple. Some of the interfaces have changed and we’ve added some more commands which haven’t yet been wired into the fluent API. v 4 will see two things which ae absolutely mandatory, the first is error routing which will enable certain types of WebException to be handled. Polling asynchronously sometimes generates things like 404′s when resources have been deleted and yet the polls continue indefinitely. The other thing is the completion of the transaction scope for deployments. These two things will be like a coming of age for the library. After that it will be down to streamlining the interface. It’s a little too text oriented so we’ll be adding some Actions<> to help out.

To recap here is how you create a Sql Azure database:


var trans1 = sqlAzureManager.AddNewServer(Constants.LocationWestEurope)

.AddCertificateFromStore(TestConstants.ManagementThumbprint)

.AddNewFirewallRule("myofficeip", "10.27.27.253", "10.27.27.254")

.AddNewFirewallRule("anotherip", "10.27.28.11", "10.27.28.254")

.AddNewFirewallRuleForWindowsAzureHostedService()

.AddNewFirewallRuleWithMyIp("myhomeip")

.WithSqlAzureCredentials("ukwaug", "<a href="mailto:M@cc0mputer">M@cc0mputer</a>")

.AddNewDatabase("test")

.AddNewDatabaseAdminUser("ukwaugdb", "<a href="mailto:M@cc0mputer">M@cc0mputer</a>")

.ExecuteScripts(@"C:\Projects\Tech Projects\Elastacloud")

.Go();

And a storage account:


var storage1 = storageManager1.CreateNew("elastadfg1")

.AddCertificateFromStore(TestConstants.ManagementThumbprint)

.WithDescription("my new storage")

.WithLocation(Constants.LocationWestEurope)

.Go();

To couple these together in a transaction we create a ServiceOrchestrator like so:


var orchestrator = new ServiceOrchestrator();

orchestrator.AddDeploymentStep(trans1);

orchestrator.AddDeploymentStep(storage1);

var success = orchestrator.Commit();

Take a simple scenario here where we create our database server and database and boom! Our account limit for storage is breached. In this instance we want to rollback our database because half an application is not that much better than no application.

Anyway, happy trails and all that.

Some updates to fluent management

Hi!

It’s been a while since I’ve done any posts on fluent management. This is taking place in the background and I’m using one of our projects to drive the development of this. I’ve back in a lot of changes and I realise now that if I’m going to get people to use this then I need to set up a wiki!

Recently I had a pingback from Michael Collier from Neudesic who looked at the library and saw that there was nothing in it to pick up state changes in roles. This is the kind of feedback I’d like. I have backed in a notification interface now and have a wrapper called ServiceSystemWatcher which will ping on the state change. As the lib gets more complicated now I’m forced to use config and defaults for many of the properties.

There have been a whole heap of changes which allow config to be injected in prior to deployment and that wrap up .cscfg files so have a nice way to add and remove settings. This proved mandatory for us on the current project we’re undertaking which needs the use config-driven settings for plugins we’re writing at runtime.

One of the key aspects which will be added in the next release is the idea of workflow. I want to be able to add a storage account, do something with it, add a database, add a hosted service, create a service bus namespace and queue etc. in a single transaction and rollback if this fails at any point. I’ve added some context interfaces to the lib which should enable this fairly easily now.  

Someone recently asked whether the lib was published under an open source license. Yes, it is under a GNU lesser license. Currently it’s in beta so we won’t take repsonsibility for it if you use it in production and it fails. We’re going to offer a manadatory support contract going forward if you turnover more than $5m/year. This is mainly because a lot of consultancies that we’ve worked with don’t put anything back in the ecosystem and we don’t want them to profit from our labour and maintenance if they’re not helping the community. This has been our general experience with the user group – not a lot of support from the “partner” “community” – two terms I use very loosely.

Happy trails and an update soon containing new stuff!

startups and Windows Azure

This month we ran a user group session on startups and windows azure. It was new thing for us. Ordinarily we’re chained to technology and developers seem to be most comfortable listening to this. I’ve been told that there is a entrepreneur in all of us but techies more than most seem to be affected by this characteristic. The reason for this is very simple – we have lots of ideas. We work in business areas where we can immediately see the value of a solution for cost-saving, optimisation, greater productivity etc. or simply as a pure enabler of something that hasn’t been possible to date.

I’ve had more startups than most. I seem to be most comfortable outside of the enterprise workplace. In 2001 I had my first taste of a startup after 6 years of contracting around the City. On Board Info Limited took me into the depths of “Hailstorm” or .NET My Services and we were firmly involved with Microsoft. I spoke at the PDC and decided and the autonomy I had was something I wanted to maintain. Unfortunately this all ended for the company prematurely and I went back to contracting for another 5 years. In 2006 I left the City again and decided I would setup up TemporalS with colleagues. It was my first struggle as a startup. We did pretty well but this ended prematurely as well. I set up Clarendon and got several clients and bits of pieces of consultancy under my belt and from 2009 built ShipTracker with my friend Phil in Omnecon, what followed was a myriad of startup ideas each great in their own right but all ahead of their time. Timing is everything with a startup when you don’t have the staying power of a big company.

Elastacloud is my latest venture with Andy Cross. We haven’t talked much about it because virtually everything is a trade secret now. Andy and I have spent a year becoming experts in HPC on Azure and by extension Hadoop. And by experts I don’t mean the single project that most big consultants do (mainly badly in my experience!) but we have spent months and months understanding every line of code through decompilation of our peers products and testing to know exactly how to build our solution. This is what you need to be successful – a complete understanding of what your technology is and does.

In our foray through this jungle we built Fluent Diagnostics and Fluent Management for the community. Both have recent releases which could be very valuable to other developers. The open source libraries themselves are not important but the low level knowledge you have to accumulate to get something to work properly is. This is why we’re happy these to stand in front of crowd and proclaim that we’re experts in azure management, deployment, diagnostics, HPC and Hadoop – because we are – because we took time away from earning and invested in these skills.

I meet a lot of people in this business that think they’re going to be the next Bill Gates with the next biggest idea from experience with their respective line of businesses. I don’t give people who talk without taking the plunge (and leaving their job and getting on with it) any time anymore because they are just talkers. Ideas mean nothing. I’ve found that the only thing that matters is getting on with it, taking the risk and taking each day as it comes. This approach is not for everybody and most people in life turn out to be not cut from this cloth which precludes them from doing nothing other than deluding themselves they’ll be the next biggest thing if they’re not content with their lot. People that build startups will eventually succeed in something because that’s their makeup they just get on with it and don’t waste time on talking.

It’s for this reason that I felt this user group meeting was a resounding success. Our first speaker Bindi Karia has a deep insight into what makes a startup tick. You can tell with Bindi when she speaks that her attachment to Bizspark and helping startups is more than just a job. She’s made links into the industry with VC’s and incubators that she’s fed back into the Bizspark program to nurse Bizspark startups into achieving sales and necessary expansion capital. It really showed me that Bizspark was not just a fire and forget registration process with some free software but a genuinely great program to foster a rich ecosystem of new companies. From everything Bindi was saying we have some great times ahead of us in the UK which looks to be a formidable software hub.

Mark Bower, CTO of CubeSocial, is a prime example of exactly what I wrote about above. Everybody in the audience really delved into Mark’s knowledge to see where the spark comes from in the aptly named Bizspark. I think the one thing that I understood very clearly from Mark is that there was not an area of the business and decision-making process over the last 18 months that he couldn’t recite verbatim. No question either technical or on the business was an effort for him because he has lived the evolution of CubeSocial and has been tied to every decision. A great speaker and startup. I look forward to inviting Mark back to the group in a couple of years when the offers start rolling in on their company and he can give us a true end-to-end perspective on the path to success!

Thanks to both of our speakers for the inspiration they gave to a bunch of geeks.

Update: Automating the generation of service certificates

I missed a key part out of a post I did week ago on automating the generation of service certificates. In order to do this using Bouncy Castle you have to create #Pkcs12 store which is a security wrapper around the private key. It’s worth pointing out that a certificate doesn’t contain a private key. It’s just linked to a private key through a higher level structure. This structure can be a pfx or pkcs#12. The terms can be mutually exclusive for our usage. Anyway, I couldn’t see this code anywhere online so I thought I’d post it to save anyone the trouble of doing this on their own.

// build the key parameter and the certificate entry
var keyEntry = new AsymmetricKeyEntry(privateKey);
var entry = new X509CertificateEntry(certificate);
// build the PKCS#12 store to encapsulate the certificate
var builder = new Pkcs12StoreBuilder();
builder.SetUseDerEncoding(true);
builder.SetCertAlgorithm(PkcsObjectIdentifiers.Sha1WithRsaEncryption);
builder.SetKeyAlgorithm(PkcsObjectIdentifiers.Sha1WithRsaEncryption);
builder.Build();
// create a memorystream to hold the output 
var stream = new MemoryStream(2000);
// create the individual store and set two entries for cert and key
var store = new Pkcs12Store();
store.SetCertificateEntry("Elastacloud Test Certificate", entry);
store.SetKeyEntry("Elastacloud Test Certificate", keyEntry, new[] { entry });
store.Save(stream, userPassword.ToCharArray(), new SecureRandom());

Anyway, once you have this you can use the MemoryStream in .NET with an X509Certificate2.

Hope this helps if anyone was struggling with my former post.

Follow

Get every new post delivered to your Inbox.

Join 110 other followers