Skip to content

Commit

Permalink
Use full path to global dotnet tools when starting SQL and Kusto serv…
Browse files Browse the repository at this point in the history
…ices.
  • Loading branch information
corivera committed Mar 8, 2023
1 parent 00a468b commit 17688d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/Microsoft.DotNet.Interactive.Kql/KqlKernelExtension.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Html;
using Microsoft.DotNet.Interactive.SqlServer;
Expand All @@ -13,11 +14,13 @@ public async Task OnLoadAsync(Kernel kernel)
{
if (kernel is CompositeKernel compositeKernel)
{
var kqlToolName = "MicrosoftKustoServiceLayer";
var kqlToolName = "MicrosoftKustoServiceLayer";
await Utils.CheckAndInstallGlobalToolAsync(kqlToolName, "1.2.0", "Microsoft.SqlServer.KustoServiceLayer.Tool");

var userFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile);
var kqlToolPath = Path.Join(userFolder, ".dotnet", "tools", kqlToolName);
compositeKernel
.AddKernelConnector(new ConnectKqlCommand(kqlToolName));
.AddKernelConnector(new ConnectKqlCommand(kqlToolPath));

KernelInvocationContext.Current?.Display(
new HtmlString(@"<details><summary>Query Microsoft Kusto Server databases.</summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System.IO;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Html;

Expand All @@ -15,8 +16,10 @@ public async Task OnLoadAsync(Kernel kernel)
var sqlToolName = "MicrosoftSqlToolsServiceLayer";
await Utils.CheckAndInstallGlobalToolAsync(sqlToolName, "1.2.0", "Microsoft.SqlServer.SqlToolsServiceLayer.Tool");

var userFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.UserProfile);
var sqlToolPath = Path.Join(userFolder, ".dotnet", "tools", sqlToolName);
compositeKernel
.AddKernelConnector(new ConnectMsSqlCommand(sqlToolName));
.AddKernelConnector(new ConnectMsSqlCommand(sqlToolPath));

compositeKernel
.SubmissionParser
Expand Down

0 comments on commit 17688d2

Please sign in to comment.