Using Azure DevOps pipelines for cloud-hosted POP Forums

posted by Jeff | Sunday, January 19, 2020, 11:35 AM | comments: 0

Last week I did my first production deployment of the cloud-hosted version of POP Forums. I'm really excited to offer a version that others can use without setting it up themselves (I'm really excited about the performance, too!). If you've followed me for any length of time, you know that I've been maintaining POP Forums as an open source project since around 2003. The new cloud-hosted version is about 95% the same code, with a few substitutions in the dependency injection container to facilitate multi-tenancy, especially in the asynchronous Azure Functions to make sure that they're acting on behalf of the right tenant. What I'm excited to share is that it's so easy to use the output of the open source project and get those bits into the commercial product.

Any time a commit or merge is made to the master branch of the open source project, a build is triggered in Azure DevOps. Beyond the actual building and running the unit test suite, there are several important steps:

This was all happening even before I decided to light up a hosted version of the app, because I was using it to power the forums on CoasterBuzz. Keep in mind that all of this was free to set up. GitHub is of course free for open source, and when you have a team of two, Azure DevOps is free as well. You can only run one build job at a time, but again, that's not a constraint.

As you may have guessed, the cloud-hosted POP Forums app references the packages on MyGet so it has the very latest bits ahead of the typical releases. The source for the commercial app is stored in a git repository in Azure DevOps, along side of its build pipelines and work items. Pushing to the master branch has a similar outcome, in that the new bits land on a development copy of the app, with configuration for fake payments and everything. It was here that I was able to test the recurring billing and maintenance tasks over the last few months.

The hosted app doesn't take a ton of additional schema to work, but there have been quite a few changes to it in the weeks leading up to release. For those, I used DbUp. I am seriously enamored with this library. It's always made me uncomfortable that most database versioning works on the premise of calculating the diff between old state and new state, and then generating SQL scripts to bridge the gap. If things get into a weird state in any one environment, your CI, QA or staging updates then are not necessarily exactly what will happen in your production deployment, and that could have unintended consequence. DbUp simply executes the exact same scripts at every update, in order, so your lower deployments are in fact a rehearsal of the production deployment.

The shorter story is that the DbUp project is a console app, so I ship that in the artifact, and a PowerShell call (on a Linux build agent!) runs it as part of the deployment pipeline.

Azure DevOps has an artifact-based deployment mechanism, so when I'm satisfied with the build that was deployed to the dev environment, I can specify manually specify that build be deployed to the production deployment. You can set up gated deployments as well, meaning that a user with the right permission has to click a button after a verified deployment to a lower environment, but I don't typically deploy to production as often.

Some other observations:

Overall, I'm really satisfied with the experience of using Azure DevOps for pipelines. Getting the value that you're creating in front of customers fast is easier (and cheaper) than ever. Go visit to see the hosted forums in action!


Post your comment: