From ca63a091f84804edb8351f710f2f8dacc059f5fd Mon Sep 17 00:00:00 2001 From: Zhenhua Hu Date: Fri, 16 Jun 2023 06:03:44 +0800 Subject: [PATCH] `azurerm_resource_deployment_script_*` - fix issue where `identity` wasn't specified but was being sent as `TypeNone` to the api (#22165) --- .../resource/resource_deployment_script_azure_cli_resource.go | 4 +++- .../resource_deployment_script_azure_power_shell_resource.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/services/resource/resource_deployment_script_azure_cli_resource.go b/internal/services/resource/resource_deployment_script_azure_cli_resource.go index 20006a24c009..76fd329a33a3 100644 --- a/internal/services/resource/resource_deployment_script_azure_cli_resource.go +++ b/internal/services/resource/resource_deployment_script_azure_cli_resource.go @@ -79,7 +79,9 @@ func (r ResourceDeploymentScriptAzureCliResource) Create() sdk.ResourceFunc { return err } - properties.Identity = identityValue + if identityValue != nil && identityValue.Type != identity.TypeNone { + properties.Identity = identityValue + } if model.Arguments != "" { properties.Properties.Arguments = &model.Arguments diff --git a/internal/services/resource/resource_deployment_script_azure_power_shell_resource.go b/internal/services/resource/resource_deployment_script_azure_power_shell_resource.go index 05a14d4358b8..41cbb2d37cb2 100644 --- a/internal/services/resource/resource_deployment_script_azure_power_shell_resource.go +++ b/internal/services/resource/resource_deployment_script_azure_power_shell_resource.go @@ -79,7 +79,9 @@ func (r ResourceDeploymentScriptAzurePowerShellResource) Create() sdk.ResourceFu return err } - properties.Identity = identityValue + if identityValue != nil && identityValue.Type != identity.TypeNone { + properties.Identity = identityValue + } if model.Arguments != "" { properties.Properties.Arguments = &model.Arguments