Mult-subscription Terraform deployment and Azure DevOps Service Connections

Brass Contributor

While it is understood that Terraform templates can facilitate multi-subscription deployment through the 'alias' concept, as outlined in the documentation here, how does this integration function within the framework of Azure DevOps pipelines?


To illustrate, consider the scenario where you aim to execute the 'terraform apply' command for a template using AZ CLI, deploying resources across multiple subscriptions. AZ CLI requires a service connection object mapped to a specific Azure subscription, leading to deployment failures in other subscriptions, even if the same service connection has access. Is there a better approach to address this issue or what is the recommendation in terms of creating service connections so that such template deployment could work?

2 Replies
Have you posted this question anywhere else and had any responses? I'm looking to solve the exact same problem.

@awdavies90 Haven't posted it anywhere else, also haven't found any solution yet.