ערוך

שתף באמצעות


Kusto (KQL) extension for Azure Data Studio (Preview)

The Kusto (KQL) extension for Azure Data Studio enables you to connect and query to Azure Data Explorer clusters.

Users can write and run KQL queries and author notebooks with the Kusto kernel complete with IntelliSense.

By enabling the native Kusto (KQL) experience in Azure Data Studio, data engineers, data scientists, and data analysts can quickly observe trends and anomalies against massive amounts of data stored in Azure Data Explorer.

This extension is currently in preview.

Prerequisites

If you don't have an Azure subscription, create a free Azure account before you begin.

The following prerequisites are also required:

Install the Kusto (KQL) extension

To install the Kusto (KQL) extension in Azure Data Studio, follow the steps below.

  1. Open the extensions manager in Azure Data Studio. You can either select the extensions icon or select Extensions in the View menu.

  2. Type in Kusto in the search bar.

  3. Select the Kusto (KQL) extension and view its details.

  4. Select Install.

Kusto extension

How to connect to an Azure Data Explorer cluster

Find your Azure Data Explorer cluster

Find your Azure Data Explorer cluster in the Azure portal, then find the URI for the cluster.

URI

However, you can get started immediately using the help.kusto.windows.net cluster.

For this article, we're using data from the help.kusto.windows.net cluster for samples.

Connection details

To set up an Azure Data Explorer cluster to connect to, follow the steps below.

  1. Select New connection from the Connections pane.

  2. Fill in the Connection Details information.

    1. For Connection type, select Kusto.
    2. For Cluster, enter in your Azure Data Explorer cluster address (for example, https://mydataexplorercluster.kusto.windows.net).
    3. For Authentication Type, use the default.
    4. For Account, use your account information.
    5. For Database, use Default. If your account does not have access to the Default database, you can use any database that you have access to.
    6. For Server Group, use Default.
      1. You can use this field to organize your servers in a specific group.
    7. For Name (optional), leave blank.
      1. You can use this field to give your server an alias.

    Screenshot shows the Connection details pane.

How to query an Azure Data Explorer database in Azure Data Studio

Now that you have set up a connection to your Azure Data Explorer cluster, you can query your database(s) using Kusto (KQL).

To create a new query tab, you can either select File > New Query, use Ctrl + N, or right-click the database and select New Query.

Once you have your new query tab open, then enter your Kusto query.

Here are some samples of KQL queries:

StormEvents
| limit 1000
StormEvents
| where EventType == "Waterspout"

For more information about writing KQL queries, visit Write queries for Azure Data Explorer

View extension settings

To change the settings for the Kusto extension, follow the steps below.

  1. Open the extension manager in Azure Data Studio. You can either select the extensions icon or select Extensions in the View menu.

  2. Find the Kusto (KQL) extension.

  3. Select the Manage icon.

  4. Select the Extension Settings icon.

The extensions settings look like this:

Kusto (KQL) extension settings

SandDance visualization

The SandDance extension with the Kusto (KQL) extension in Azure Data Studio bring rich interactive visualization together. From the KQL query result set, select the Visualizer button to launch SandDance.

SandDance visualization

Known issues

Details Workaround
In Kusto notebook, Changing a database connection on a saved alias connection is stuck after an error in code cell execution Close and reopen the Notebook, then connect to the right cluster with the database
In Kusto Notebook, changing a database connection on a non-saved alias connection doesn't work Create a new connection from Connection Viewlet and save it with an alias. Then create a new notebook and connect to the newly saved connection)
In Kusto Notebook, the database dropdown isn't populated when creating a new ADX connection Create a new connection from Connection Viewlet and save it with an alias. Then create a new notebook and connect to the newly saved connection)

You can file a feature request to provide feedback to the product team.
You can file a bug to provide feedback to the product team.

Next steps