I’m having a problem trying to get my pipelines and terraform to work together.
I have two separate azure build pipelines, one for a website and one for the infrastructure whic is terraform code. When it comes to the release I have two artifacts, one from each build.
I use terraform to deploy the infrastructure, my release pipeline was configured to run a plan (without saving it to a file) and then run apply. The last task in my release pipeline has an azure web app deployment task which deploys the website code to the web app.
This works fine except lately I have seen that most pipelines are using the plan as it was supposed to be used by creating a terraform plan and then apply the plan. The problem I have with this is if I update the website code and try to redeploy to the site because there are no changes to the terraform code, the release pipeline will fail saying the plan is stale, so it never gets to the task to update the web site code.
If I create two stages, Infra and Dev how to I set azure devops release pipelines to allow the Dev to update the website provided that the infrastructure exists, and that the artifact has been updated and if I just want the Infrastructure to update and not redeploy the website.
Do I need two separate release pipelines, I don’t to go this way.