0

We're moving from a .NET monolithic application to a microservices architecture hosted on Azure.

Until now, we only had one build definition on TFS and a release definition for each environment (development, staging and production). All the Azure resources needed to deploy to each environment were created manually. We want to automate this part.

How's the recommended approach to handle new resources setup? Do you just put steps in the release pipeline that will create the needed resources when they don't exist? Or do you have a separate pipeline that's solely responsible for creating all the resources for a new environment?

1

You can use Terraform for azure to handle the dynamic creation of azure resources in the release pipeline in Azure DevOps. Terraform maintains a state file for all the created resources after a run.

If the script is run multiple times, it ignores already created resources unless there are any properties updated and created new resources.

FYI, follow below link for a quick example Terraform example

| improve this answer | |
  • Nice. I wasn't aware of the existence of it. I have a couple of questions though. 1) Would you add this steps in the same deploy pipeline or in a separate one? 2) This seems to work for VMs and that kind some "standard" resources? What about resources that are very specific to Azure? Does Terraform support all of them? – emzero Mar 3 at 20:22
  • 1
    @emzero, 1. you can actually put it as the first step in your release pipeline. You can put your terraform script file in your source control and add a terraform step in pipeline. 2. There is no such limitation on creating resources using terraform, its an alternative to ARM templates, you can create all kinds of resources. Below link has examples for all kinds of resources terraform.io/docs/providers/azurerm/index.html – Raju Dasupally Mar 4 at 1:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.