Skip to content

Commit 9271bb9

Browse files
authored
Merge pull request #25159 from markingmyname/linterbobby
Linter tool testing
2 parents 931c7b2 + c4824e3 commit 9271bb9

2 files changed

Lines changed: 53 additions & 41 deletions

File tree

docs/azure-data-studio/notebooks/notebooks-kqlmagic.md

Lines changed: 48 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ title: Notebooks with Kqlmagic (Kusto Query Language) in Azure Data Studio
33
description: This tutorial shows how you can create and run Kqlmagic in an Azure Data Studio notebook.
44
author: markingmyname
55
ms.author: maghan
6-
ms.reviewer: jukoesma
7-
ms.date: 06/28/2021
6+
ms.reviewer: ""
7+
ms.date: 12/07/2022
88
ms.service: azure-data-studio
9+
ms.subservice: ""
10+
ms.custonm: ""
911
ms.topic: how-to
1012
---
1113

@@ -26,13 +28,13 @@ The steps in this section all run within an Azure Data Studio notebook.
2628

2729
1. Create a new notebook and change the **Kernel** to *Python 3*.
2830

29-
![New Notebook](media/notebooks-kqlmagic/install-new-notebook.png)
31+
:::image type="content" source="media/notebooks-kqlmagic/install-new-notebook.png" alt-text="Screenshot of a new notebook.":::
3032

31-
2. You may be prompted to upgrade your Python packages when your packages need updating.
33+
1. You may be prompted to upgrade your Python packages when your packages need updating.
3234

33-
![Yes](media/notebooks-kqlmagic/install-python-yes.png)
35+
:::image type="content" source="media/notebooks-kqlmagic/install-python-yes.png" alt-text="Screenshot of the result - yes.":::
3436

35-
3. Install Kqlmagic:
37+
1. Install Kqlmagic:
3638

3739
```python
3840
import sys
@@ -46,29 +48,29 @@ The steps in this section all run within an Azure Data Studio notebook.
4648
!{sys.executable} -m pip list
4749
```
4850

49-
![List](media/notebooks-kqlmagic/install-list.png)
51+
:::image type="content" source="media/notebooks-kqlmagic/install-list.png" alt-text="Screenshot of the list.":::
5052

51-
4. Load Kqlmagic:
53+
1. Load Kqlmagic:
5254

5355
```python
5456
%reload_ext Kqlmagic
5557
```
5658

57-
> [!Note]
59+
> [!NOTE]
5860
> If this step fails, then close the file and reopen it.
5961
60-
![Load the Kqlmagic extension](media/notebooks-kqlmagic/install-load-kql-magic-ext.png)
62+
:::image type="content" source="media/notebooks-kqlmagic/install-load-kql-magic-ext.png" alt-text="Screenshot of the load the Kqlmagic extension.":::
6163

62-
5. You can test if Kqlmagic is loaded properly by browsing the help documentation or by checking for the version.
64+
1. You can test if Kqlmagic is loaded properly by browsing the help documentation or by checking for the version.
6365

6466
```python
6567
%kql --help "help"
6668
```
6769

68-
> [!Note]
70+
> [!NOTE]
6971
> If `Samples@help` is asking for a password, then you can leave it blank and press **Enter**.
7072
71-
![Help](media/notebooks-kqlmagic/install-help.png)
73+
:::image type="content" source="media/notebooks-kqlmagic/install-help.png" alt-text="Screenshot of help.":::
7274

7375
To see which version of Kqlmagic is installed, run the command below.
7476

@@ -80,36 +82,36 @@ The steps in this section all run within an Azure Data Studio notebook.
8082

8183
This section explains how to run data analysis using Kqlmagic with an Azure Data Explorer cluster.
8284

83-
### <a name="ade-load-auth"></a> Load and authenticate Kqlmagic for Azure Data Explorer
85+
### <a id="ade-load-auth"></a> Load and authenticate Kqlmagic for Azure Data Explorer
8486

85-
> [!Note]
87+
> [!NOTE]
8688
> Every time you create a new notebook in Azure Data Studio you must load the Kqlmagic extension.
8789
8890
1. Verify the **Kernel** is set to *Python3*.
8991

