Azure Resource Group Template with Artefacts

Hi

I’m new to Octopus Deploy and I’m trying to set an Azure Resource Group Deployment.

I’ve read this page thoroughly, but i think it is missing some common steps.

To provide some context, I’m using Team City to build and publish a package to Octopus Deploy. The package is a zip of the deployment project’s staged artefacts.

Eg.
a master template
a nested template
a parameters file
Deploy-AzureResourceGroup.ps1 (customised)
an extra PS script referenced by the above
2 zip files (msdeploy packages) produced by other referenced projects

From what I can tell the “Deploy an Azure Resource Group” step will only work for single template deployment projects.

I’m starting to believe that what I need to do is unpack the zip, then stage it myself, and finally run the “Deploy an Azure Resource Group” step. If that is the case, how do i unzip a package?

If there is a better way of doing this, please let me know.

Thanks

Hi Owen,

Thanks for getting in touch! You’re right, the Deploy an Azure Resource Group step is one-named-template-file per step. Calamari uses the ResourceManager C# SDK, passing the template, parameters etc: https://github.com/OctopusDeploy/Calamari/blob/master/source/Calamari.Azure/Deployment/Conventions/DeployAzureResourceGroupConvention.cs#L96

Based on what I understand from your description, you have a few options to move forwards:

  1. Target your master template, and if it is linked appropriately to the linked template(s) the whole tree should execute as expected, just like if you were using the Azure RM PowerShell cmdlets. There is a gotcha we discovered on this thread - the linked templates must be publicly accessible by the Azure RM deployment engine, which isn’t something we can change on your behalf. I’ve updated our documentation to link to this discussion in case it helps anyone else: http://docs.octopusdeploy.com/display/OD/Deploy+using+an+Azure+Resource+Group+Template#DeployusinganAzureResourceGroupTemplate-Usinglinkedtemplates

  2. You could add multiple Deploy an Azure Resource Group steps to your process, all using the same package, but targeting different templates.

When you use a Package for your Deploy an Azure Resource Group, Octopus temporarily extracts the package for you into a working folder, and executes the template from that location.

Hope that helps!
Mike

Hi Michael

Thanks for your response.

I managed to solve this problem in a very simple manner.

I got rid of the Deploy a Resource Group step and added a Run Azure
PowerShell step which runs Deploy-AzureResourceGroup.ps1. That script
manages the upload process – I just needed to pass in the expected
parameters.

Hi Owen,

Great! I’m glad to hear you’re up and running. :slight_smile:

Happy Deployments!
Mike