Skip to content

Commit 761aca7

Browse files
committed
Merge branch 'master' of https://github.com/MicrosoftDocs/azure-docs-pr into 2019-10-authentication
2 parents c1d90a8 + b54b630 commit 761aca7

File tree

67 files changed

+521
-147
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+521
-147
lines changed
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
---
2+
title: Use Azure Notebooks to analyze data in Azure Data Explorer
3+
description: This topic shows you how to create a query using an Azure Notebook
4+
author: orspod
5+
ms.author: orspodek
6+
ms.reviewer: adieldar
7+
ms.service: data-explorer
8+
ms.topic: conceptual
9+
ms.date: 04/01/2020
10+
---
11+
12+
# Use Azure Notebooks to analyze data in Azure Data Explorer
13+
14+
[Azure Notebooks](https://notebooks.azure.com/) is an Azure cloud service that simplifies creating and sharing [Jupyter Notebooks](https://jupyter.org/). Azure Notebooks makes it easy to combine documentation, code, and the results of running the code.
15+
16+
> [!Note]
17+
> * The following procedure uses the Python client in the Azure Notebooks environment to query Azure Data Explorer. However, you can also use [KQLmagic](https://docs.microsoft.com/azure/data-explorer/kqlmagic) to query Azure Data Explorer.
18+
> * Some users reported issues authenticating using Edge; until such issues are resolved,
19+
use a different browser.
20+
21+
## Create a project
22+
23+
1. Open [Azure Notebooks](https://notebooks.azure.com/) in your browser and sign-in.
24+
25+
1. Select **My Projects** tab in the header.
26+
27+
[![](media/azurenotebooks/an-myprojects.png "My projects")](media/azurenotebooks/an-myprojects.png#lightbox)
28+
29+
1. Select **+ New Projects**.
30+
31+
1. In the **Create New Project** dialog box:
32+
1. Enter the **Project Name**.
33+
1. Clear the **Public** checkbox.
34+
>[!Important]
35+
> If you don't clear the Public checkbox, your project will be exposed on the open Internet.
36+
1. Select **Create**.
37+
38+
![Create a new project](media/azurenotebooks/an-create-new-project-blank.png)
39+
40+
The Project ID is created automatically.
41+
42+
## Create a notebook
43+
44+
1. In your new project, create a notebook. The notebook should use a [supported language](https://github.com/Azure/azure-kusto-python#minimum-requirements).
45+
To create a notebook, select **+ New** and select **Notebook**.
46+
47+
![Create new notebook](media/azurenotebooks/an-create-new-notebook-menu.png)
48+
49+
1. In the **Create New Notebook** dialog box, enter the notebook name.
50+
51+
1. Select **Python 3.6** and select **New**.
52+
53+
![Create new notebook](media/azurenotebooks/an-create-new-notebook.png)
54+
55+
1. In your project, select your new notebook.
56+
57+
![Select new notebook](media/azurenotebooks/an-select-notebook.png)
58+
59+
Wait until your Python kernel initializes. When the filled circle icon changes to a hollow circle icon, you can proceed.
60+
61+
![Kernel initializes](media/azurenotebooks/an-python-init-icon.png)
62+
63+
1. To import the system module, enter the following commands and select **Run**:
64+
```python
65+
import sys
66+
sys.version
67+
```
68+
69+
> [!Note]
70+
> To run a cell, you can also press Shift+Enter.
71+
72+
1. To import SDK classes, enter the following commands and select **Run**:
73+
```python
74+
from azure.kusto.data.request import KustoClient, KustoConnectionStringBuilder
75+
```
76+
77+
1. To build the connection string and start the Kusto client, enter the following commands and select **Run**:
78+
```python
79+
kcsb = KustoConnectionStringBuilder.with_aad_device_authentication("https://help.kusto.windows.net")
80+
kc = KustoClient(kcsb)
81+
kc.execute("Samples", ".show version")
82+
```
83+
1. At the prompt, open a new browser tab to [https://aka.ms/devicelogin](https://aka.ms/devicelogin).
84+
85+
1. Enter the authorization code, and sign-in your AAD (@microsoft.com) account. The Kusto client `kc` can now authenticate to Azure Data Explorer using your identity.
86+
87+
1. Return to your notebook to see the result of the authentication.
88+
89+
[![](media/azurenotebooks/an-python-commands.png "Python commands")](media/azurenotebooks/an-python-commands.png#lightbox)
90+
91+
## Execute a Kusto query
92+
93+
1. Enter your Kusto query and select **Run**. For example:
94+
95+
```python
96+
query= "StormEvents | project State, EventType | take 10"
97+
response = kc.execute("Samples", query)
98+
for row in response.primary_results[0]:
99+
print(", ".join(row))
100+
```
101+
102+
[![](media/azurenotebooks/an-commands.png "Python commands")](media/azurenotebooks/an-commands.png#lightbox)
103+
104+
## Next steps
105+
106+
* [Kusto-python GitHub repo](https://github.com/Azure/azure-kusto-python)

articles/data-explorer/flow-usage.md

Lines changed: 7 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ For more information, see [Microsoft Flow connector (Preview)](flow.md).
1919
* [Push data to Power BI dataset](#push-data-to-power-bi-dataset)
2020
* [Conditional queries](#conditional-queries)
2121
* [Email multiple Azure Data Explorer Flow charts](#email-multiple-azure-data-explorer-flow-charts)
22-
* [Send a different email to different contacts](#send-a-different-email-to-different-contacts)
23-
* [Create a custom HTML table](#create-a-custom-html-table)
2422

2523
## Microsoft Flow connector and SQL
2624

@@ -96,23 +94,21 @@ Visualize this information as a pie chart and email it to the team.
9694

9795
## Email multiple Azure Data Explorer Flow charts
9896

99-
1. Create a new Flow with "Recurrence" trigger, and define the interval of the Flow and the frequency.
97+
1. Create a new Flow with the recurrence trigger, and define the interval of the Flow and the frequency.
10098
1. Add a new step, with one or more Kusto - Run query and visualize results actions.
10199

102100
![Run several queries in a flow](./media/flow-usage/flow-severalqueries.png)
103101
1. For each Kusto - Run query and visualize result, define the following fields:
104-
* Cluster URL (in the *Cluster Name* field)
102+
* Cluster URL
105103
* Database Name
106-
* Query and Chart Type (HTML Table/ Pie Chart/ Time Chart/ Bar Chart/ Enter Custom Value).
104+
* Query and Chart Type (HTML table, pie chart, time chart, bar chart, or enter a custom value).
107105

108106
![Visualize results with multiple attachments](./media/flow-usage/flow-visualizeresultsmultipleattachments.png)
109107

110-
> [!IMPORTANT]
111-
> In the *Cluster Name* fields, enter the cluster URL.
112-
113-
1. Add a Send an email action.
114-
* In the *Body* field, insert the required body so that the visualized result of the query is included in the body of the email.
115-
* To add an attachment to the email, add Attachment Name and Attachment Content.
108+
1. Add a Send an email (v2) action:
109+
1. In the body section, select the code view icon.
110+
1. In the **Body** field, insert the required BodyHtml so that the visualized result of the query is included in the body of the email.
111+
1. To add an attachment to the email, add Attachment Name and Attachment Content.
116112

117113
![Email multiple attachments](./media/flow-usage/flow-email-multiple-attachments.png)
118114

@@ -124,68 +120,6 @@ Results:
124120

125121
[![](./media/flow-usage/flow-resultsmultipleattachments2.png "Results of multiple attachments")](./media/flow-usage/flow-resultsmultipleattachments2.png#lightbox)
126122

127-
## Send a different email to different contacts
128-
129-
You can leverage Microsoft Flow to send different customized emails to different contacts. The email addresses and the email contents are a result of a Kusto query.
130-
131-
Example:
132-
133-
![Dynamic email using a Kusto query](./media/flow-usage/flow-dynamicemailkusto.png)
134-
135-
> [!IMPORTANT]
136-
> In the *Cluster Name* field, enter the cluster URL.
137-
138-
![Dynamic email in the flow action](./media/flow-usage/flow-dynamicemail.png)
139-
140-
## Create a custom HTML table
141-
142-
You can leverage Microsoft Flow to create and use custom HTML elements, such as a custom HTML table.
143-
144-
The following example demonstrates how to create a custom HTML table. The HTML table will have its rows colored by log level (the same as in Azure Data Explorer).
145-
146-
Follow these instructions to create a similar Flow:
147-
148-
1. Create a new Kusto - Run query and list results action.
149-
150-
![List results for an HTML table](./media/flow-usage/flow-listresultforhtmltable.png)
151-
152-
> [!IMPORTANT]
153-
> In the *Cluster Name* field, enter the cluster URL.
154-
155-
1. Loop over the query results and create the HTML table body:
156-
1. To create a variable to hold the HTML string, select **New step**
157-
1. Select **Add an action** and search for Variables.
158-
1. Select **Variables - Initialize variable**.
159-
1. Initialize a string variable as follows:
160-
161-
![Initialize a variable](./media/flow-usage/flow-initializevariable.png)
162-
163-
1. Loop over the results:
164-
1. Select **New step**.
165-
1. Select **Add an action**.
166-
1. Search for Variables.
167-
1. Select **Variables - Append to string variable**.
168-
1. Select the variable name that you initialized before, and create the HTML table rows using the query results.
169-
When selecting the query results, Apply to each is automatically added.
170-
171-
In the example below, the `if` expression is used to define the style of each row:
172-
173-
```if(equals(items('Apply_to_each')?['Level'], 'Warning'), 'Yellow', if(equals(items('Apply_to_each')?['Level'], 'Error'), 'red', 'white'))```
174-
175-
[![](./media/flow-usage/flow-createhtmltableloopcontent.png "Create HTML table loop content")](./media/flow-usage/flow-createhtmltableloopcontent.png#lightbox)
176-
177-
1. Create the full HTML content:
178-
1. Add a new action outside Apply to each.
179-
In the following example the action used is Send an email.
180-
1. Define your HTML table using the variable from the previous steps.
181-
1. If you're sending an email, select **Show advanced options** and, under Is HTML, select **Yes**.
182-
183-
![Custom HTML table email](./media/flow-usage/flow-customhtmltablemail.png)
184-
185-
Result:
186-
187-
![Custom HTML table email result](./media/flow-usage/flow-customhtmltableresult.png)
188-
189123
## Next steps
190124

191125
Learn about the [Microsoft Azure Explorer Logic App connector](https://docs.microsoft.com/azure/kusto/tools/logicapps) which is another way to run Kusto queries and commands automatically as part of a scheduled or triggered task.
Lines changed: 47 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,74 @@
11
---
22
title: Use one-click ingestion to ingest data into Azure Data Explorer
3-
description: Learn about how to ingest (load) data into Azure Data Explorer simply using one-click ingestion.
3+
description: Overview of ingesting (loading) data into Azure Data Explorer simply, using one-click ingestion.
44
author: orspod
55
ms.author: orspodek
66
ms.reviewer: tzgitlin
77
ms.service: data-explorer
8-
ms.topic: conceptual
9-
ms.date: 10/31/2019
8+
ms.topic: overview
9+
ms.date: 03/29/2020
1010
---
1111

12-
# Use one-click ingestion to ingest data into Azure Data Explorer
12+
# What is one-click ingestion?
1313

14-
This article shows you how to use one-click ingestion for quick ingestion of a new table in JSON or CSV formats. The data can be ingested from storage or a local file into an existing table or a new table. Use the intuitive one-click wizard, and your data ingests within a few minutes. Then, you can edit the table and run queries by using the Azure Data Explorer Web UI.
14+
One-click ingestion enables you to quickly ingest data and automatically suggest tables and mapping structures, based on a data source in Azure Data Explorer.
15+
16+
Using the Azure Data Explorer Web UI, you can ingest data from storage (blob file), a local file, or a container (up to 10,000 blobs). You can also define an event grid on a container for continuous ingestion. The data can be ingested into an existing or new table in JSON, CSV, and [other formats](#file-formats). One click ingestion can suggest a structure for a new table and table mapping, based on the data source, and provide an intuitive platform to adjust the table structure of an existing table and table mapping. One click ingestion will ingest the data into the table within only a few minutes.
17+
18+
One-click ingestion is particularly useful when ingesting data for the first time, or when your data's schema is unfamiliar to you.
1519

1620
## Prerequisites
1721

1822
* If you don't have an Azure subscription, create a [free Azure account](https://azure.microsoft.com/free/) before you begin.
19-
* Sign in to [the application](https://dataexplorer.azure.com/).
2023
* Create [an Azure Data Explorer cluster and database](create-cluster-database-portal.md).
21-
* Sign in to the [Web UI](https://dataexplorer.azure.com/) and [add a connection to your cluster](/azure/data-explorer/web-query-data#add-clusters).
22-
23-
## Ingest new data
24-
25-
1. Right-click the *database* or *table* row in left menu of the Web UI and select **Ingest new data (Preview)**.
26-
27-
![Select one-click ingestion in the Web UI](media/ingest-data-one-click/one-click-ingestion-in-webui.png)
28-
29-
1. In the **Ingest new data (Preview)** window, select the **Source** tab and complete the **Project Details**:
30-
31-
* For **Table**, select an existing table name from the drop-down menu or select **Create new** to make a new table.
32-
* For **Ingestion type**, select either **from storage** or **from file**.
33-
* If you selected **from storage**, select **Link to storage** to add the URL. Use [Blob SAS URL](/azure/vs-azure-tools-storage-explorer-blobs#get-the-sas-for-a-blob-container) for private storage accounts.
34-
* If you selected **from file**, select **Browse** and drag the file into the box.
35-
* Select **Edit schema** to view and edit your table column configuration.
36-
37-
![One-click ingestion source details](media/ingest-data-one-click/one-click-ingestion-source.png)
24+
* Sign in to the [Azure Data Explorer Web UI](https://dataexplorer.azure.com/) and [add a connection to your cluster](/azure/data-explorer/web-query-data#add-clusters).
3825

39-
> [!TIP]
40-
> If you select **Ingest new data (Preview)** on a *table* row, the selected table name will appear in the **Project Details**.
26+
## File formats
4127

42-
1. If you selected an existing table, the **Map columns** window opens to map source data columns to target table columns.
43-
* Use **Omit column** to remove a target column from the table.
44-
* Use **New column** to add a new column to the table.
28+
One-click ingestion supports ingesting a new table from source data in any of the following formats:
29+
* JSON
30+
* CSV
31+
* TSV
32+
* SCSV
33+
* SOHSV
34+
* TSVE
35+
* PSV
4536

46-
![Map columns window](media/ingest-data-one-click/one-click-map-columns-window.png)
37+
## One-click ingestion wizard
4738

48-
1. In the **Schema** tab:
39+
The one-click ingestion wizard guides you through the one-click ingestion process.
4940

50-
* Select **Compression type** from the drop-down menu, and then select either **Uncompressed** or **GZip**.
51-
* Select **Data format** from the drop-down menu, and then select **JSON**, **CSV**, **TSV**, **SCSV**, **SOHSV**, **TSVE**, or **PSV**.
52-
* When you select the **JSON** format, you must also select **JSON levels**, from 1 to 10. The levels affect the table column data depiction.
53-
* If you select a format other than JSON, you must select the check box **Include column names** to ignore the heading row of the file.
54-
* **Mapping name** is set automatically but can be edited.
55-
* If you selected an existing table, you can select **Map columns** to open the **Map columns** window.
41+
> [!Note]
42+
> This section describes the wizard in general. The options you select depend on whether you are ingesting into a new or existing table.
43+
> For more information, see:
44+
> * Ingest into [a new table](one-click-ingestion-new-table.md)
45+
> * Ingest into an [existing table](one-click-ingestion-existing-table.md)
46+
47+
1. To access the wizard, right-click the *database* or *table* row in left menu of the Azure Data Explorer web UI and select **Ingest new data (preview)**.
5648

57-
![One-click ingestion CSV format schema](media/ingest-data-one-click/one-click-csv-format.png)
58-
59-
1. Above the **Editor** pane, select the **v** button to open the editor. In the editor, you can view and copy the automatic queries generated from your inputs.
60-
61-
1. In the table:
62-
* Right-click new column headers to **Change data type**, **Rename column**, **Delete column**, **Sort ascending**, or **Sort descending**. On existing columns, only data sorting is available.
63-
* Double-click the new column name to edit.
64-
65-
1. Select **Start ingestion** to create a table and mapping and to begin data ingestion.
66-
67-
![One-click ingestion JSON format schema](media/ingest-data-one-click/one-click-json-format.png)
68-
69-
## Query data
70-
71-
1. In the **Data ingestion completed** window, all three steps will be marked with green check marks if data ingestion finishes successfully.
72-
73-
![One-click data ingestion complete](media/ingest-data-one-click/one-click-data-ingestion-complete.png)
49+
![Select one-click ingestion in the Web UI](media/ingest-data-one-click/one-click-ingestion-in-webui.png)
7450

75-
1. Select the **v** button to open the query. Copy to the Web UI to edit the query.
51+
1. The wizard guides you through the following options:
52+
* Ingest into an [existing table](one-click-ingestion-existing-table.md)
53+
* Ingest into [a new table](one-click-ingestion-new-table.md)
54+
* Ingest data from:
55+
* Blob storage
56+
* A local file
57+
* A container
58+
* Enter the sample size, from 1 to 10,000 rows (from container only)
59+
60+
1. When you have successfully selected the data source, a preview of the data is displayed.
61+
If you are ingesting data from a container, you can filter the data so that only files with specific prefixes or file extensions are ingested. For example, you might only want to ingest files with filenames beginning with the word *Europe*, or only files with the extension *.json*.
7662

77-
1. The menu on the right contains **Quick queries** and **Tools** options.
63+
1. Click **Edit schema**. If you are ingesting data into a specific table, you can map the source columns to the target columns and decide whether or not to include column names.
7864

79-
* **Quick queries** includes links to the Web UI with example queries.
80-
* **Tools** includes a link to **Drop commands** on the Web UI, which allow you to troubleshoot issues by running the relevant `.drop` commands.
65+
1. Start the data ingestion process.
8166

82-
> [!TIP]
83-
> You might lose data when you use `.drop` commands. Use them carefully.
67+
> [!Note]
68+
> If your data source is a container, note that Azure Data Explorer's data ingestion aggregation (batching) policy is designed to optimize the ingestion process. By default, the policy is configured to 5 minutes or 500 MB of data, so you may experience latency. See [batching policy](/azure/kusto/concepts/batchingpolicy) for aggregation options. When ingesting data from other sources, the ingestion will take immediate effect.
8469
8570
## Next steps
8671

87-
* [Query data in Azure Data Explorer Web UI](web-query-data.md)
88-
* [Write queries for Azure Data Explorer using Kusto Query Language](write-queries.md)
72+
* Decide if you will use one-click ingestion to ingest data into [an existing table](one-click-ingestion-existing-table.md) or [a new table](one-click-ingestion-new-table.md)
73+
* [Query data in Azure Data Explorer Web UI](/azure/data-explorer/web-query-data)
74+
* [Write queries for Azure Data Explorer using Kusto Query Language](/azure/data-explorer/write-queries)

0 commit comments

Comments
 (0)