How to pack both Web App and Cloud Svc Package in the same time

Hi, I have a project of ASP.NET Web API application running on two environments: Dev and Prod. Dev is hosted in IIS and Prod is hosted in Azure (not a VM but Cloud Service).

Previously Prod was IIS (VM in Azure) too but we moved out from it. And it wasn’t a problem. TeamCity had a step to run Visual Studio against the solution with Run OctoPack set to true.

But now I have two steps in the Octo project process: publish octo package having the application for Dev, and publish octo package having a azure cloud service package for Prod.

I can setup two different TeamCity builds: one to create a package of first kind. And another to create another. But I’d like to avoid this because it makes no sense to me.

How to combine both? Is it possible? I want TeamCity to build, pack and create a release. This will deploy on Dev/IIS. Then manually I will deploy on Prod/Azure.

Hi Alexander,

I don’t think the TC plugin will do this out of the box, but you may be able to run command-lines for Octopack and/or NuGet.exe to create the packages as steps in the TC build. Have you hit problems with any possible options so far?


I was able to run OctoPack (by using plugin or manually) to pack either for IIS or for Azure. But not for both in the same time.

Let’s say we have the following solution structure:
– Project.Web\Project.Web.csproj (Web API)
– Project.Web.Test\Project.Web.Test.csproj (unit tests)
– Project.Azure\Project.Azure.ccproj (references Web)

How can I create an Octopus-compatible package containing both the Web app and an Azure cspkg package so I could create a single release from it and publish it then? Thanks! And appreciate your help.

Hi Alexander,

I think using NuGet.exe and a custom NuSpec file will be the way to go here. Just combining everything into one package, with the same structure/paths, will do it.

Note you’ll end up deploying the .cspkg file to your IIS environments this way I believe - if that matters you can probably clean it up in PostDeploy.ps1.

All experimental though, so YMMV :slight_smile:

Hope this helps,


Hi, Nic. Thanks for your help!
I gave up having Dev as IIS and Prod as Azure. And now use Azure for both.

Thanks for the follow-up, makes sense.