I would like to place my ARM templates and package them using VSTS. Send them as a package to Octopus and use that package to trigger Azure resource group deployment. It would be great to see a sample Infrastructure as Code project. I have read this post but unable to find any good starting points in doing the project. Should we just do a class library ? Should we include it in build process? What are tips and tricks having this project in our source code.
Hi there,
Thanks for reaching out! You can totally use that “Azure Resource Group” project type and start with a “Blank Template”.
Like you can see on your Octopus screenshot, all that matters is that the template files are inside the package during the deployment, and that you know the full path of them (inside the package) to put it on the template path field.
Best regards,
Dalmiro
I am very concerned on this one Dalmiro. As the problem is creating packages is a process and adding all the parameters and testing it. What is the best practice here ? Should I just call an azure template API.
Deploy resources to a resource group using a Resource Manager Template API could remove the technical debt.
What do you think ?
Octopus is already using the REST API in Azure so the problem is should I place my code in octopus on in visual studio ? which one is easier to debug ?
Hi,
The practice we recommend you is to:
-
While you are developing the ARM template, simply test it from Visual Studio using the dialog box shown on your last screenshot. No need to complicate things using the Azure API here.
-
Once you commit the changes to your build server, It’ll pack your templates and send it to Octopus. We don’t believe adding an extra test at stage is necessary.
-
Once the package with the templates arrives to your feed, trigger a deployment in Octopus and test the templates in your lower environments.
-
If all the above was successful, you should be good to promote that same package to your production environment.
Hope that helps,
Dalmiro
Dalmiro thanks for the confirmation now I created 3 files.
I.template…holds the most of the data
II.default…empty…to verify deployment via visual studio
III.octo…for octopus variables for all sorts of environments.
Than go to Octopus and define the variables.
That looks perfect!