90-
![Kernel change](media/notebooks-kqlmagic/change-kernel.png)
92+
:::image type="content" source="media/notebooks-kqlmagic/change-kernel.png" alt-text="Screenshot of the kernel change.":::
9193

92-
2. Load Kqlmagic:
94+
1. Load Kqlmagic:
9395

9496
```python
9597
%reload_ext Kqlmagic
9698
```
9799

98-
![Load the Kqlmagic extension](media/notebooks-kqlmagic/install-load-kql-magic-ext.png)
100+
:::image type="content" source="media/notebooks-kqlmagic/install-load-kql-magic-ext.png" alt-text="Screenshot of the load the Kqlmagic extension.":::
99101

100-
3. Connect to the cluster and authenticate:
102+
1. Connect to the cluster and authenticate:
101103

102104
```python
103105
%kql azureDataExplorer://code;cluster='help';database='Samples'
104106
```
105107

106-
> [!Note]
107-
> If you are using your own ADX cluster, you must include the region in the connection string as follows:
108-
```%kql azuredataexplorer://code;cluster='mycluster.westus';database='mykustodb'```
108+
> [!NOTE]
109+
> If you are using your own ADX cluster, you must include the region in the connection string as follows:
109110
110-
You use Device Login to authenticate. Copy the code from the output and select **authenticate** which opens a browser where you need to paste the code. Once you authenticate successfully, you can come back to Azure Data Studio to continue with the rest of the script.
111+
```%kql azuredataexplorer://code;cluster='mycluster.westus';database='mykustodb'```
112+
You use device sign-in to authenticate. Copy the code from the output and select **authenticate** which opens a browser where you need to paste the code. Once you authenticate successfully, you can come back to Azure Data Studio to continue with the rest of the script.
111113

112-
![Azure Data Explorer authentication](media/notebooks-kqlmagic/ade-auth.png)
114+
:::image type="content" source="media/notebooks-kqlmagic/ade-auth.png" alt-text="Screenshot of the Azure Data Explorer authentication.":::
113115

114116
### Query and visualize for Azure Data Explorer
115117

@@ -123,7 +125,7 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
123125

124126
If you're familiar with the Kusto Query Language (KQL), you can type the query after `%kql`.
125127

126-
![Analyze storm events](media/notebooks-kqlmagic/ade-analyze-storm-events.png)
128+
:::image type="content" source="media/notebooks-kqlmagic/ade-analyze-storm-events.png" alt-text="Screenshot of the analyze storm events.":::
127129

128130
2. Visualize a timeline chart:
129131

@@ -133,7 +135,7 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
133135
| render timechart title= 'Daily Storm Events'
134136
```
135137

136-
![visualize timechart](media/notebooks-kqlmagic/ade-visualize-timechart.png)
138+
:::image type="content" source="media/notebooks-kqlmagic/ade-visualize-timechart.png" alt-text="Screenshot of a time chart.":::
137139

138140
3. Multiline Query sample using `%%kql`.
139141

@@ -146,23 +148,32 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
146148
| render columnchart title='Top 10 States by Storm Event count'
147149
```
148150

149-
![Multiline Query sample](media/notebooks-kqlmagic/ade-multiline-query-sample.png)
151+
```python
152+
%%kql
153+
StormEvents
154+
| summarize count() by State
155+
| sort by count_
156+
| limit 10
157+
| render columnchart title='Top 10 States by Storm Event count'
158+
```
159+
160+
:::image type="content" source="media/notebooks-kqlmagic/ade-multiline-query-sample.png" alt-text="Screenshot of a multiline Query sample.":::
150161

151162
## Kqlmagic with Application Insights
152163

153164
### <a name="appin-load-auth"></a> Load and authenticate Kqlmagic for Application Insights
154165

155166
1. Verify the **Kernel** is set to *Python3*.
156167

157-
![Kernel](media/notebooks-kqlmagic/change-kernel.png)
168+
:::image type="content" source="media/notebooks-kqlmagic/change-kernel.png" alt-text="Screenshot of a kernel.":::
158169

159170
2. Load Kqlmagic:
160171

161172
```python
162173
%reload_ext Kqlmagic
163174
```
164175

165-
![Load the Kqlmagic extension](media/notebooks-kqlmagic/install-load-kql-magic-ext.png)
176+
:::image type="content" source="media/notebooks-kqlmagic/install-load-kql-magic-ext.png" alt-text="Screenshot of loading the Kqlmagic extension.":::
166177

