Fluent API for setting up Windows Azure ACS

During the last couple of months I’ve been working for the p&p guys at Microsoft, developing the sample application for a new guide around Windows Azure hybrid application integration.

One of the components of the sample solution is a console application that performs all the steps required to have the ACS and Service Bus namespaces properly configured. This application uses a set of wrappers around the ACS Management Service API.

While this is a great step towards simplifying the life of the developer, after I looked at the resulting code I realized that my life could have been simplified even more. That’s why I decided to spend some of my time developing a fluent API for setting up ACS namespaces.

This is how the API looks like:

var namespaceDesc = new AcsNamespaceDescription(
"somenamespace", "ManagementClient", "T+bQtqP21BaCLO/8D1hanRdKJF8ZYEV8t32odxP4pYk=");

var acsNamespace = new AcsNamespace(namespaceDesc);

si => si
.Name("Vandelay Industries")
rp => rp
.AddRuleGroup(rg => rg
.Name("Rule Group for MyCoolWebsite Relying Party")
rule => rule
.Description("Google Passthrough")
rule => rule
.Description("ACS rule")

acsNamespace.SaveChanges(logInfo => Console.WriteLine(logInfo.Message));

You can find more information in the project repository at github.

Oh, and please don’t forget to take a look at the hybrid application integration guide when it becomes available (a draft can be downloaded from here), these guys have been doing an incredible job !

That’s it, I hope this helps :)

One Comment

Leave a Reply