I’m trying to deploy an azure batch service using azure powershell script, want to replace values of a config file in the same step by using the package from octopus server packages feed. At this stage I have added all the variables needed and corresponding values to library. Looking forward for solution.
Thanks for reaching out! The features to replace values of config files are all included on the Deploy a package step. So instead of having everything in a single step, I’d recommend you to have 2 steps:
Hi Dalmiro,
I’ve created a step of “deploy a package” and the replacement of .config works fine. But, I’m actually wondering how to access the package in the powershell script? Can I get a resource (documentation) to find a way?
It would be a great help if I can find some sample script to deploy azure batch as well.
If you want to access to contents of the package that were extracted during the “Deploy a package” step from your Powershell script step, you have 2 alternatives:
Use the variable $OctopusParameters['Octopus.Action[Name of your deploy step].Output.Package.InstallationDirectoryPath'] in your powershell step. Make sure to replace the name of your deployment step on it. I recommend you to use our variables editor to get the right variable, just like I’m doing in the attached GIF
In your “Deploy a package” step, use the Custom Installation Directory feature and send the package content to a fixed location in your machine. This way you’ll always know where the package contents will land, and you can reference that path in your powershell script.
As for a script to deploy Azure Batch, I’m afraid we don’t have such thing at hand.