How can I load and run the Kusto query in the Powershell runbook using the Kusto client Nuget package? On a local machine I can download the package as a Zip file and then extract in then load the types in Powershell as
[System.Reflection.Assembly]::LoadFrom($assemblyPath) | Out-Null
How can i achieve it in Runbook.
How can I load and run the Kusto query in the Powershell runbook using the Kusto client Nuget package? On a local machine I can download the package as a Zip file and then extract in then load the types in Powershell as
[System.Reflection.Assembly]::LoadFrom($assemblyPath) | Out-Null
How can i achieve it in Runbook.
Share Improve this question edited Mar 31 at 19:03 Hilory 2,1417 gold badges14 silver badges30 bronze badges asked Mar 31 at 17:46 user9297554user9297554 4811 gold badge11 silver badges27 bronze badges 1- Have you checked this blog! @user9297554 – Jahnavi Commented Apr 1 at 12:36
1 Answer
Reset to default 0Firstly, it is not directly possible to use the Kusto client NuGet package in automation runbooks. You need to have KustoPowerShell
module as it is a wrapper module based on .NET Microsoft.Azure.Kusto.Tools
Package.
Once it is imported with the required version, you can use Invoke-Kusto-Query
function to run the Kusto queries as shown below.
Along with that, you need to install and import the below modules by visiting the shared resources
path in an automation account.
Az.Kusto
,KQL
- to run KQL queries directly from the PowerShell.
Note: Check this Github PowerShell function which was implemented to run a KQL query even though the Microsoft.Azure.Kusto.Tools
NuGet package doesn't exist.