Octopus Deploy – Introducing Hydra

Excited about the release of Octopus 3.0? We are!

Ready to download the MSI and double-click?

Well not so fast!

Unlike the previous upgrades, Octopus 3.0 is a Tentacle First upgrade. That means you’ll need to upgrade all your Tentacles before you upgrade your Server.

But why?

As you may have read in some previous blog posts, we’ve changed the way the Server and the Tentacles communicate. The end result is faster deployments across a broader range of Deployment Targets.

But it also means that an Octopus 3.0 Server can’t communicate with 2.6 Tentacles and vice versa.

Unfortunately, that means we can’t do an automatic update like we have in the past. If we did, we couldn’t check the result because a successful update means the tentacle is now speaking another language.

So… I have to run an MSI on all my Tentacle machines before upgrading?


We recommend doing it before you upgrade so if there are any problems, you can reinstall the 2.6 Tentacle and you still have a Server you can use.

But I have hundreds of Tentacles!

Never fear! We built a tool to help. It’s called Hydra and we built it just in case the thought of RDP-ing into all of your servers to click Next, Next, Next through an MSI makes you nauseous.

Hydra (named for the cutting-off-and-growing-back-its-heads thing and our love of sea creatures) is a package that you can deploy to your Tentacles via Octopus which will do three main things:

  1. Stop any Tentacle services that are running
  2. Run the MSI to upgrade them to Octopus 3.0
  3. Start any Tentacle services that were running when we started

We also wrap all this up in a scheduled task so it runs after your upgrade deployment finishes.

Think of it like sending a poison pill to your target machines. After one minute, it kills the Tentacle and a new one grows back. Simple.

How do I do it?

There are two parts to Hydra. The Hydra nuget package itself, and a step template that knows what to do with it.

We’ve written detailed instructions for your 2.6 -> 3.0 upgrade in our documentation pages. It has links to the resources you’ll need as well as a walkthrough with plenty of screenshots.

We strongly recommend you use new hardware (or virtual hardware) and install a fresh 3.0 instance. That way you’ll have a 2.6 Server alongside a 3.0 Server so at least one of them should be able to communicate with your Tentacles. You should see the Health Checks start to fail from your 2.6 Server, and see them light up on your 3.0 Server.

As always, support is here to help, but make sure you read through the documentation before starting to avoid any issues!

Good luck, and happy deployments!

I’m an Octopus

After 4 great years with SSW, I recently moved on and joined Octopus Deploy.OctopusDeployLogo

I’ve loved the product since I started using it about a year ago, and I quickly became it’s primary champion at SSW. I helped put it into a few clients’ pipelines and I even have a couple of videos about it on SSW TV.

If you haven’t had the pleasure of working with Octopus Deploy, you’re missing out – I joined not because of a bigger paycheck (spoiler: it’s not bigger), but because I think it’s a tool that delivers real value to people delivering software. I wanted to be a part of it and contribute to its success.

Octopus Deploy is a deployment automation tool for .NET developers. It helps you deploy everything your application needs to machines or cloud services in multiple environments in a safe, repeatable way. For the less technically inclined, think of it as a tool that helps programmers get new versions of their software to you.

One thing I’ve learned over the past few months is that Octopus Deploy can be used poorly, and it can be used really well. When a team uses it poorly, it’s not always their fault (well, sometimes it is). The documentation around the product is pretty solid, but as is often the case with documentation, it tends to focus on how a feature works rather than when, why, and how you should use it.

A large part of my role at Octopus Deploy will be helping teams use the product really well. Not just in terms of picking the right features and knowing what’s available, but also improving the deployability of their software. It’s something we focused on a fair bit at SSW. As a developer, everything that happens after you’ve used your design, architecture, and coding skills to create a product can be automated. If you’re on the infrastructure side, your skills are in the physical and network architecture and knowing what resources are needed and when. For both, the busywork of copying assets and changing configuration files every time there’s an update is really a waste of your precious time!

I encourage you to give Octopus Deploy a try. At the very least, it can help you pinpoint areas of your software that are difficult deliver in a repeatable way. Feel free to contact me if you have questions or want to chat about Octopus or devops in general!

I’m really looking forward to what’s ahead. Oh, and if you want to join me, we’re hiring!

Calling Stored Procedures from Entity Framework 6 Code First

Just a quick solution to something I was banging my head against for a while.

If you use the EDMX/Database First way of creating your DbContext, you can import Stored Procedures to your context. The result is something like this:

