Encrypting messages for the Windows Azure Service Bus

A week ago I ran into Alan Smith at the Stockholm Cental Station on the way to the Scandinavian Developer Conference. We were both doing talks about Windows Azure, and we started talking about different Windows Azure features and thoughts. At some point, Alan mentioned that he had heard a few people say that they would like to have their BrokeredMessages encrypted. For some reason this stuck with me, and I decided to give it a try…

My first thought was to enherit the BrokeredMessage class, and introduce encryption like that. Basically pass in an encryption startegy in the constructor, and handle all encryption and decryption inside this subclass. However, about 2 seconds in to my attempt, I realized that the BrokeredMessage class was sealed. An annoying, but somewhat understandable  decision made by Microsoft. Ok, so I couldn’t inherit the class, what can you do then? Well, there is no way to stop me from creating a couple of extension methods…


SDC 2013 Service Bus Talk Demo Code

Yesterday I did a talk about the Widnows Azure Service Bus at the Scandinavian Developer Coneference in Gotheburg. As a part of that, I promised to make all the code I demoed available here on my blog, so here it is. The only thing you need to do to be able to run it is to set up a new Service Bus service in the Azure portal, and the copy the namespace and key into the App.config file available in the “Shared” folder.

The App.config in the “Shared” folder is shared throughout all the projects in the solution, so you only need to change it in that single file. The code will however default to use the “owner” account, which I made pretty clear during the talk that you shouldn’t use. But for a demo like this, it will have to do.

Code: GetOnTheBus - Demo Code.zip (314.08 kb)

Fileuploads through Windows Azure Mobile Services - take 2

So a couple of weeks ago I posted this blog post on how to upload files to blob storage through Mobile Services. In it, I described how one could do a Base64 encoded string upload of the file, and then let the mobile service endpoint convert it and send it to blob storage.

The upsides to this is that the client doesn’t have to know anything about where the files are actually stored, and it doesn’t need to have blob storage specific code. Instead, it can go on happily knowing nothing about Azure except Mobile Services. It also means that you don’t have to distribute the access keys to your storage together with the application.

I did however mention that there was another way, using shared access signatures (SAS). Unfortunately, these have to be generated by some form of service that has knowledge of the storage keys. Something like a Azure compute instance. However, paying for a compute instance just to generate SASes (plural of SAS…?) seems unnecessary, which is why I opted to go with the other solution.


A way to upload files to Windows Azure Mobile Services

Ok, so it is time for another Mobile Services post I believe. My previous posts about the subject has covered the basics as well as authentication when it comes to Mobile Service. But so far, I have only been doing the most simple tasks, such as added and read data from a SQL Database. However, I have mentioned that Mobile Services is supposed to be sort of a layer on top of more of Microsoft’s cloud offering like for example the Service Bus, storage etc. So in this post, I want to demo how you can utilize Mobile Services to upload files to blob storage.

There are probably a lot of different ways to do this, but 2 stood out for me. The one I am about to describe, using public containers, as well as using shared access signatures (SAS). So before going about it “my way”, I am going to explain SAS, and why I don’t like it even though it might be a “cleaner” way to do it.


Authenticating users in Windows Azure Mobile Services

In my previous post about Mobile Services, I talked about how to get started with the service. I also promised that I would follow up with a post about how to authenticate the users, so that is what this post is going to be about.

You currently have 4 different options when it comes to authentication, Microsoft ID (previously Live ID), Facebook, Twitter and Google. They are all 3rd party services, and requires your users to have accounts with one of the providers. Luckily, most users already do. And the neat thing about using 3rd party authentication is that you don’t have to care about handling sensitive data such as usernames and passwords. And leaving that to someone else is making your life a lot less complicated. Not to mention that having Mobile Services handle all of the actual interaction with them makes your life ridiculously simple, as you will see.


Code from the Sweden Azure User Group presentation this week

Ok guys, here is the code that I used during the SWAG presentation this week. I promised to get it on-line before the end of the week, and it seems like that actually happened. Yay!

It includes the client end of it, as well as th escripts needed on the server end. Just remember that you need to configure your accounnt details in App.xaml.cs, sign up for SendGrid if you want to send e-mails, and configure the storage account settings in the images insert script.

Any questions? Just ask!

Code: SWAG Code.zip (76.73 kb)

An Introduction to Windows Azure Mobile Services

At the time of writing, Mobile Services is still in preview, so I believe that you have to “request” access to it. But as soon as you have, you get a new icon in your menu in the Azure management portal, which is all cool. But what is Windows Azure Mobile Services (Mobile Services from now on)?

Well, Mobile Services is basically a “layer” on top of Microsofts cloud offering. Initially, it is a great abstraction for SQL Databases, but the idea, as I have understood it at least, is that it will grow as the amount of Azure services expand, giving the users a simple API to work against. And in doing so, will make us as developers much more productive. But as I said, today, it is basically a very nifty layer on top of SQL Databases. However, that layer is really cool, simple to work with, and supports very rapid development.


Azure Web Sites and WebMatrix is pretty neat!

I guess this post isn’t so much for us “professional” web developers as it is for the hobby developers. Having that said, I can probably think of about a hundred reasons why this would actually be good for me as a pro as well…

Microsoft has currently an Azure feature called Windows Azure Web Sites in preview. It is probably about to be released pretty soon, or at least I hope so. But I don’t want to get into Windows Azure Web Sites as such. What I want to have a quick chat about, is how extremely easy it is to get up and going with a simple website using Azure Web Sites and WebMatrix.

WebMatrix as a tool, is basically a small development environment, bundled with a bunch of things like IIS Express so on. It also has a whole heap of predefined templates, making it really easy to get up and running with a new blog or whatever. It also supports node.js and php development, which is quite neat…


Software Passion Summit – Service Bus talk, code and ppt

Today I presented an introduction to the Azure Service bus here at Software Passion Summit. As a part of that presentation, I promised to upload the code and PPT to the blog, which is what I am doing here. I am pretty sure that the PPT is pretty useless as it contains very little useful information, but I thought I would put it here anyway.

One little note though. To be able to test the code, you have to get your own Service bus namespace as I have removed my details from the code. Reason? Well, I only have limited free usage of the bus, and I really don’t feel like getting a big bill because someone wrote some code that hammered my namespace with requests… I hope that is understandable…


Trying Out Azure Service Bus Relay Load Balancing

As you might have noticed from previous posts, I am somewhat interested in the Azure Service Bus. Why? Well, why not? To be honest, I don’t actually know exactly why, but I feel that it offers something very flexible out of the box, and without to much hassle.

One of the later feature that was added to it is the support for load balancing when using message relaying. (You can read more about message relaying here)

It is pretty cool, and just works… And by just works, I mean it really just works. If you have a service using message relaying today, adding another instance will automatically enable the feature. But remember, the messages are delivered to ONE of the services, not both. So if your service cannot handle that, make sure you change the implementation to make sure that only one instance is running at any time.