Skip to content

Commit a5b99dc

Browse files
Merge pull request #2865 from tanmaya-panda1/main
Update devops.md: ADXAdminCommand@5, YAML samples, and authentication docs
2 parents 755d1df + 4d19d1d commit a5b99dc

1 file changed

Lines changed: 101 additions & 16 deletions

File tree

data-explorer/devops.md

Lines changed: 101 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Azure DevOps task for Azure Data Explorer
33
description: Create a release pipeline and deploy schema changes to your database.
44
ms.reviewer: shfeldma
55
ms.topic: how-to
6-
ms.date: 09/28/2025
6+
ms.date: 03/24/2026
77
ms.custom:
88
- sfi-image-nochange
99
- sfi-ropc-nochange
@@ -50,7 +50,7 @@ You can use the following methods to execute admin commands against a cluster wi
5050

5151
:::image type="content" source="media/devops/source-control-options.png" alt-text="Screenshot showing the command source control options.":::
5252

53-
* Use a search pattern to get multiple command files from a local agent folder (build sources or release artifacts).
53+
* Use a search pattern to get multiple command files from a local agent folder (build sources or release artifacts). The single-line option supports multiple files with one command per file.
5454

5555
:::image type="content" source="media/devops/local-folder-option.png" alt-text="Screenshot showing the local folder option.":::
5656

@@ -128,6 +128,8 @@ You can use the following methods to execute admin commands against a cluster wi
128128

129129
:::image type="content" source="media/devops/add-service-endpoint.png" alt-text="Screenshot showing how to add a service connection.":::
130130

131+
1. If your admin commands are long-running asynchronous operations, select the **Wait for long Async Admin commands to complete** checkbox. When enabled, the task polls the operation status using `.show operations` until the command completes.
132+
131133
1. Select **Save**, and then in the **Tasks** tab, verify that there are three tasks: **Deploy Tables**, **Deploy Functions**, and **Deploy Policies**.
132134

133135
:::image type="content" source="media/devops/deploy-all-folders.png" alt-text="Screenshot showing how to deploy all folders.":::
@@ -203,8 +205,14 @@ Now the creation of a release pipeline for deployment to preproduction is comple
203205

204206
The extension supports keyless authentication for Azure Data Explorer clusters. Keyless authentication lets you authenticate to Azure Data Explorer clusters without using a key. It's more secure and easier to manage.
205207

208+
> [!NOTE]
209+
> Kusto Fabric cluster URLs are not supported for Workload Identity Federation (WIF) and Managed Identity authentication.
210+
206211
### Use Federated Identity Credentials (FIC) authentication in an Azure Data Explorer service connection
207212

213+
> [!NOTE]
214+
> Starting with extension version 4.0.x, the Azure Data Explorer Service Endpoint supports Workload Identity Federation (WIF) authentication in addition to Service Principal Authentication.
215+
208216
1. In your DevOps instance, go to **Project Settings** > **Service connections** > **New service connection** > **Azure Data Explorer**.
209217
1. Select **Federated Identity Credentials**, and enter your cluster URL, service principal ID, tenant ID, a service connection name, and then select **Save**.
210218
1. In the Azure portal, open the Microsoft Entra app for the specified service principal.
@@ -242,33 +250,110 @@ The extension supports keyless authentication for Azure Data Explorer clusters.
242250

243251
1. Fill out the required details, select **Verify**, and then select **Save**.
244252

245-
## Yaml pipeline configuration
253+
## YAML pipeline configuration
246254

247255
You can configure tasks using the Azure DevOps web UI or YAML code within the [pipeline schema](/azure/devops/pipelines/yaml-schema).
248256

249-
### Admin command sample
257+
The extension provides three pipeline tasks, all accessible via YAML:
258+
259+
- **Azure Data Explorer Command** (`ADXAdminCommand@5`) — Run admin/control commands against an ADX cluster
260+
- **Azure Data Explorer Query** — Run queries against an ADX cluster and parse the results
261+
- **Azure Data Explorer Query Server Gate** — Agentless task to gate releases depending on query outcome
262+
263+
> [!TIP]
264+
> For enhanced security, use **Workload Identity Federation** or **Managed Identity** authentication via an Azure Resource Manager service connection instead of storing credentials directly in your pipeline. These keyless authentication methods are the recommended best practice.
265+
266+
### Admin command sample — inline commands
267+
268+
The following sample runs an inline admin command using an Azure Resource Manager (ARM) service connection, which supports Workload Identity Federation (WIF) and Managed Identity authentication:
250269

251270
```yaml
252271
steps:
253-
- task: Azure-Kusto.PublishToADX.PublishToADX.PublishToADX@4
254-
displayName: '<Task Name>'
272+
- task: Azure-Kusto.ADXAdminCommands.PublishToADX.ADXAdminCommand@5
273+
displayName: 'Run inline ADX admin command'
255274
inputs:
256-
targetType: 'inline'
257-
script: '<inline Script>'
258-
waitForOperation: true
259-
kustoUrls: '$(CONNECTIONSTRING):443?DatabaseName=""'
260-
authType: 'armserviceconn'
261-
connectedServiceARM: '<ARM Service Endpoint Name>'
262-
serialDelay: 1000
263-
`continueOnError: true`
264-
condition: ne(variables['ProductVersion'], '') ## Custom condition Sample
275+
clusterUri: 'https://<ClusterName>.<Region>.kusto.windows.net'
276+
databaseName: '<DatabaseName>'
277+
commandsSource: 'inline'
278+
inlineCommands: |
279+
.create-merge table MyTable (Id:int, Name:string, Timestamp:datetime)
280+
.create-or-alter function MyFunction() { MyTable | take 10 }
281+
azureSubscription: '<ARM Service Connection Name>'
282+
continueOnError: true
283+
```
284+
285+
### Admin command sample — file-based commands
286+
287+
The following sample runs admin commands from files matching a glob pattern, using AAD App Registration authentication:
288+
289+
```yaml
290+
steps:
291+
- task: Azure-Kusto.ADXAdminCommands.PublishToADX.ADXAdminCommand@5
292+
displayName: 'Deploy schema from files'
293+
inputs:
294+
clusterUri: 'https://<ClusterName>.<Region>.kusto.windows.net'
295+
databaseName: '<DatabaseName>'
296+
commandsSource: 'files'
297+
commandFilesPattern: '**/*.csl'
298+
aadAppId: '$(AAD_APP_ID)'
299+
aadAppKey: '$(AAD_APP_KEY)'
300+
aadTenantId: '$(AAD_TENANT_ID)'
301+
continueOnError: true
302+
```
303+
304+
You can also use `**/*.kql` as the glob pattern depending on your file naming convention.
305+
306+
### Admin command sample — Azure Resource Manager service connection
307+
308+
The following sample uses an Azure Resource Manager service connection, which supports **Workload Identity Federation (WIF)** and **Managed Identity** for keyless authentication:
309+
310+
```yaml
311+
steps:
312+
- task: Azure-Kusto.ADXAdminCommands.PublishToADX.ADXAdminCommand@5
313+
displayName: 'Deploy schema via ARM service connection'
314+
inputs:
315+
clusterUri: 'https://<ClusterName>.<Region>.kusto.windows.net'
316+
databaseName: '<DatabaseName>'
317+
commandsSource: 'files'
318+
commandFilesPattern: '**/*.csl'
319+
azureSubscription: '<ARM Service Connection Name>'
320+
continueOnError: true
321+
condition: ne(variables['ProductVersion'], '')
265322
```
266323

324+
### Task input parameters
325+
326+
The following table describes the key input parameters for the `ADXAdminCommand@5` task:
327+
328+
| Parameter | Description |
329+
|--|--|
330+
| `clusterUri` | The base URI for the Kusto cluster (for example, `https://<ClusterName>.<Region>.kusto.windows.net`) |
331+
| `databaseName` | The name of the target database |
332+
| `commandsSource` | The source of commands: `inline` for inline KQL commands, or `files` for file-based commands |
333+
| `inlineCommands` | Inline KQL commands to run (used when `commandsSource` is `inline`) |
334+
| `commandFilesPattern` | Glob pattern for script files (used when `commandsSource` is `files`), for example `**/*.csl` or `**/*.kql` |
335+
| `aadAppId` | The Microsoft Entra App (Service Principal) ID for AAD App authentication |
336+
| `aadAppKey` | The Microsoft Entra App key/secret for AAD App authentication |
337+
| `aadTenantId` | The Microsoft Entra tenant ID for AAD App authentication |
338+
| `azureSubscription` | The name of the Azure Resource Manager service connection for ARM-based authentication (supports WIF and Managed Identity) |
339+
340+
### Authentication methods
341+
342+
The extension supports the following authentication methods:
343+
344+
- **Azure Active Directory (AAD) App Registration** — Use `aadAppId`, `aadAppKey`, and `aadTenantId` to authenticate with a Service Principal. Store credentials as secure pipeline variables.
345+
- **Certificate-based authentication** — Use a certificate instead of an app key for Service Principal authentication. Store the certificate details as secure pipeline variables.
346+
- **Managed Identity** — Use an Azure Resource Manager service connection configured with Managed Identity. Set the `azureSubscription` input to the service connection name.
347+
- **Workload Identity Federation (WIF)** — Use an Azure Resource Manager service connection with Workload Identity Federation (automatic or manual). This is the recommended keyless approach. Set the `azureSubscription` input to the service connection name.
348+
349+
> [!NOTE]
350+
> Workload Identity Federation (WIF) is a newer addition to the extension. It enables secretless authentication and is the recommended approach for new pipelines. For setup instructions, see [Use Federated Identity Credentials or Managed Identity in an Azure Resource Manager (ARM) service connection](#use-federated-identity-credentials-or-managed-identity-in-an-azure-resource-manager-arm-service-connection).
351+
267352
### Query sample
268353

269354
```yaml
270355
steps:
271-
- task: Azure-Kusto.PublishToADX.ADXQuery.ADXQuery@4
356+
- task: Azure-Kusto.PublishToADX.ADXQuery.ADXQuery@5
272357
displayName: '<Task Display Name>'
273358
inputs:
274359
targetType: 'inline'

0 commit comments

Comments
 (0)