167178
> [!Note]
168179
> Every time you create a new notebook in Azure Data Studio you must load the Kqlmagic extension.
@@ -174,7 +185,6 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
174185
```python
175186
%kql appinsights://appid='DEMO_APP';appkey='DEMO_KEY'
176187
```
177-
178188
### Query and visualize for Application Insights
179189

180190
Query data using the [render operator](/azure/data-explorer/kusto/query/renderoperator) and visualize data using the ploy.ly library. This query and visualization supplies an integrated experience that uses native KQL.
@@ -187,7 +197,7 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
187197
| limit 10
188198
```
189199

190-
![Page Views](media/notebooks-kqlmagic/appin-page-views.png)
200+
:::image type="content" source="media/notebooks-kqlmagic/appin-page-views.png" alt-text="Screenshot of page views.":::
191201

192202
> [!Note]
193203
> Use your mouse to drag on an area of the chart to zoom in to the specific date(s).
@@ -201,23 +211,23 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
201211
| render timechart title= 'Daily Page Views'
202212
```
203213

204-
![Timeline Chart](media/notebooks-kqlmagic/appin-timechart.png)
214+
:::image type="content" source="media/notebooks-kqlmagic/appin-timechart.png" alt-text="Screenshot of the timeline chart.":::
205215

206216
## Kqlmagic with Azure Monitor logs
207217

208218
### <a name="aml-load-auth"></a> Load and authenticate Kqlmagic for Azure Monitor logs
209219

210220
1. Verify the **Kernel** is set to *Python3*.
211221

212-
![Change](media/notebooks-kqlmagic/change-kernel.png)
222+
:::image type="content" source="media/notebooks-kqlmagic/change-kernel.png" alt-text="Screenshot of the change.":::
213223

214224
2. Load Kqlmagic:
215225

216226
```python
217227
%reload_ext Kqlmagic
218228
```
219229

220-
![Load the Kqlmagic extension](media/notebooks-kqlmagic/install-load-kql-magic-ext.png)
230+
:::image type="content" source="media/notebooks-kqlmagic/install-load-kql-magic-ext.png" alt-text="Screenshot showing to load the Kqlmagic extension.":::
221231

222232
> [!Note]
223233
> Every time you create a new notebook in Azure Data Studio you must load the Kqlmagic extension.
@@ -228,7 +238,7 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
228238
%kql loganalytics://workspace='DEMO_WORKSPACE';appkey='DEMO_KEY';alias='myworkspace'
229239
```
230240

231-
![Log Analytics auth](media/notebooks-kqlmagic/aml-auth.png)
241+
:::image type="content" source="media/notebooks-kqlmagic/aml-auth.png" alt-text="Screenshot of the log analytics authentication.":::
232242

233243
### Query and visualize for Azure Monitor Logs
234244

@@ -243,7 +253,7 @@ Query data using the [render operator](/azure/data-explorer/kusto/query/renderop
243253
| render timechart title= 'Daily Kubernetes Nodes'
244254
```
245255

246-
![Log Analytics Daily Kubernetes Nodes timechart](media/notebooks-kqlmagic/aml-timechart-daily-kubernetes-nodes.png)
256+
:::image type="content" source="media/notebooks-kqlmagic/aml-timechart-daily-kubernetes-nodes.png" alt-text="Screenshot showing the Log Analytics Daily Kubernetes Nodes timechart.":::
247257

248258
## Next steps
249259

