diff --git a/internal/services/containers/kubernetes_cluster_resource.go b/internal/services/containers/kubernetes_cluster_resource.go index 2de814428515..5b57b3a5e201 100644 --- a/internal/services/containers/kubernetes_cluster_resource.go +++ b/internal/services/containers/kubernetes_cluster_resource.go @@ -1907,7 +1907,12 @@ func resourceKubernetesClusterRead(d *pluginsdk.ResourceData, meta interface{}) d.Set("node_resource_group", props.NodeResourceGroup) d.Set("enable_pod_security_policy", props.EnablePodSecurityPolicy) d.Set("local_account_disabled", props.DisableLocalAccounts) - d.Set("public_network_access_enabled", *props.PublicNetworkAccess != managedclusters.PublicNetworkAccessDisabled) + + publicNetworkAccess := managedclusters.PublicNetworkAccessEnabled + if props.PublicNetworkAccess != nil { + publicNetworkAccess = *props.PublicNetworkAccess + } + d.Set("public_network_access_enabled", publicNetworkAccess != managedclusters.PublicNetworkAccessDisabled) upgradeChannel := "" if profile := props.AutoUpgradeProfile; profile != nil && *profile.UpgradeChannel != managedclusters.UpgradeChannelNone {