From 5738f923a345238a7a85a8cc95bdaefc104b021d Mon Sep 17 00:00:00 2001 From: tombuildsstuff Date: Fri, 22 Mar 2024 08:32:35 +0100 Subject: [PATCH] r/storage_account: defaulting the value for `dns_endpoint_type` This field defaults to `null` if unset in the API response, therefore needs to be explicitly defaulted on our side --- internal/services/storage/storage_account_resource.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/internal/services/storage/storage_account_resource.go b/internal/services/storage/storage_account_resource.go index 88340dfb06f4..fd2f273fcc9c 100644 --- a/internal/services/storage/storage_account_resource.go +++ b/internal/services/storage/storage_account_resource.go @@ -2116,7 +2116,14 @@ func resourceStorageAccountRead(d *pluginsdk.ResourceData, meta interface{}) err publicNetworkAccessEnabled = false } d.Set("public_network_access_enabled", publicNetworkAccessEnabled) - d.Set("dns_endpoint_type", props.DNSEndpointType) + + // DNSEndpointType is null when unconfigured - therefore default this to Standard + dnsEndpointType := storage.DNSEndpointTypeStandard + if props.DNSEndpointType != "" { + // TODO: when this is ported over to `hashicorp/go-azure-sdk` this should be able to become != nil + dnsEndpointType = props.DNSEndpointType + } + d.Set("dns_endpoint_type", dnsEndpointType) if crossTenantReplication := props.AllowCrossTenantReplication; crossTenantReplication != nil { d.Set("cross_tenant_replication_enabled", crossTenantReplication)