diff --git a/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs b/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs
index 5e28a7a8a016..845adadf87b5 100644
--- a/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs
+++ b/dotnet/src/Connectors/Connectors.Memory.Kusto/KustoMemoryStore.cs
@@ -104,7 +104,7 @@ public async IAsyncEnumerable<MemoryRecord> GetBatchAsync(
         bool withEmbeddings = false,
         [EnumeratorCancellation] CancellationToken cancellationToken = default)
     {
-        var inClauseValue = string.Join(",", keys.Select(k => $"'{k}'"));
+        var inClauseValue = string.Join(",", keys.Select(k => $"'{k.Replace("'", "''")}'"));
         var query = $"{this.GetBaseQuery(collectionName)} " +
             $"| where Key in ({inClauseValue}) " +
             "| project " +