Azure DevOps Pipelines: Separating Your Build and Deployment Packaging

Jay Allen
2 min readMay 5, 2021

It’s just not that well documented, Bob.

Picture: Fast&Slow / PIXTA(ピクスタ)

Recently, I shifted a project of mine onto my company’s main build pipeline system on Azure DevOps. Doing so had a ton of benefits. The centralized build system runs tons of security checks for free. It’ll even sign your code for you.

That last part, however, sent me into something of a mad scramble. My app consists primarily of several Azure Functions written in C# using Visual Studio. And up until this point, I was building them and packaging them in a single MSBuild command-line argument:

- task: VSBuild@1inputs:solution: ‘$(solution)’msbuildArgs: ‘/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:PackageLocation=”$(build.artifactstagingdirectory)\\”’

This worked fine at the time. The parameter /p:WebPublishmethod=Package did the magic of packaging my web publish packages up into a ZIP files.

Problem is, the pipeline’s code signing was a step that took place after my build was complete. I needed to separate out the building and the packaging of my code.

Break Your Package Task Apart

--

--