public virtual ObjectResult<Customer_LoadStatus_Result> Customer_LoadStatus(Nullable<int> customerId)
    var customerIdParameter = customerId.HasValue ?
        new ObjectParameter("CustomerId", customerId) :
        new ObjectParameter("CustomerId", typeof(int));
    return ((IObjectContextAdapter)this).ObjectContext.ExecuteFunction<Customer_LoadStatus_Result>("Customer_LoadStatus", customerIdParameter);

If you try to copy this method to your Code First context, you’re likely to get an error saying something like, “The FunctionImport ‘Customer_LoadStatus’ could not be found in the container ‘CustomerDbContext’.” There’s probably a way to register it in the ModelBuilder, but 15min of web searches came up with nothing (maybe my Google-Fu is weak?).

Long story short, it seems you can’t just copy this to your context if you’re using Code First. Instead, do this:

public virtual Customer_LoadStatus_Result Customer_LoadStatus(int? customerId)
    var customerIdParameter = customerId.HasValue ?
        new SqlParameter("CustomerId", customerId) :
        new SqlParameter("CustomerId", typeof(int));

    return this.Database.SqlQuery<Customer_LoadStatus_Result>("Customer_LoadStatus @customerId",

As a bonus, in my example I’m just returning the object I expect rather than the wrapped one you’d get from the generated code.

.NET, TFS and VS announcements at Connect();

Earlier today, at the Microsoft Connect(); event, there were a bunch of announcements around the .NET platform, Visual Studio 2015, and Visual Studio Online.

There are far too many to list every one, so here are a few of my highlights.

Open Sourcing the core .NET stack

This is huge.

Microsoft has jumped into the Open Source community in a big way recently, particularly with ASP.NET, but now they’ve announced they’re open sourcing the entire .NET stack!

Well, not the entire stack, just the core stuff. This has been met with some scepticism, however I think it’s the right thing to do. Think about the codebase you’re working on right now. If you were told to open source it, would you want to do a bit of work to it first? Maybe refactor a whole lot of stuff?

I’m only guessing, but I would think there’s a bit of work to do before the entire stack is “open-sourceable”. And I believe they’ll do it as quickly as they can.

You can see it all now at https://github.com/Microsoft/dotnet.

Release Management Service for Visual Studio Online

You may have heard me talk about Release Management at Tech Ed NZ this year. Well, what was previously an on-premises product only is now available in Visual Studio Online as well.

Release Management Service for VSO

Release Management Service for VSO

It’s a relatively limited offering right now, only allowing releases to Azure, but rest assured the new features will start coming thick and fast.

Read more about it on Brian Harry’s blog.

A new Community edition of Visual Studio

No, I’m not talking about Visual Studio Express. This is a much bigger product than that. Instead of thinking “Express with some extra features”, think “Professional with some tiny things taken out”. The biggest difference is the fact that you can install plugins. Yep, in the community edition, you can now run Resharper and Web Essentials.

This is awesome news for startups and open source projects.

Download it now at http://www.visualstudio.com/en-gb/products/visual-studio-community-vs.

ASP.NET 5 and MVC 6

Yep, the .Net web-dev universe is rebooting again. Well, not really, but there are some big changes. The biggest and most important change for me is that MVC and Web API are now in the same pipeline. That means no separate assemblies for all your attributes, routing, helpers, etc.

Other big changes include no-compile updates (yes, no need to recompile while you’re developing – even for .cs files), Nuget for absolutely everything (including the .NET runtime!), and support for cross-platform hosting (no IIS or even Windows!).

Read more about the changes in Xinyang Qiu’s blog post.

Support for debugging Lambda Expression in Visual Studio

This is one of those “little things” that had a big effect on day-to-day work. In short, you can now write lambda expressions in all your debug windows.

Lambda expression in the Watch window

Lambda expression in the Watch window

Read more on Patrick Nelson’s blog post.

One new book and two new videos

For those of you who follow me on Twitter, you’d be aware of my recent activities.

Professional Team Foundation Server 2013

The achievement I’m most excited and proud about is that I’ve published a book – Professional Team Foundation Server 2013!

Professional Team Foundation Server 2013

Professional Team Foundation Server 2013

As the saying goes, it’s available at all good bookstores, but to help out here are some links to the book on Wiley’s websiteAmazon, The Book Depository, and Booktopia. Of course if you’d prefer an electronic copy, there’s always iTunes, Google Play, and the Kindle store!

Tech Ed New Zealand

I also recently presented a couple of sessions at Tech Ed New Zealand.

My first session introduced the awesome new Release Management for Visual Studio tool. It gives you a great way to deploy your applications in a repeatable and predictable way. It’s great for organisations that care about stable releases, governance, and deploying their applications quickly.

My second (and favourite) session was about the many extensibility points available to you in Team Foundation Server. This is a topic I became interested in while writing the Extensibility chapter in the book. I was amazed by how many opportunities there were to extend and customize Team Foundation Server. With the release of the REST APIs early this year, those opportunities grew even further. I’m really excited about the possibilities this opens up!

If you’re interested in integrating Team Foundation Server or Visual Studio Online with your own applications, this session is definitely worth a watch.

Getting Git Commits with the VSO REST API

(Guest post by Drew Robson – our SSW TimePRO product lead)

​​​​​​​​With Visual Studio Online now supporting Git, ​​​​more developers are changing their source control repositories. What happens if an application you developed relies on the TFS Client Object Model to get information out of source control (e.g. changeset comments) and the developers start using Git?​

That’s where the new Visual Studio Online REST APIs come in. You can get a list of commits from your VSO Git repository with only a HTTP request.​ Let’s look at how to do this with C# and Visual Studio 2013. The below example gets all the commits for a particular user.

(This is based on Get started with the REST APIs and VSO Integration Reference)

You will need a method to execute the HTTP GET request.

private async Task<string> Get(HttpClient client, string url)
    var result = string.Empty;

    using (HttpResponseMessage response = client.GetAsync(url).Result)
        result = await response.Content.ReadAsStringAsync();

    return result;

And a method to set up the authentication and urls.

public async Task<IEnumerable<Commit>> GetGitCommits(string username, DateTime from, DateTime to)
    var result = new List<Commit>();

    using (var client = new HttpClient())
        if(_settings.AuthType == AuthType.Basic.ToString())
            var version = "api-version=1.0-preview.1";

            // Set up auth
            var parameters = Convert.ToBase64String(ASCIIEncoding.ASCII.GetBytes(string.Format("{0}:{1}", _settings.Username, _settings.Password)));
            client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", parameters);

            // Get Git repositories
            var url = string.Format("{0}/{1}/_apis/git/repositories?",
            var response = await Get(client, url + version);
            var repositories = JsonConvert.DeserializeObject<RepositoryCollection<Repository>>(response);

            // Get Git commits
            foreach (var r in repositories.Value)
                url = string.Format("{0}/{1}/_apis/git/{2}/repositories/{2}/commits?committer={3}&fromdate={4}&todate={5}&",

                response = await Get(client, url + version);
                var collection = JsonConvert.DeserializeObject<CommitCollection<Commit>>(response);
                if (collection != null
                    && collection.count > 0)

    return result;

What about the classes RepositoryCollection, Repository, CommitCollection and Commit? These are the class representations of the JSON responses. See the SSW Rule Do you know how to easily get classes from a JSON response? to generate them.

Release Management for the Enterprise (with videos!)

Team Foundation Server has been a great tool for managing your development projects for some time. But while it’s been a great source control and work item management tool, it’s always lacked a bit in terms of managing the deployment cycle of your application.

Too often, deployments rely on Frank from the Infrastructure team studiously following a word document to make sure every step has been checked off. It’s error-prone to say the least.

There are two great tools that are changing that. Both give you highly repeatable and automated deployments, reducing the risk of an outage.

The first is a new tool from Microsoft called Release Management for Visual Studio 2013. Yes, that’s a long name. The product has been around for a while under a different name (InRelease), but was recently acquired by Microsoft to improve this area of their offering. It’s closely-integrated with Team Foundation Server and gives you the ability to control your releases and know exactly who did what. It’s great for enterprises.

If you’re lucky enough to be at Tech Ed New Zealand this year, I’ll be speaking about it on Wednesday afternoon. I’m yet to hear about Tech Ed Australia, but I’ll let you know when I know :).

The other tool is one I’ve been using for a while called Octopus Deploy. It gives many of the same benefits as Release Management, but isn’t as closely tied to the Microsoft infrastructure. That means you can use it to deploy nearly anything from nearly any source (not just TFS).

I’ve spoken about Octopus Deploy a couple of times in the past few months, so rather than go through the features on this blog, I’ll just show you the videos.

For a quick introduction, watch my conversation with another SSW developer and MVP, Danijel Malik, about Octopus Deploy:

I also presented at DDD Melbourne recently about Octopus Deploy, and why it’s a great tool to stop you “deploying like an idiot”:

I hope you enjoy the videos, and I’m looking forward to talking about the other great tool, Release Management, at Tech Ed NZ.

TFS Maintenance – cleaning up after yourself

It’s really important to have a TFS Master as part of your team.  As the TFS Master at SSW (amongst other things), I’m constantly looking out for best practices, improvements we can make, and problems we can avoid. In particular, we like to keep our Team Foundation Server nice and clean, making sure the devs have no abandoned changes or workspaces.

Periodically, I’ll send out an email to anyone who has files they haven’t checked in for a while as per our “Do you have a report to see who has not checked in?” rule. What I often hear back is that the files have been checked out in a workspace that no longer exists. In other words the files were edited, not checked in, then the computer was rebuilt or replaced.

So what can you do?

The best option is to remove any workspaces you no longer have access to. There are two ways to do this:

  1. Use the awesome Team Foundation Sidekicks product
  2. Use the Workspaces tool in Visual Studio


Option 1 – Using Team Foundation Sidekicks

  1. Download Team Foundation Sidekicks 5.0
  2. Connect to your Team Foundation Server
  3. Use the Workspaces Sidekick to find and remove any workspaces you no longer use

Using Team Foundation Sidekicks to remove Workspaces

Using Team Foundation Sidekicks to remove Workspaces


Option 2 – Using the Workspaces tool in Visual Studio

  1. In Visual Studio, go to File | Source Control | Advanced | Workspaces…
  2. Check the Show remote workspaces checkbox to see workspaces on every computer
  3. Select and click Remove for the workspaces you no longer use

Opening TFS Workspaces in Visual Studio

Opening TFS Workspaces in Visual Studio

The Workspaces Dialog in Visual Studio

The Workspaces Dialog in Visual Studio


Clearing out these abandoned workspaces will let the TFS server know you aren’t using those workspaces any more. Best of all, your TFS Master will be less likely to send out angry emails!

I’ve been awarded a Microsoft MVP in Visual Studio ALM!

Microsoft MVP logoA few days ago I received an email from Microsoft informing me that I’d been awarded an MVP for Visual Studio ALM.

While my participation in the dev community has been purely for the enjoyment and love of what I do, this has been a career goal of mine and something I’ve been working towards for a few years.  I’m super excited and humbled to have been awarded alongside many of the best guys and girls in the field.

For those unfamiliar with what this award means, the best information can be found at http://mvp.microsoft.com, but here’s a quick quote from the site:

The Microsoft Most Valuable Professional (MVP) Award is our way of saying thank you to exceptional, independent community leaders who share their passion, technical expertise, and real-world knowledge of Microsoft products with others. … Today, there are more than 4,000 MVPs worldwide. They represent more than 90 countries, speak over 40 languages, answer more than 10 million questions a year, and are awarded in almost 90 Microsoft technologies—reflecting the breadth of our products and our global communities.

Thanks must go to the awesome guys and girls I work with at SSW for their support, as well as to the many enthusiastic developers I interact with as an organiser of the Brisbane .Net User Group and DDD Brisbane.

Here’s to a great 2014!


How to change a Work Item’s type in Team Foundation Server

One of the most frequent questions I get asked when training a new team in TFS is how to change a Work Item’s type.  If the team is coming from Jira, I can almost guarantee I’ll get asked that question.

While you can’t change the type of an existing Work Item with Team Foundation Server 2012 and 2013, there’s a simple workaround that achieves the same result.

How to change a Work Item’s type

First, open the Work Item in Team Web Access and click this button: Copy Work Item Button

The Copy Work Item button in Team Web Access

The Copy Work Item button in Team Web Access

In the dialog, choose the Work Item type you want to change it to, and click OK.

Choose the Work Item Type

Choose the Work Item Type

Finally, go back to the original Work Item and change its state to an appropriate “closed” state. If you really want to remove all traces of the original work item, you can use the command line “witadmin destroywi” tool. I don’t recommend this!

You can perform the same tasks from within Visual Studio by right-clicking on the work item and choosing “Create Copy of Work Item”.

Visual Studio - Copy Work Item

Visual Studio – Copy Work Item

It’s a deep copy

If you look at the new Work Item, you’ll see that all of the detail and links have been copied across where there’s a corresponding field in the new type.

All related Work Items are linked, and even links to Changesets that applied to the original Work Item are copied.

Deep Copy of Work Items

Deep Copy of Work Items

This tip can be really useful for Product Owners who like to create “bugs” that don’t fit your bug definition and are really new requirements.

So there you have it, a way of “changing” the type of a Work Item that should please those Jira converts!

Next Page »