Is there a way to change override the package name when uploading to azure blob storage?

Hi,

We have a situation where we have 1 nuget package that pulls together other packages, which is then deployed as a cloud service. The 1 aggregating package is hardly ever rebuilt since the other sites it references are pulled in and updated automatically. Therefore the version number on this nuget package is relatively constant.

This causes it to be uploaded to a very similar file path in Azure blob storage on every deployment. See the example below:
https://$storageAccount$/$packageName$.1.0.0.137149_$hash$.cspkg

In this example, the “1.0.0.137149” is the version number of our aggregating nuget package. Is there a way I can change that version number so that it uses the version number of the octopus deploy and not the nuget package?

Thanks for any help you can offer,

Additionally, is there a way to change the deployment label for the cloud service? Right now it’s setting it to “$OctopusStepName$ $NugetPackageVersion$”

Hi Josh,

Thanks for getting in touch. We’ve built the Azure Cloud Service deployment to suit most needs based on what we’ve seen to be common conventions, like building and deploying a new package each time instead of the same version of a package. We haven’t provided the ability to configure some of the more “hidden” aspects of the deployment that most customers don’t need to worry about.

As I’ve looked over your requirements I can tell you there is no built-in way to change the filename, nor the deployment label. Here is the code in Calamari which shows how the file name and deployment label are calculated:

Upload Package

Deployment Label

DeployAzureCloudService.ps1

I think the best solution for you right now would be to build your own Calamari so you can have fine-grained control over your Cloud Service deployment process. This is a core concept supported by Octopus 3.x, you can:

  • Clone the open-source Calamari git repository
  • Make your own customisations to the deployment process
  • Build your own Calamari nuget packages
  • Instruct Octopus Server to use the latest Calamari packages located in a folder on the Octopus Server: Octopus.exe configure --customBundledPackageDirectory="C:\Octopus\CustomCalamari"

Please don’t hesitate to get back in touch.

I hope that helps!
Mike

Is this something that’s on the backlog for future versions? I’d rather not build my own Calamari, that sounds like a maintenance nightmare when it comes to enhancements.

I’ve forked the Calamari and will be testing my changes over the next few days. I’ll make a pull request when it’s done.

Hi Josh,

Thanks for getting back to me. Good hunting making your customizations - I’ll keep my eye out for the PR.

In the meantime don’t hesitate to reach out!
Mike

Here’s the pull request: