0
# Cluster Management
1
2
Comprehensive lifecycle management of Azure Data Explorer (Kusto) clusters including creation, configuration, scaling, start/stop operations, migration, network diagnostics, and SKU management. Clusters are the primary compute and storage resources that host databases and handle query processing.
3
4
## Capabilities
5
6
### Cluster CRUD Operations
7
8
Core cluster lifecycle operations for creating, reading, updating, and deleting Kusto clusters.
9
10
```python { .api }
11
def get(
12
resource_group_name: str,
13
cluster_name: str,
14
**kwargs
15
) -> Cluster:
16
"""
17
Get a Kusto cluster.
18
19
Parameters:
20
- resource_group_name: Name of the resource group
21
- cluster_name: Name of the Kusto cluster
22
23
Returns:
24
Cluster object with current configuration and state
25
"""
26
27
def begin_create_or_update(
28
resource_group_name: str,
29
cluster_name: str,
30
parameters: Cluster,
31
if_match: str = None,
32
if_none_match: str = None,
33
**kwargs
34
) -> LROPoller[Cluster]:
35
"""
36
Create or update a Kusto cluster.
37
38
Parameters:
39
- resource_group_name: Name of the resource group
40
- cluster_name: Name of the Kusto cluster
41
- parameters: Cluster object with desired configuration
42
- if_match: ETag for optimistic concurrency control
43
- if_none_match: ETag to prevent creation if resource exists
44
45
Returns:
46
LROPoller for the long-running operation returning Cluster
47
"""
48
49
def begin_update(
50
resource_group_name: str,
51
cluster_name: str,
52
parameters: ClusterUpdate,
53
if_match: str = None,
54
**kwargs
55
) -> LROPoller[Cluster]:
56
"""
57
Update an existing Kusto cluster.
58
59
Parameters:
60
- resource_group_name: Name of the resource group
61
- cluster_name: Name of the Kusto cluster
62
- parameters: ClusterUpdate object with changes
63
- if_match: ETag for optimistic concurrency control
64
65
Returns:
66
LROPoller for the long-running operation returning updated Cluster
67
"""
68
69
def begin_delete(
70
resource_group_name: str,
71
cluster_name: str,
72
**kwargs
73
) -> LROPoller[None]:
74
"""
75
Delete a Kusto cluster.
76
77
Parameters:
78
- resource_group_name: Name of the resource group
79
- cluster_name: Name of the Kusto cluster
80
81
Returns:
82
LROPoller for the long-running delete operation
83
"""
84
```
85
86
### Cluster Listing Operations
87
88
Operations to discover and list Kusto clusters across subscriptions and resource groups.
89
90
```python { .api }
91
def list(**kwargs) -> Iterable[Cluster]:
92
"""
93
List all Kusto clusters in the subscription.
94
95
Returns:
96
Iterable of Cluster objects
97
"""
98
99
def list_by_resource_group(
100
resource_group_name: str,
101
**kwargs
102
) -> Iterable[Cluster]:
103
"""
104
List Kusto clusters in a specific resource group.
105
106
Parameters:
107
- resource_group_name: Name of the resource group
108
109
Returns:
110
Iterable of Cluster objects
111
"""
112
```
113
114
### Cluster State Management
115
116
Operations to control cluster runtime state including start, stop, and migration.
117
118
```python { .api }
119
def begin_start(
120
resource_group_name: str,
121
cluster_name: str,
122
**kwargs
123
) -> LROPoller[None]:
124
"""
125
Start a stopped Kusto cluster.
126
127
Parameters:
128
- resource_group_name: Name of the resource group
129
- cluster_name: Name of the Kusto cluster
130
131
Returns:
132
LROPoller for the long-running start operation
133
"""
134
135
def begin_stop(
136
resource_group_name: str,
137
cluster_name: str,
138
**kwargs
139
) -> LROPoller[None]:
140
"""
141
Stop a running Kusto cluster.
142
143
Parameters:
144
- resource_group_name: Name of the resource group
145
- cluster_name: Name of the Kusto cluster
146
147
Returns:
148
LROPoller for the long-running stop operation
149
"""
150
151
def begin_migrate(
152
resource_group_name: str,
153
cluster_name: str,
154
cluster_migrate_request: ClusterMigrateRequest,
155
**kwargs
156
) -> LROPoller[None]:
157
"""
158
Migrate a Kusto cluster to a different region or configuration.
159
160
Parameters:
161
- resource_group_name: Name of the resource group
162
- cluster_name: Name of the Kusto cluster
163
- cluster_migrate_request: Migration configuration
164
165
Returns:
166
LROPoller for the long-running migration operation
167
"""
168
```
169
170
### Follower Database Management
171
172
Operations to manage follower databases that replicate data from leader clusters.
173
174
```python { .api }
175
def list_follower_databases(
176
resource_group_name: str,
177
cluster_name: str,
178
**kwargs
179
) -> Iterable[FollowerDatabaseDefinition]:
180
"""
181
List follower databases attached to this cluster.
182
183
Parameters:
184
- resource_group_name: Name of the resource group
185
- cluster_name: Name of the Kusto cluster
186
187
Returns:
188
Iterable of FollowerDatabaseDefinition objects
189
"""
190
191
def list_follower_databases_get(
192
resource_group_name: str,
193
cluster_name: str,
194
**kwargs
195
) -> Iterable[FollowerDatabaseDefinitionGet]:
196
"""
197
Get follower databases with extended information.
198
199
Parameters:
200
- resource_group_name: Name of the resource group
201
- cluster_name: Name of the Kusto cluster
202
203
Returns:
204
Iterable of FollowerDatabaseDefinitionGet objects
205
"""
206
207
def begin_detach_follower_databases(
208
resource_group_name: str,
209
cluster_name: str,
210
follower_database_to_remove: FollowerDatabaseDefinition,
211
**kwargs
212
) -> LROPoller[None]:
213
"""
214
Detach a follower database from this cluster.
215
216
Parameters:
217
- resource_group_name: Name of the resource group
218
- cluster_name: Name of the Kusto cluster
219
- follower_database_to_remove: Follower database configuration to remove
220
221
Returns:
222
LROPoller for the long-running detach operation
223
"""
224
```
225
226
### Network Diagnostics
227
228
Network connectivity and diagnostics operations for troubleshooting cluster networking issues.
229
230
```python { .api }
231
def begin_diagnose_virtual_network(
232
resource_group_name: str,
233
cluster_name: str,
234
**kwargs
235
) -> LROPoller[DiagnoseVirtualNetworkResult]:
236
"""
237
Diagnose virtual network connectivity issues for the cluster.
238
239
Parameters:
240
- resource_group_name: Name of the resource group
241
- cluster_name: Name of the Kusto cluster
242
243
Returns:
244
LROPoller returning DiagnoseVirtualNetworkResult with diagnostic information
245
"""
246
247
def list_outbound_network_dependencies_endpoints(
248
resource_group_name: str,
249
cluster_name: str,
250
**kwargs
251
) -> Iterable[OutboundNetworkDependenciesEndpoint]:
252
"""
253
List outbound network dependencies for the cluster.
254
255
Parameters:
256
- resource_group_name: Name of the resource group
257
- cluster_name: Name of the Kusto cluster
258
259
Returns:
260
Iterable of OutboundNetworkDependenciesEndpoint objects
261
"""
262
```
263
264
### SKU and Capacity Management
265
266
Operations to manage cluster SKUs and query available compute configurations.
267
268
```python { .api }
269
def list_skus(**kwargs) -> Iterable[SkuDescription]:
270
"""
271
List available SKUs for Kusto clusters.
272
273
Returns:
274
Iterable of SkuDescription objects with available SKU options
275
"""
276
277
def list_skus_by_resource(
278
resource_group_name: str,
279
cluster_name: str,
280
**kwargs
281
) -> Iterable[AzureResourceSku]:
282
"""
283
List available SKUs for a specific cluster resource.
284
285
Parameters:
286
- resource_group_name: Name of the resource group
287
- cluster_name: Name of the Kusto cluster
288
289
Returns:
290
Iterable of AzureResourceSku objects with available SKU options
291
"""
292
293
def check_name_availability(
294
location: str,
295
cluster_name: ClusterCheckNameRequest,
296
**kwargs
297
) -> CheckNameResult:
298
"""
299
Check if a cluster name is available in the specified location.
300
301
Parameters:
302
- location: Azure region location
303
- cluster_name: ClusterCheckNameRequest with name to check
304
305
Returns:
306
CheckNameResult indicating availability and any issues
307
"""
308
```
309
310
### Security Policies
311
312
Operations to manage cluster-level security policies including callout policies for external data access.
313
314
```python { .api }
315
def begin_add_callout_policies(
316
resource_group_name: str,
317
cluster_name: str,
318
callout_policies: CalloutPoliciesList,
319
**kwargs
320
) -> LROPoller[None]:
321
"""
322
Add callout policies to the cluster for external data access.
323
324
Parameters:
325
- resource_group_name: Name of the resource group
326
- cluster_name: Name of the Kusto cluster
327
- callout_policies: List of callout policies to add
328
329
Returns:
330
LROPoller for the long-running operation
331
"""
332
333
def begin_remove_callout_policy(
334
resource_group_name: str,
335
cluster_name: str,
336
callout_policy: CalloutPolicyToRemove,
337
**kwargs
338
) -> LROPoller[None]:
339
"""
340
Remove a callout policy from the cluster.
341
342
Parameters:
343
- resource_group_name: Name of the resource group
344
- cluster_name: Name of the Kusto cluster
345
- callout_policy: Callout policy to remove
346
347
Returns:
348
LROPoller for the long-running operation
349
"""
350
351
def list_callout_policies(
352
resource_group_name: str,
353
cluster_name: str,
354
**kwargs
355
) -> Iterable[CalloutPolicy]:
356
"""
357
List callout policies configured on the cluster.
358
359
Parameters:
360
- resource_group_name: Name of the resource group
361
- cluster_name: Name of the Kusto cluster
362
363
Returns:
364
Iterable of CalloutPolicy objects
365
"""
366
```
367
368
### Language Extensions
369
370
Management of language extensions that enable custom query capabilities in the cluster.
371
372
```python { .api }
373
def list_language_extensions(
374
resource_group_name: str,
375
cluster_name: str,
376
**kwargs
377
) -> Iterable[LanguageExtension]:
378
"""
379
List language extensions installed on the cluster.
380
381
Parameters:
382
- resource_group_name: Name of the resource group
383
- cluster_name: Name of the Kusto cluster
384
385
Returns:
386
Iterable of LanguageExtension objects
387
"""
388
389
def begin_add_language_extensions(
390
resource_group_name: str,
391
cluster_name: str,
392
language_extensions_to_add: LanguageExtensionsList,
393
**kwargs
394
) -> LROPoller[None]:
395
"""
396
Add language extensions to the cluster.
397
398
Parameters:
399
- resource_group_name: Name of the resource group
400
- cluster_name: Name of the Kusto cluster
401
- language_extensions_to_add: List of language extensions to add
402
403
Returns:
404
LROPoller for the long-running operation
405
"""
406
407
def begin_remove_language_extensions(
408
resource_group_name: str,
409
cluster_name: str,
410
language_extensions_to_remove: LanguageExtensionsList,
411
**kwargs
412
) -> LROPoller[None]:
413
"""
414
Remove language extensions from the cluster.
415
416
Parameters:
417
- resource_group_name: Name of the resource group
418
- cluster_name: Name of the Kusto cluster
419
- language_extensions_to_remove: List of language extensions to remove
420
421
Returns:
422
LROPoller for the long-running operation
423
"""
424
```
425
426
## Usage Examples
427
428
### Creating a New Cluster
429
430
```python
431
from azure.mgmt.kusto.models import Cluster, AzureSku, AzureSkuName, AzureSkuTier
432
433
# Configure cluster parameters
434
cluster_params = Cluster(
435
location="East US",
436
sku=AzureSku(
437
name=AzureSkuName.STANDARD_D13_V2,
438
tier=AzureSkuTier.STANDARD,
439
capacity=2
440
),
441
tags={"Environment": "Development", "Team": "Analytics"}
442
)
443
444
# Create the cluster
445
poller = client.clusters.begin_create_or_update(
446
resource_group_name="my-resource-group",
447
cluster_name="my-new-cluster",
448
parameters=cluster_params
449
)
450
451
# Wait for completion (can take 10-15 minutes)
452
cluster = poller.result()
453
print(f"Cluster created: {cluster.uri}")
454
```
455
456
### Scaling a Cluster
457
458
```python
459
from azure.mgmt.kusto.models import ClusterUpdate, AzureSku
460
461
# Get current cluster
462
cluster = client.clusters.get(
463
resource_group_name="my-resource-group",
464
cluster_name="my-cluster"
465
)
466
467
# Update SKU for scaling
468
update_params = ClusterUpdate(
469
sku=AzureSku(
470
name=cluster.sku.name,
471
tier=cluster.sku.tier,
472
capacity=4 # Scale up to 4 instances
473
)
474
)
475
476
# Apply the update
477
poller = client.clusters.begin_update(
478
resource_group_name="my-resource-group",
479
cluster_name="my-cluster",
480
parameters=update_params
481
)
482
483
updated_cluster = poller.result()
484
print(f"Cluster scaled to {updated_cluster.sku.capacity} instances")
485
```
486
487
## Key Types
488
489
```python { .api }
490
class Cluster:
491
"""Represents a Kusto cluster resource."""
492
# Read-only properties
493
id: str # Resource ID
494
name: str # Cluster name
495
type: str # Resource type
496
provisioning_state: ProvisioningState # Current provisioning state
497
state: State # Current cluster state
498
uri: str # Cluster URI for connections
499
data_ingestion_uri: str # Data ingestion endpoint
500
501
# Configurable properties
502
location: str # Azure region
503
tags: Dict[str, str] # Resource tags
504
sku: AzureSku # SKU configuration
505
zones: List[str] # Availability zones
506
identity: Identity # Managed identity
507
accepted_audiences: List[AcceptedAudiences] # Trusted audiences
508
enable_disk_encryption: bool # Disk encryption setting
509
enable_streaming_ingest: bool # Streaming ingestion setting
510
virtual_network_configuration: VirtualNetworkConfiguration # VNet config
511
key_vault_properties: KeyVaultProperties # Key vault for encryption
512
optimized_autoscale: OptimizedAutoscale # Auto-scaling configuration
513
enable_purge: bool # Data purge capability
514
language_extensions: LanguageExtensionsList # Installed extensions
515
enable_double_encryption: bool # Double encryption setting
516
517
class AzureSku:
518
"""SKU configuration for a Kusto cluster."""
519
name: AzureSkuName # SKU name (e.g., Standard_D13_v2)
520
tier: AzureSkuTier # SKU tier (Basic or Standard)
521
capacity: int # Number of instances
522
523
class ClusterUpdate:
524
"""Update parameters for a Kusto cluster."""
525
tags: Dict[str, str] # Updated resource tags
526
location: str # Updated location
527
sku: AzureSku # Updated SKU configuration
528
identity: Identity # Updated managed identity
529
# ... other updatable properties
530
531
from enum import Enum
532
533
class State(str, Enum):
534
"""Cluster state values."""
535
CREATING = "Creating"
536
UNAVAILABLE = "Unavailable"
537
RUNNING = "Running"
538
DELETING = "Deleting"
539
DELETED = "Deleted"
540
STOPPING = "Stopping"
541
STOPPED = "Stopped"
542
STARTING = "Starting"
543
UPDATING = "Updating"
544
MIGRATED = "Migrated"
545
546
class ProvisioningState(str, Enum):
547
"""Provisioning state values."""
548
RUNNING = "Running"
549
CREATING = "Creating"
550
DELETING = "Deleting"
551
SUCCEEDED = "Succeeded"
552
FAILED = "Failed"
553
MOVING = "Moving"
554
CANCELED = "Canceled"
555
```