# Exploring Azure Data with Kusto and Dashboards

In order to more effectively learn [Kusto](https://docs.microsoft.com/en-us/azure/azure-monitor/log-query/query-language) (the query language powering Azure analytics, log querying and PowerBI) and data visualization capabilites in Azure, I did the following:

1. [Created a cluster and database](https://docs.microsoft.com/en-us/azure/data-explorer/create-cluster-database-portal) (this takes quite a while)
2. Open the [Azure Data Explorer](https://aka.ms/kwe) (a.k.a. Kusto Web Explorer) at <https://aka.ms/kwe>
3. Add the cluster with the full URI or alternatively just the `name.region` parts (i.e. `kzukusto.centralus` vs [`https://kzukusto.centralus.kusto.windows.net`](https://kzukusto.centralus.kusto.windows.net))
4. Optionally add an arbitrary Application Insights app as a "virtual cluster", [using a url with the format](https://docs.microsoft.com/en-us/azure/data-explorer/query-monitor-data#connect-to-the-proxy) `https://ade.applicationinsights.io/subscriptions/<id>/resourcegroups/<name>/providers/microsoft.insights/components/<ai-app-name>`
5. Right--lick database and select Ingest new data

   ![Ingest new data context menu](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-6cb5d458782487793957c5ae1fc13884d9967b4a%2Fimage.png?alt=media)
6. Find some interesting [Azure Open Dataset from the catalog](https://azure.microsoft.com/en-us/services/open-datasets/catalog/) that has an Azure storage URL readily available from the Azure Open Datasets catalog, such as the [Bing COVID-19 Data](https://azure.microsoft.com/en-us/services/open-datasets/catalog/bing-covid-19-data/) (I used the `.jsonl` link). NOTE: the `.json` one will not properly infer schema because it has a root object of type array. The `.jsonl` is actually a "JSON fragment" (if that even exists, would be the equivalent of an XML fragment) where each entry is just a JSON entry/line in the file.

   ![](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-b75572b99de8e2bd9dc66259fbcafc9a77cee21e%2Fimage%20\(1\).png?alt=media)

   The JSON version is preferable to `.csv` because it properly infer the data type for columns.
7. Click on `Dashboards` for the new stuff here. Parameters driven by queries are particularly handy:

![Query-driven multi-select parameter for widget](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-2768664f8c19f9b71d6590bdca071e11079b4568%2Fimage%20\(2\).png?alt=media)

While editing the query/widget, if the parameter is used in the query, you can interactively change its value to explore the visualizations. For example:

![Used parameter becomes enabled for selection](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-98854a5225b964d71dcaa1a689649e4ba1e80d4d%2Fimage%20\(3\).png?alt=media)

Whereas if it wasn't used:

![Unused parameter unavailable](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-ae514b95c9a8f6ec6cf969af7ce008192ded3af4%2Fimage%20\(4\).png?alt=media)

After shaping the `Results`the way you want, clicking the Visual tab allows configuring a bunch of visualizations. Inference works quite nicely if the data/results are filtered to just what you want to display.

![Many chart options and inference that works great](https://804009323-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M5W22ESTtVWB8uBjgpA%2Fuploads%2Fgit-blob-e65eee7034fbc9084f8633cabcfa2e9449a26e01%2Fimage%20\(5\).png?alt=media)
