Access package content from Azure Powershell script

We need to deploy certificates which can be found in our package which will be deployed. We are executing a custom Azure powershell scripts now to install the certificates into a cloud service, but how can we access the package content?

It is not available in the working directory of the executed task/script. We have the option ‘Wait for packages to be downloaded before running’ enabled. Is the package extracted in a different location or is the content not available?

Hi Erwin,

Thanks for reaching out. During your package deploy step, the NuGet package gets unpacked into a directory, and then Octopus pushes the content of the package to Azure. This all happens in a temporary directory which cannot be acceded by a step that comes later in your deployment process (in your case the Azure Powershell Script).

What you could do is add a Powershell script in your Nuget deploy step that copies these certificates to a static directory in your server. This script will get executed after the extraction, and it will have access to the contents of your package. Then from your Azure Powershell Script step, you’d just use the certificates from that static directory.

Hope that makes sense. If you need more details about this, let me know!


Hi Dalmiro,

I’ve put it in a pre-deployment script in the ‘Create and deploy cloud service’ step.

Thanks, Erwin

Hello Erwin,

Can you share your pre-deployment script you are using?