diff --git a/azure/services/scalesets/scalesets.go b/azure/services/scalesets/scalesets.go index 25239deb1922..b664a3b4757f 100644 --- a/azure/services/scalesets/scalesets.go +++ b/azure/services/scalesets/scalesets.go @@ -384,7 +384,7 @@ func (s *Service) validateSpec(ctx context.Context) error { } // Validate DiagnosticProfile spec - if spec.DiagnosticsProfile.Boot != nil { + if spec.DiagnosticsProfile != nil && spec.DiagnosticsProfile.Boot != nil { if spec.DiagnosticsProfile.Boot.StorageAccountType == infrav1.UserManagedDiagnosticsStorage { if spec.DiagnosticsProfile.Boot.UserManaged == nil { return azure.WithTerminalError(fmt.Errorf("userManaged must be specified when storageAccountType is '%s'", infrav1.UserManagedDiagnosticsStorage))