Are both AzureResourceGroupDeployment and AzureResourceManagerTemplateDeployment same?
- task: AzureResourceManagerTemplateDeployment@3
displayName: 'deploy using AzureResourceManagerTemplateDeployment'
inputs:
azureResourceManagerConnection: sc
subscriptionId: id
resourceGroupName: rg
location: $(location)
csmFile: ${{ parameters.root }}/Infrastructure/data/template.bicep
csmParametersFile: env.json
overrideParameters: '-environmentAbbreviation "env"'
deploymentMode: 'Incremental'
deploymentOutputs: dataoutputs
- task: AzureResourceGroupDeployment@2
displayName: 'deploy using AzureResourceGroupDeployment'
inputs:
azureSubscription: ec
resourceGroupName: rg
csmFile: ${{ parameters.root }}/Infrastructure/data/template.bicep
csmParametersFile: env.json
overrideParameters: '-environmentAbbreviation "env"'
deploymentMode: 'Incremental'
deploymentOutputs: dataoutputs
AzureResourceGroupDeployment, which exists in versions 1 and 2, has been renamed in version 3 to AzureResourceManagerTemplateDeployment. They serve the same purpose, but the latter has some extra capabilities.
The differences I noticed:
deploymentScope
resourceGroup
input is no longer required -- it is required only when deploying a resource group.azureSubscription
to azureResourceManagerConnection
ConnectedServiceName
stayed untouched, though.subscriptionId
subscriptionId
input is required unless deploying to a management group. This is not true -- supplying any falsy value (including not specifying the input at all, resulting in undefined
, which is falsy) triggers its load from the service connection. See the code of the task. This works OK in the YAML pipelines, but cannot be achieved in the classic pipelines, to my knowledge, because of the limitations of the UI. Thus, for classic pipelines, subscriptionId
is actually required.subscriptionId
has an alias subscriptionName
, but don't get fooled: they both accept only the GUID, not the name. This is because they directly insert the value into the URIs used for REST API calls.enableDeploymentPrerequisites
and related, many values of action
By the way, the current version of the task supports not only JSON ARM templates but also Bicep ones. The feature is implemented using Azure CLI in the background, so you should be able to control the version of Bicep via az bicep install --version ...
in a script before the deployment task. Replace ...
with the specific version, e.g. v0.20.4
.
The necessary update to the task is available in DevOps Server 2022. On DevOps Server 2020u1, the task is available in the same major version, too, but I have verified that Bicep templates cause the task to fail while trying to parse them as JSON there.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With