I want to deploy an ARM template on a management group via an Azure Devops pipeline task. I created a task based on the AzureResourceManagerTemplateDeployment@3 task. Below is my task in the pipeline YAML file.
- task: AzureResourceManagerTemplateDeployment@3
inputs:
deploymentScope: 'Management Group'
azureResourceManagerConnection: 'My ARM Connection Name'
location: 'East US'
templateLocation: 'Linked artifact'
csmFile: 'template.bicep'
deploymentMode: 'Validation'
When I run the pipeline I get the error ##[error]Error: Task failed while initializing. Error: Endpoint data parameter ${ID} not present: ManagementGroupId
The AzureResourceManagerTemplateDeployment@3 task supports subscription, resource group, and management group deployment scope. Subscription level deployments have a parameter to provide the subscription ID, and resource group level deployments have a parameter for the resource group name. Management group level deployments don’t seem to have any way to specify which management group to deploy the template.
I can deploy the template to a management group via the az cli by specifying the management group ID. Is there some way to make the pipeline task work or is this just a bug in the pipeline task?