Skip to content

Commit

Permalink
Merge pull request #24072 from teowa/fix_tempdp_update_specid
Browse files Browse the repository at this point in the history
`azurerm_tenant_template_deployment`, `azurerm_management_group_template_deployment`, `azurerm_subscription_template_deployment`, `azurerm_resource_group_template_deployment` - fix updating `template_spec_version_id`
  • Loading branch information
tombuildsstuff authored Dec 12, 2023
2 parents 9dac883 + ae8904f commit 78595e5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,10 @@ func managementGroupTemplateDeploymentResourceUpdate(d *pluginsdk.ResourceData,
deployment.Properties.TemplateLink = &resources.TemplateLink{
ID: utils.String(d.Get("template_spec_version_id").(string)),
}

if d.Get("template_spec_version_id").(string) != "" {
deployment.Properties.Template = nil
}
}

if d.HasChange("tags") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,10 @@ func resourceGroupTemplateDeploymentResourceUpdate(d *pluginsdk.ResourceData, me
deployment.Properties.TemplateLink = &resources.TemplateLink{
ID: utils.String(d.Get("template_spec_version_id").(string)),
}

if d.Get("template_spec_version_id").(string) != "" {
deployment.Properties.Template = nil
}
}

if d.HasChange("tags") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,10 @@ func subscriptionTemplateDeploymentResourceUpdate(d *pluginsdk.ResourceData, met
deployment.Properties.TemplateLink = &resources.TemplateLink{
ID: utils.String(d.Get("template_spec_version_id").(string)),
}

if d.Get("template_spec_version_id").(string) != "" {
deployment.Properties.Template = nil
}
}

if d.HasChange("tags") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,10 @@ func tenantTemplateDeploymentResourceUpdate(d *pluginsdk.ResourceData, meta inte
deployment.Properties.TemplateLink = &resources.TemplateLink{
ID: utils.String(d.Get("template_spec_version_id").(string)),
}

if d.Get("template_spec_version_id").(string) != "" {
deployment.Properties.Template = nil
}
}

if d.HasChange("tags") {
Expand Down

0 comments on commit 78595e5

Please sign in to comment.