diff --git a/azure/services/managedclusters/spec.go b/azure/services/managedclusters/spec.go index 11e77f37252..99f18d449f2 100644 --- a/azure/services/managedclusters/spec.go +++ b/azure/services/managedclusters/spec.go @@ -367,11 +367,14 @@ func (s *ManagedClusterSpec) Parameters(ctx context.Context, existing interface{ if s.APIServerAccessProfile != nil { managedCluster.APIServerAccessProfile = &containerservice.ManagedClusterAPIServerAccessProfile{ - AuthorizedIPRanges: &s.APIServerAccessProfile.AuthorizedIPRanges, EnablePrivateCluster: s.APIServerAccessProfile.EnablePrivateCluster, PrivateDNSZone: s.APIServerAccessProfile.PrivateDNSZone, EnablePrivateClusterPublicFQDN: s.APIServerAccessProfile.EnablePrivateClusterPublicFQDN, } + + if len(s.APIServerAccessProfile.AuthorizedIPRanges) > 0 { + managedCluster.APIServerAccessProfile.AuthorizedIPRanges = &s.APIServerAccessProfile.AuthorizedIPRanges + } } if s.OutboundType != nil {