Francesco Mantovani
Francesco Mantovani

Reputation: 12227

Visual Studio Code :: Configure Kusto Connection

I'm new to Kusto.

I'm trying to follow this guide that should help me identify unused resources on Azure.

The first command is pretty easy:

resources
| where type == "microsoft.compute/disks" 

But it fails miserably with the error: Request is invalid and cannot be executed. ('where' operator: Failed to resolve table or column expression named 'resources')

enter image description here

I have tried with other resources:

Samples
SampleIoTData
SampleMetrics
ContosoSales
SampleLogs

enter image description here

But non seems working.

I have also tried

enter image description here

And none seems to work.

So how do you connect to your Azure Subscription through Visual Studio Code and Kusto?

Upvotes: 3

Views: 2534

Answers (2)

David דודו Markovitz
David דודו Markovitz

Reputation: 44941

Kusto was created within Microsoft and used internally within Microsoft.

Log Analytics & Application Insights (as of today, components of Azure Monitor) are Microsoft's SaaS (Software as a Service) that use Kusto as back-end.

Azure Resource Graph is another Microsoft's SaaS that uses Kusto as back-end.
Those SaaS externalize (different) subsets of the Kusto query language (KQL).
Those SaaS are unrelated.

Azure Data Explorer (abbrevated ADX) is Microsoft's offering of Kusto as PaaS (Platform as a Service), to its customers.

Some reading: https://en.wikipedia.org/wiki/Azure_Data_Explorer


There is a Visual Studio Code plugin that supports executing KQL queries against ADX clusters & Application Insight.


Samples, SampleIoTData etc. are databases of an ADX publicly available cluster, called Help.


resources is a table of Azure Resource Graph.
You can query it through the Azure Portal:
https://portal.azure.com/#view/HubsExtension/ArgQueryBlade

I'm not familiar with a formal option to query it from Visual Studio Code, but if you search on the web, you can find some projects developed by individuals.

Upvotes: 3

David דודו Markovitz
David דודו Markovitz

Reputation: 44941

  • Click the "Extensions" button, search for "kusto notebooks" and click "Install"

Install

  • Press the "Kusto" button and then the "Add Cluster" button

Kusto

  • Select the 1st connection type ("Azure Data Explorer Cluster")

ADX

  • Enter the cluster URL

Cluster URL

  • Note the newly create cluster and databases on the left

Help

  • Click the "Explorer" button and then create a new file with .knb suffix.

help.knb

  • In your newly created file, click the "Configure Kusto Connection" button

Configure Kusto Connection

  • Select the require connection

Connection

  • Select the required database

Database

  • Add a "Code" cell, write your code and execute it

Code

Upvotes: 4

Related Questions