diff --git a/internal/services/resource/management_group_template_deployment_resource.go b/internal/services/resource/management_group_template_deployment_resource.go index 01efe96562e8..1388895880e5 100644 --- a/internal/services/resource/management_group_template_deployment_resource.go +++ b/internal/services/resource/management_group_template_deployment_resource.go @@ -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") { diff --git a/internal/services/resource/resource_group_template_deployment_resource.go b/internal/services/resource/resource_group_template_deployment_resource.go index 8e934b660523..676340f6c561 100644 --- a/internal/services/resource/resource_group_template_deployment_resource.go +++ b/internal/services/resource/resource_group_template_deployment_resource.go @@ -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") { diff --git a/internal/services/resource/subscription_template_deployment_resource.go b/internal/services/resource/subscription_template_deployment_resource.go index 9fbc57746831..1a51da65246c 100644 --- a/internal/services/resource/subscription_template_deployment_resource.go +++ b/internal/services/resource/subscription_template_deployment_resource.go @@ -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") { diff --git a/internal/services/resource/tenant_template_deployment_resource.go b/internal/services/resource/tenant_template_deployment_resource.go index 646bdaa19207..7d7f18fe32c3 100644 --- a/internal/services/resource/tenant_template_deployment_resource.go +++ b/internal/services/resource/tenant_template_deployment_resource.go @@ -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") {