0
# Azure Synapse Management Client
1
2
Microsoft Azure Synapse Management Client Library provides comprehensive programmatic access to Azure Synapse Analytics resources. This client library enables automation of workspace management, SQL pool operations, Apache Spark pool configuration, integration runtime provisioning, security policy management, and all aspects of Azure Synapse Analytics infrastructure.
3
4
## Package Information
5
6
- **Package Name**: azure-mgmt-synapse
7
- **Language**: Python
8
- **Installation**: `pip install azure-mgmt-synapse`
9
- **Version**: 2.0.0
10
- **Type**: Azure Management Library (AutoRest-generated)
11
12
## Core Imports
13
14
```python
15
from azure.mgmt.synapse import SynapseManagementClient
16
```
17
18
For async operations:
19
20
```python
21
from azure.mgmt.synapse.aio import SynapseManagementClient
22
```
23
24
Import models and types:
25
26
```python
27
from azure.mgmt.synapse.models import (
28
Workspace, SqlPool, BigDataPoolResourceInfo,
29
WorkspacePatchInfo, SqlPoolPatchInfo,
30
IntegrationRuntimeResource, PrivateLinkHub, Key,
31
IpFirewallRuleInfo, PrivateEndpointConnection,
32
SqlPoolBlobAuditingPolicy, LibraryResource
33
)
34
```
35
36
## Basic Usage
37
38
```python
39
from azure.identity import DefaultAzureCredential
40
from azure.mgmt.synapse import SynapseManagementClient
41
42
# Initialize client with Azure credentials
43
credential = DefaultAzureCredential()
44
subscription_id = "your-subscription-id"
45
client = SynapseManagementClient(credential, subscription_id)
46
47
# List all Synapse workspaces in a resource group
48
resource_group = "my-resource-group"
49
workspaces = client.workspaces.list_by_resource_group(resource_group)
50
for workspace in workspaces:
51
print(f"Workspace: {workspace.name}, Location: {workspace.location}")
52
53
# Get a specific workspace
54
workspace_name = "my-synapse-workspace"
55
workspace = client.workspaces.get(resource_group, workspace_name)
56
print(f"Workspace URL: {workspace.connectivity_endpoints.web}")
57
58
# List SQL pools in the workspace
59
sql_pools = client.sql_pools.list_by_workspace(resource_group, workspace_name)
60
for pool in sql_pools:
61
print(f"SQL Pool: {pool.name}, Status: {pool.status}")
62
```
63
64
## Architecture
65
66
Azure Synapse Management Client follows Azure Resource Manager (ARM) patterns:
67
68
- **Client**: `SynapseManagementClient` serves as the main entry point with operation groups as properties
69
- **Operation Groups**: 60+ specialized operation classes for different resource types and capabilities
70
- **Models**: 190+ data classes representing Azure resources, configurations, and responses
71
- **Long-Running Operations**: Many operations return `LROPoller` objects for tracking async operations
72
- **Paging**: List operations return `ItemPaged` objects for handling large result sets
73
74
The client supports both synchronous and asynchronous operations through separate client implementations.
75
76
## Capabilities
77
78
### Workspace Management
79
80
Core Synapse workspace lifecycle management including creation, configuration, monitoring, and administrative operations.
81
82
```python { .api }
83
# Primary workspace operations
84
def get(resource_group_name: str, workspace_name: str) -> Workspace
85
def create_or_update(resource_group_name: str, workspace_name: str, workspace_info: Workspace) -> LROPoller[Workspace]
86
def delete(resource_group_name: str, workspace_name: str) -> LROPoller[object]
87
def list_by_resource_group(resource_group_name: str) -> ItemPaged[Workspace]
88
def list_by_subscription() -> ItemPaged[Workspace]
89
def update(resource_group_name: str, workspace_name: str, workspace_patch_info: WorkspacePatchInfo) -> LROPoller[Workspace]
90
```
91
92
[Workspace Management](./workspace-management.md)
93
94
### SQL Pool Management
95
96
Dedicated SQL pool lifecycle management, configuration, scaling, security, and monitoring operations.
97
98
```python { .api }
99
# Core SQL pool operations
100
def get(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> SqlPool
101
def create(resource_group_name: str, workspace_name: str, sql_pool_name: str, sql_pool_info: SqlPool) -> LROPoller[SqlPool]
102
def delete(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> LROPoller[object]
103
def pause(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> LROPoller[object]
104
def resume(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> LROPoller[object]
105
def list_by_workspace(resource_group_name: str, workspace_name: str) -> ItemPaged[SqlPool]
106
```
107
108
[SQL Pool Management](./sql-pool-management.md)
109
110
### Apache Spark Pool Management
111
112
Big data pool (Apache Spark) configuration, auto-scaling, library management, and lifecycle operations.
113
114
```python { .api }
115
# Big data pool operations
116
def get(resource_group_name: str, workspace_name: str, big_data_pool_name: str) -> BigDataPoolResourceInfo
117
def create_or_update(resource_group_name: str, workspace_name: str, big_data_pool_name: str, big_data_pool_info: BigDataPoolResourceInfo) -> LROPoller[BigDataPoolResourceInfo]
118
def delete(resource_group_name: str, workspace_name: str, big_data_pool_name: str) -> LROPoller[object]
119
def list_by_workspace(resource_group_name: str, workspace_name: str) -> ItemPaged[BigDataPoolResourceInfo]
120
```
121
122
[Apache Spark Pool Management](./spark-pool-management.md)
123
124
### SQL Pool Security
125
126
Comprehensive security management including auditing, vulnerability assessments, data classification, masking, and threat protection.
127
128
```python { .api }
129
# Security operations
130
def get_blob_auditing_policy(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> SqlPoolBlobAuditingPolicy
131
def create_or_update_blob_auditing_policy(resource_group_name: str, workspace_name: str, sql_pool_name: str, parameters: SqlPoolBlobAuditingPolicy) -> SqlPoolBlobAuditingPolicy
132
def get_vulnerability_assessment(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> SqlPoolVulnerabilityAssessment
133
def get_security_alert_policy(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> SqlPoolSecurityAlertPolicy
134
```
135
136
[SQL Pool Security](./sql-pool-security.md)
137
138
### Integration Runtime Management
139
140
Integration runtime provisioning, configuration, monitoring, and credential management for data integration scenarios.
141
142
```python { .api }
143
# Integration runtime operations
144
def get(resource_group_name: str, workspace_name: str, integration_runtime_name: str) -> IntegrationRuntimeResource
145
def create(resource_group_name: str, workspace_name: str, integration_runtime_name: str, integration_runtime: IntegrationRuntimeResource) -> LROPoller[IntegrationRuntimeResource]
146
def delete(resource_group_name: str, workspace_name: str, integration_runtime_name: str) -> LROPoller[object]
147
def list_by_workspace(resource_group_name: str, workspace_name: str) -> ItemPaged[IntegrationRuntimeResource]
148
def start(resource_group_name: str, workspace_name: str, integration_runtime_name: str) -> LROPoller[IntegrationRuntimeStatusResponse]
149
def stop(resource_group_name: str, workspace_name: str, integration_runtime_name: str) -> LROPoller[object]
150
```
151
152
[Integration Runtime Management](./integration-runtime-management.md)
153
154
### Library Management
155
156
Limited library inspection capabilities for workspace libraries. Note: This SDK provides read-only access to libraries - creation, upload, and management operations are not available through this management client.
157
158
```python { .api }
159
# Library operations (read-only)
160
def get(resource_group_name: str, workspace_name: str, library_name: str) -> LibraryResource
161
def list_by_workspace(resource_group_name: str, workspace_name: str) -> ItemPaged[LibraryListResponse]
162
```
163
164
### Private Link Hubs Management
165
166
Private Link Hub creation, configuration, and management for enabling secure connectivity to Synapse resources through private endpoints.
167
168
```python { .api }
169
# Private Link Hub operations
170
def get(resource_group_name: str, private_link_hub_name: str) -> PrivateLinkHub
171
def create_or_update(resource_group_name: str, private_link_hub_name: str, private_link_hub: PrivateLinkHub) -> PrivateLinkHub
172
def update(resource_group_name: str, private_link_hub_name: str, private_link_hub_patch_info: PrivateLinkHubPatchInfo) -> PrivateLinkHub
173
def delete(resource_group_name: str, private_link_hub_name: str) -> LROPoller[object]
174
def list_by_resource_group(resource_group_name: str) -> ItemPaged[PrivateLinkHub]
175
def list() -> ItemPaged[PrivateLinkHub]
176
```
177
178
### Keys Management
179
180
Workspace key lifecycle management including customer-managed keys for encryption and access control.
181
182
```python { .api }
183
# Key operations
184
def get(resource_group_name: str, workspace_name: str, key_name: str) -> Key
185
def create_or_update(resource_group_name: str, workspace_name: str, key_name: str, key_properties: Key) -> Key
186
def delete(resource_group_name: str, workspace_name: str, key_name: str) -> Key
187
def list_by_workspace(resource_group_name: str, workspace_name: str) -> ItemPaged[Key]
188
```
189
190
### Network and Security
191
192
Network isolation, private endpoints, firewall rules, and connectivity management for secure Synapse deployments.
193
194
```python { .api }
195
# Network security operations
196
def get_ip_firewall_rule(resource_group_name: str, workspace_name: str, rule_name: str) -> IpFirewallRuleInfo
197
def create_or_update_ip_firewall_rule(resource_group_name: str, workspace_name: str, rule_name: str, ip_firewall_rule_info: IpFirewallRuleInfo) -> LROPoller[IpFirewallRuleInfo]
198
def get_private_endpoint_connection(resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str) -> PrivateEndpointConnection
199
def create_private_endpoint_connection(resource_group_name: str, workspace_name: str, private_endpoint_connection_name: str, request: PrivateEndpointConnection) -> LROPoller[PrivateEndpointConnection]
200
```
201
202
### SQL Pool Schema Management
203
204
Database schema, table, column, and metadata operations for SQL pool data structures.
205
206
```python { .api }
207
# Schema management operations
208
def list_schemas(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> ItemPaged[SqlPoolSchema]
209
def list_tables(resource_group_name: str, workspace_name: str, sql_pool_name: str, schema_name: str) -> ItemPaged[SqlPoolTable]
210
def list_table_columns(resource_group_name: str, workspace_name: str, sql_pool_name: str, schema_name: str, table_name: str) -> ItemPaged[SqlPoolColumn]
211
def get_column(resource_group_name: str, workspace_name: str, sql_pool_name: str, schema_name: str, table_name: str, column_name: str) -> SqlPoolColumn
212
```
213
214
[SQL Pool Management](./sql-pool-management.md)
215
216
### Monitoring and Operations
217
218
Operation monitoring, usage metrics, restore points, and maintenance management across all Synapse resources.
219
220
```python { .api }
221
# Monitoring operations
222
def list_sql_pool_operations(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> ItemPaged[SqlPoolOperation]
223
def list_usages(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> ItemPaged[SqlPoolUsage]
224
def list_restore_points(resource_group_name: str, workspace_name: str, sql_pool_name: str) -> ItemPaged[RestorePoint]
225
def create_restore_point(resource_group_name: str, workspace_name: str, sql_pool_name: str, parameters: CreateSqlPoolRestorePointDefinition) -> LROPoller[RestorePoint]
226
```
227
228
[SQL Pool Management](./sql-pool-management.md)
229
230
## Error Handling
231
232
All operations may raise Azure-specific exceptions that should be handled appropriately:
233
234
```python
235
from azure.core.exceptions import (
236
ClientAuthenticationError,
237
HttpResponseError,
238
ResourceExistsError,
239
ResourceNotFoundError
240
)
241
from azure.mgmt.core.exceptions import ARMErrorFormat
242
243
try:
244
workspace = client.workspaces.get(resource_group, workspace_name)
245
except ResourceNotFoundError:
246
print("Workspace not found")
247
except ClientAuthenticationError:
248
print("Authentication failed")
249
except HttpResponseError as e:
250
print(f"HTTP error: {e.status_code} - {e.message}")
251
```
252
253
## Async Operations
254
255
For async operations, use the aio client with the same interface:
256
257
```python
258
import asyncio
259
from azure.identity.aio import DefaultAzureCredential
260
from azure.mgmt.synapse.aio import SynapseManagementClient
261
262
async def list_workspaces():
263
credential = DefaultAzureCredential()
264
async with SynapseManagementClient(credential, subscription_id) as client:
265
workspaces = client.workspaces.list_by_resource_group(resource_group)
266
async for workspace in workspaces:
267
print(f"Workspace: {workspace.name}")
268
269
asyncio.run(list_workspaces())
270
```
271
272
## Core Types
273
274
Essential types and models used throughout the Azure Synapse Management Client:
275
276
```python { .api }
277
# Core resource types
278
class SynapseManagementClient:
279
"""Main client for Azure Synapse Management operations"""
280
def __init__(self, credential: TokenCredential, subscription_id: str, base_url: Optional[str] = None) -> None: ...
281
def close(self) -> None: ...
282
283
class Workspace(TrackedResource):
284
"""Synapse workspace resource"""
285
identity: Optional[ManagedIdentity]
286
default_data_lake_storage: Optional[DataLakeStorageAccountDetails]
287
sql_administrator_login_password: Optional[str]
288
managed_resource_group_name: Optional[str]
289
provisioning_state: Optional[str]
290
sql_administrator_login: Optional[str]
291
virtual_network_profile: Optional[VirtualNetworkProfile]
292
connectivity_endpoints: Optional[Dict[str, str]]
293
managed_virtual_network: Optional[str]
294
private_endpoint_connections: Optional[List[PrivateEndpointConnection]]
295
encryption: Optional[EncryptionDetails]
296
workspace_uid: Optional[str]
297
extra_properties: Optional[Dict[str, Any]]
298
managed_virtual_network_settings: Optional[ManagedVirtualNetworkSettings]
299
workspace_repository_configuration: Optional[WorkspaceRepositoryConfiguration]
300
purview_configuration: Optional[PurviewConfiguration]
301
302
class SqlPool(TrackedResource):
303
"""SQL pool resource"""
304
sku: Optional[Sku]
305
max_size_bytes: Optional[int]
306
collation: Optional[str]
307
source_database_id: Optional[str]
308
recoverable_database_id: Optional[str]
309
provisioning_state: Optional[str]
310
status: Optional[str]
311
restore_point_in_time: Optional[datetime]
312
create_mode: Optional[str]
313
creation_date: Optional[datetime]
314
storage_account_type: Optional[StorageAccountType]
315
316
class BigDataPoolResourceInfo(TrackedResource):
317
"""Big Data (Spark) pool resource"""
318
provisioning_state: Optional[str]
319
auto_scale: Optional[AutoScaleProperties]
320
creation_date: Optional[datetime]
321
auto_pause: Optional[AutoPauseProperties]
322
is_compute_isolation_enabled: Optional[bool]
323
have_library_requirements_changed: Optional[bool]
324
session_level_packages_enabled: Optional[bool]
325
cache_size: Optional[int]
326
dynamic_executor_allocation: Optional[DynamicExecutorAllocation]
327
spark_events_folder: Optional[str]
328
node_count: Optional[int]
329
library_requirements: Optional[LibraryRequirements]
330
custom_libraries: Optional[List[LibraryInfo]]
331
spark_config_properties: Optional[Dict[str, str]]
332
spark_version: Optional[str]
333
default_spark_log_folder: Optional[str]
334
node_size: Optional[NodeSize]
335
node_size_family: Optional[NodeSizeFamily]
336
337
class IntegrationRuntimeResource(SubResource):
338
"""Integration runtime resource"""
339
properties: Optional[IntegrationRuntime]
340
name: Optional[str]
341
type: Optional[str]
342
etag: Optional[str]
343
344
class PrivateLinkHub(Resource):
345
"""Private Link Hub resource"""
346
name: Optional[str]
347
id: Optional[str]
348
type: Optional[str]
349
tags: Optional[Dict[str, str]]
350
location: Optional[str]
351
provisioning_state: Optional[str]
352
private_endpoint_connections: Optional[List[PrivateEndpointConnectionForPrivateLinkHubBasic]]
353
354
class Key:
355
"""Workspace key resource"""
356
is_active_cmk: Optional[bool]
357
key_vault_url: Optional[str]
358
name: Optional[str]
359
360
# Common operation result types
361
class LROPoller(Generic[T]):
362
"""Long-running operation poller"""
363
def result(self, timeout: Optional[int] = None) -> T: ...
364
def wait(self, timeout: Optional[int] = None) -> None: ...
365
def done(self) -> bool: ...
366
def status(self) -> str: ...
367
368
class ItemPaged(Generic[T]):
369
"""Paged result iterator"""
370
def __iter__(self) -> Iterator[T]: ...
371
372
# Security and auditing types
373
class SqlPoolBlobAuditingPolicy(ProxyResource):
374
"""SQL pool blob auditing policy"""
375
kind: Optional[str]
376
state: Optional[BlobAuditingPolicyState]
377
storage_endpoint: Optional[str]
378
storage_account_access_key: Optional[str]
379
retention_days: Optional[int]
380
audit_actions_and_groups: Optional[List[str]]
381
storage_account_subscription_id: Optional[str]
382
is_storage_secondary_key_in_use: Optional[bool]
383
is_azure_monitor_target_enabled: Optional[bool]
384
385
class SqlPoolVulnerabilityAssessment(ProxyResource):
386
"""SQL pool vulnerability assessment"""
387
storage_container_path: Optional[str]
388
storage_container_sas_key: Optional[str]
389
storage_account_access_key: Optional[str]
390
recurring_scans: Optional[VulnerabilityAssessmentRecurringScansProperties]
391
392
# Common enums
393
class BlobAuditingPolicyState(str, Enum):
394
ENABLED = "Enabled"
395
DISABLED = "Disabled"
396
397
class NodeSize(str, Enum):
398
NONE = "None"
399
SMALL = "Small"
400
MEDIUM = "Medium"
401
LARGE = "Large"
402
XLARGE = "XLarge"
403
XXLARGE = "XXLarge"
404
XXXLARGE = "XXXLarge"
405
406
class IntegrationRuntimeState(str, Enum):
407
INITIAL = "Initial"
408
STOPPED = "Stopped"
409
STARTED = "Started"
410
STARTING = "Starting"
411
STOPPING = "Stopping"
412
NEED_REGISTRATION = "NeedRegistration"
413
ONLINE = "Online"
414
LIMITED = "Limited"
415
OFFLINE = "Offline"
416
ACCESS_DENIED = "AccessDenied"
417
418
class ProvisioningState(str, Enum):
419
PROVISIONING = "Provisioning"
420
SUCCEEDED = "Succeeded"
421
DELETING = "Deleting"
422
FAILED = "Failed"
423
DELETE_ERROR = "DeleteError"
424
```