@@ -252,6 +262,6 @@ Learn more about notebooks and Kqlmagic:
252262
- [Kusto (KQL) extension for Azure Data Studio (Preview)](../extensions/kusto-extension.md)
253263
- [Create and run a Kusto (KQL) notebook (Preview)](./notebooks-kusto-kernel.md)
254264
- [Use a Jupyter Notebook and Kqlmagic extension to analyze data in Azure Data Explorer](/azure/data-explorer/Kqlmagic)
255-
- [Extension (Magic) to Jupyter Notebook and Jupyter lab](https://github.com/Microsoft/jupyter-Kqlmagic), that enable notebook experience working with Kusto, Application Insights, and LogAnalytics data.
265+
- [Extension (Magic) to Jupyter Notebook and Jupyter lab](https://github.com/Microsoft/jupyter-Kqlmagic) that enable notebook experience working with Kusto Application Insights, and LogAnalytics data.
256266
- [Kqlmagic](https://pypi.org/project/Kqlmagic/)
257-
- [How to use notebooks in Azure Data Studio](./notebooks-guidance.md)
267+
- [How to use notebooks in Azure Data Studio](./notebooks-guidance.md)

docs/sql-server/azure-arc/connect.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ az provider register --namespace 'Microsoft.AzureArcData'
6161
If the machine with SQL Server is already connected to Azure Arc, you can connect the SQL Server instances by installing *Azure extension for SQL Server*. The SQL Server extension for Azure Arc Server can be found in the extension manager as **SQL Server Extension - Azure Arc**. Once installed, the Azure extension for SQL Server will recognize all the installed SQL Server instances and connect them with Azure Arc. The extension will run continuously to detect changes in the SQL Server configuration. For example, if a new SQL Server instance is installed on the machine, it will be automatically registered with Azure Arc. See [virtual machine extension management](/azure/azure-arc/servers/manage-vm-extensions) for instructions on how to install and uninstall extensions to [Azure connected machine agent](/azure/azure-arc/servers/agent-overview) using the Azure portal, Azure PowerShell or Azure CLI.
6262

6363
> [!IMPORTANT]
64+
>
6465
> - The Managed System Identity used by the Azure connected machine agent must have the *Azure Connected SQL Server Onboarding* role at the resource group level.
6566
> - The Azure resource with type `SQL Server - Azure Arc` representing the SQL Server instance installed on the machine uses the same region and resource group as the Azure resources for Arc-enabled servers.
6667
@@ -105,6 +106,7 @@ To install *Azure extension for SQL Server* for Linux operating system, run:
105106
> [!NOTE]
106107
> The specified resource group must match the resource group where the corresponding connected server is registered. Otherwise, the command will fail.
107108
an
109+
108110
## When the machine isn't connected to an Arc-enabled Server
109111

110112
If the server that runs your SQL Server instance isn't yet connected to Azure, you can initiate the connection from the target machine using the onboarding script. This script will connect the server to Azure and install the Azure extension for SQL Server.
@@ -203,7 +205,7 @@ Go to **Azure Arc > SQL Server** and open the newly registered Arc-enabled SQL S
203205
To delete your Arc-enabled SQL Server resource, go to **Azure Arc > SQL Server**, open the Arc-enabled SQL Server resource for that instance, and select the **Delete** button.
204206

205207
> [!IMPORTANT]
206-
> Because multiple SQL Server instances could be installed on the same machine, the *Delete* button will not uninstall the Azure extension for SQL Server on that machine. To uninstall it, follow the [uninstall extension](/azure/azure-arc/servers/manage-vm-extensions-portal#uninstall-extension) steps.
208+
> Because multiple SQL Server instances could be installed on the same machine, the *Delete* button doesn't uninstall the Azure extension for SQL Server on that machine. To uninstall it, follow the [uninstall extension](/azure/azure-arc/servers/manage-vm-extensions-portal#uninstall-extension) steps.
207209
208210
## Restore a deleted Arc-enabled SQL Server resource
209211

@@ -218,7 +220,7 @@ If you accidentally deleted your Arc-enabled SQL Server resource, you can restor
218220
> [!IMPORTANT]
219221
> The location property must match the location of the Arc-enabled SQL Server resource for the server specified by the `--machine-name` parameter.
220222
221-
1. Check to make sure your instance is in the exclusion list (see the value of the _excludedSqlInstances_ property).
223+
1. Check to make sure your instance is in the exclusion list (see the value of the *excludedSqlInstances* property).
222224

223225
```azurecli
224226
az connectedmachine extension show --machine-name "{your machine name}" --resource-group "{your resource group name}" -n WindowsAgent.SqlServer
@@ -235,4 +237,4 @@ The instance is restored after the next sync with the agent. For information on
235237
## Next steps
236238
237239
- [Configure advanced data security for your SQL Server instance](configure-advanced-data-security.md)
238-
- [Configure on-demand SQL assessment for your SQL Server instance](assess.md)
240+
- [Configure on-demand SQL assessment for your SQL Server instance](assess.md)

0 commit comments

Comments
 (0)