Atlas

Deploying an ARM template with Atlas

Today we’re going to take a look at using Atlas to deploy an Azure Resource Manager (arm) template. Deploying an arm template is a convenient and powerful way to create or modify multiple resources simultaneously on Azure. In this example we’ll be creating a storage account and blob container, but the same Atlas workflow will work for any template.

Upfront it should be said there are already several different ways you can do this. Azure DevOps has tasks which can deploy an ARM template. There are also Azure CLI shell commands and Azure PowerShell cmdlets which can be used to script this kind of scenario. So why would you choose to use Atlas when these options already exist?

I think that question comes down to what you’re trying to do overall. You may have found yourself in a situation where you are writing a lot of scripting code to which runs multiple azure templates intermixed with updating keyvault secrets and uploading customized blob files – all while using the outputs of one step as the parameters for the next. In those situations Atlas would be good to evaluate. It enables you to process complex JSON in a simple declarative manner as you chain together any number of operations.

Continue reading

Atlas

Introducing Atlas – automate anything

This is a topic I’m really excited about. There’s an OSS project named Atlas which came out of our team that has recently been made public. It’s still under development but has hit a usable state. I’ll probably be doing a number of these posts as it goes along.

So – What is Atlas? It revolves around the idea that there are several tasks and procedures involved in setting up a real production system – from CI/CD pipelines to test/staging/production cloud environments – but there isn’t a very solid way we were aware of to capture that setup in a form that could be source controlled and executed, reliably and repeatably, in an unattended fashion.

Yes, there are many command line tools you can script with Bash and PowerShell. And ARM templates are fantastic. But in a lot of cases it still boils down to creating scripts, checked into source control, but at the end of the day are often run from a developer’s workstation. Weeks or months later when it’s time to update something there’s often a problem of dusting those scripts off, figuring out how they are used.

And occasionally if there’s something small to change you’ll just tweak something manually through a web admin interface. That always makes me feel like something’s not quite right, and I always make a mental note when that happens — one of these days that system’s configuration really needs to be source controlled and automated.

Continue reading

Code

Versioning and publishing NuGet packages automatically using Azure DevOps Pipelines

Say you’re working on some dotnet projects that you would like to share with the world. Or that you would like to share with other teams in your company. Or your project has multiple git repos and the output of one is the input of another. Creating a NuGet package is an excellent way to zip up and redistribute your build output, but there are a few details about versioning to sort out before that process is streamlined and effortless.

For goals – we’d like new NuGet packages as often as every single time a change is merged. It’d also be ideal if every single package had a unique version number that is related to the build which produced it.

Continue reading

Code

Producing a Zip or Tarball when building a .NET Core console app

There’s a .NET Core console app I’m working on that will need to be published a few different ways. The simplest way to share a downloadable app is in a self-contained tarball (.tar.gz extension) or zip file. Eventually package managers like Chocolatey and rpm/deb files will be needed, but a downloadable, versioned archive file is good enough to get started.

First I did a quick search to see who has solved this problem already. :). One solution I found was qmfrederik/dotnet-packaging on GitHub that looked promising.  It seems like early days, currently version 0.1.45, but it’s published on NuGet under the MIT license so that’s good enough to use as a build tool.

All told – it was quick and easy to integrate – though in my case I needed to push the tool a little to get the results I was looking for. In this post I’ll walk you through that.

Continue reading

Code

Using test stubs instead of mocks

Well, I’ll just come right out and say it. I’m not really a fan of mock libraries for unit test code. I think they’re the wrong kind of lazy.

As a programmer being lazy is good. Keep it in the back of your mind as you’re working. Not line-by-line thinking about how many keys you have to hit – more task-by-task thinking about what approach will become less of burden for you or your team in the long run.
Continue reading