0
# Workspace Management
1
2
Core Synapse workspace lifecycle management including creation, configuration, monitoring, and administrative operations. Workspaces serve as the top-level container for all Synapse resources and provide the foundation for data integration, analytics, and machine learning workflows.
3
4
## Capabilities
5
6
### Workspace Operations
7
8
Fundamental workspace management operations including creation, retrieval, updates, and deletion.
9
10
```python { .api }
11
def get(resource_group_name: str, workspace_name: str) -> Workspace:
12
"""
13
Get a workspace.
14
15
Parameters:
16
- resource_group_name (str): Name of the resource group
17
- workspace_name (str): Name of the workspace
18
19
Returns:
20
Workspace: The workspace object
21
"""
22
23
def create_or_update(resource_group_name: str, workspace_name: str, workspace_info: Workspace) -> LROPoller[Workspace]:
24
"""
25
Create or update a workspace.
26
27
Parameters:
28
- resource_group_name (str): Name of the resource group
29
- workspace_name (str): Name of the workspace
30
- workspace_info (Workspace): Workspace properties
31
32
Returns:
33
LROPoller[Workspace]: Long-running operation poller
34
"""
35
36
def delete(resource_group_name: str, workspace_name: str) -> LROPoller[object]:
37
"""
38
Delete a workspace.
39
40
Parameters:
41
- resource_group_name (str): Name of the resource group
42
- workspace_name (str): Name of the workspace
43
44
Returns:
45
LROPoller[object]: Long-running operation poller
46
"""
47
48
def update(resource_group_name: str, workspace_name: str, workspace_patch_info: WorkspacePatchInfo) -> LROPoller[Workspace]:
49
"""
50
Update workspace properties.
51
52
Parameters:
53
- resource_group_name (str): Name of the resource group
54
- workspace_name (str): Name of the workspace
55
- workspace_patch_info (WorkspacePatchInfo): Update parameters
56
57
Returns:
58
LROPoller[Workspace]: Long-running operation poller
59
"""
60
```
61
62
### Workspace Listing
63
64
Operations to list and discover workspaces across resource groups and subscriptions.
65
66
```python { .api }
67
def list_by_resource_group(resource_group_name: str) -> ItemPaged[Workspace]:
68
"""
69
List workspaces in a resource group.
70
71
Parameters:
72
- resource_group_name (str): Name of the resource group
73
74
Returns:
75
ItemPaged[Workspace]: Paged collection of workspaces
76
"""
77
78
def list_by_subscription() -> ItemPaged[Workspace]:
79
"""
80
List workspaces in a subscription.
81
82
Returns:
83
ItemPaged[Workspace]: Paged collection of workspaces
84
"""
85
```
86
87
### Workspace Administration
88
89
Administrative operations for workspace management including Azure AD integration and managed identity configuration.
90
91
```python { .api }
92
def get_aad_admin(resource_group_name: str, workspace_name: str) -> WorkspaceAadAdminInfo:
93
"""
94
Get workspace Azure AD administrator.
95
96
Parameters:
97
- resource_group_name (str): Name of the resource group
98
- workspace_name (str): Name of the workspace
99
100
Returns:
101
WorkspaceAadAdminInfo: Azure AD admin information
102
"""
103
104
def create_or_update_aad_admin(resource_group_name: str, workspace_name: str, aad_admin_info: WorkspaceAadAdminInfo) -> LROPoller[WorkspaceAadAdminInfo]:
105
"""
106
Set workspace Azure AD administrator.
107
108
Parameters:
109
- resource_group_name (str): Name of the resource group
110
- workspace_name (str): Name of the workspace
111
- aad_admin_info (WorkspaceAadAdminInfo): Azure AD admin configuration
112
113
Returns:
114
LROPoller[WorkspaceAadAdminInfo]: Long-running operation poller
115
"""
116
117
def delete_aad_admin(resource_group_name: str, workspace_name: str) -> LROPoller[object]:
118
"""
119
Remove workspace Azure AD administrator.
120
121
Parameters:
122
- resource_group_name (str): Name of the resource group
123
- workspace_name (str): Name of the workspace
124
125
Returns:
126
LROPoller[object]: Long-running operation poller
127
"""
128
```
129
130
### SQL AAD Administration
131
132
SQL-specific Azure AD administrator management for workspace SQL pools.
133
134
```python { .api }
135
def get_sql_aad_admin(resource_group_name: str, workspace_name: str) -> WorkspaceAadAdminInfo:
136
"""
137
Get workspace SQL Azure AD administrator.
138
139
Parameters:
140
- resource_group_name (str): Name of the resource group
141
- workspace_name (str): Name of the workspace
142
143
Returns:
144
WorkspaceAadAdminInfo: SQL Azure AD admin information
145
"""
146
147
def create_or_update_sql_aad_admin(resource_group_name: str, workspace_name: str, aad_admin_info: WorkspaceAadAdminInfo) -> LROPoller[WorkspaceAadAdminInfo]:
148
"""
149
Set workspace SQL Azure AD administrator.
150
151
Parameters:
152
- resource_group_name (str): Name of the resource group
153
- workspace_name (str): Name of the workspace
154
- aad_admin_info (WorkspaceAadAdminInfo): SQL Azure AD admin configuration
155
156
Returns:
157
LROPoller[WorkspaceAadAdminInfo]: Long-running operation poller
158
"""
159
160
def delete_sql_aad_admin(resource_group_name: str, workspace_name: str) -> LROPoller[object]:
161
"""
162
Remove workspace SQL Azure AD administrator.
163
164
Parameters:
165
- resource_group_name (str): Name of the resource group
166
- workspace_name (str): Name of the workspace
167
168
Returns:
169
LROPoller[object]: Long-running operation poller
170
"""
171
```
172
173
### Managed Identity SQL Control
174
175
Configure managed identity access control for SQL operations within the workspace.
176
177
```python { .api }
178
def get_managed_identity_sql_control_settings(resource_group_name: str, workspace_name: str) -> ManagedIdentitySqlControlSettingsModel:
179
"""
180
Get managed identity SQL control settings.
181
182
Parameters:
183
- resource_group_name (str): Name of the resource group
184
- workspace_name (str): Name of the workspace
185
186
Returns:
187
ManagedIdentitySqlControlSettingsModel: Managed identity SQL control settings
188
"""
189
190
def create_or_update_managed_identity_sql_control_settings(resource_group_name: str, workspace_name: str, managed_identity_sql_control_settings: ManagedIdentitySqlControlSettingsModel) -> LROPoller[ManagedIdentitySqlControlSettingsModel]:
191
"""
192
Set managed identity SQL control settings.
193
194
Parameters:
195
- resource_group_name (str): Name of the resource group
196
- workspace_name (str): Name of the workspace
197
- managed_identity_sql_control_settings (ManagedIdentitySqlControlSettingsModel): Settings configuration
198
199
Returns:
200
LROPoller[ManagedIdentitySqlControlSettingsModel]: Long-running operation poller
201
"""
202
```
203
204
## Types
205
206
### Workspace
207
208
```python { .api }
209
class Workspace:
210
"""
211
A workspace.
212
213
Attributes:
214
- id (str): Resource ID
215
- name (str): Resource name
216
- type (str): Resource type
217
- location (str): Resource location
218
- tags (dict): Resource tags
219
- identity (ManagedIdentity): Managed identity configuration
220
- default_data_lake_storage (DataLakeStorageAccountDetails): Default storage account
221
- sql_administrator_login_password (str): SQL admin password
222
- managed_virtual_network (str): Managed virtual network name
223
- connectivity_endpoints (dict): Service connectivity endpoints
224
- managed_resource_group_name (str): Managed resource group name
225
- provisioning_state (str): Provisioning state
226
- encryption (EncryptionDetails): Encryption configuration
227
- workspace_uid (str): Workspace unique identifier
228
- extra_properties (dict): Additional properties
229
- managed_virtual_network_settings (ManagedVirtualNetworkSettings): VNet settings
230
- workspace_repository_configuration (WorkspaceRepositoryConfiguration): Git repo config
231
- purview_configuration (PurviewConfiguration): Purview integration
232
- adla_resource_id (str): Azure Data Lake Analytics resource ID
233
- public_network_access (str): Public network access setting
234
"""
235
```
236
237
### WorkspacePatchInfo
238
239
```python { .api }
240
class WorkspacePatchInfo:
241
"""
242
Workspace patch properties.
243
244
Attributes:
245
- tags (dict): Resource tags
246
- identity (ManagedIdentity): Managed identity configuration
247
- sql_administrator_login_password (str): SQL admin password
248
- managed_virtual_network_settings (ManagedVirtualNetworkSettings): VNet settings
249
- workspace_repository_configuration (WorkspaceRepositoryConfiguration): Git repo config
250
- purview_configuration (PurviewConfiguration): Purview integration
251
- public_network_access (str): Public network access setting
252
- encryption (EncryptionDetails): Encryption configuration
253
"""
254
```
255
256
### WorkspaceAadAdminInfo
257
258
```python { .api }
259
class WorkspaceAadAdminInfo:
260
"""
261
Workspace Azure AD administrator properties.
262
263
Attributes:
264
- tenant_id (str): Azure AD tenant ID
265
- login (str): Administrator login name
266
- administrator_type (str): Administrator type
267
- sid (str): Administrator object ID
268
"""
269
```
270
271
### ManagedIdentitySqlControlSettingsModel
272
273
```python { .api }
274
class ManagedIdentitySqlControlSettingsModel:
275
"""
276
Managed identity SQL control settings.
277
278
Attributes:
279
- grant_sql_control_to_managed_identity (ManagedIdentitySqlControlSettingsModelPropertiesGrantSqlControlToManagedIdentity): Grant settings
280
"""
281
```
282
283
## Usage Examples
284
285
### Create a New Workspace
286
287
```python
288
from azure.mgmt.synapse.models import (
289
Workspace, DataLakeStorageAccountDetails, ManagedIdentity
290
)
291
292
# Configure workspace properties
293
data_lake_storage = DataLakeStorageAccountDetails(
294
account_url="https://mystorageaccount.dfs.core.windows.net",
295
filesystem="myfilesystem"
296
)
297
298
identity = ManagedIdentity(type="SystemAssigned")
299
300
workspace_info = Workspace(
301
location="East US",
302
default_data_lake_storage=data_lake_storage,
303
sql_administrator_login="sqladmin",
304
sql_administrator_login_password="ComplexPassword123!",
305
identity=identity,
306
managed_resource_group_name="synapse-managed-rg"
307
)
308
309
# Create the workspace
310
operation = client.workspaces.create_or_update(
311
resource_group_name="my-resource-group",
312
workspace_name="my-synapse-workspace",
313
workspace_info=workspace_info
314
)
315
316
workspace = operation.result() # Wait for completion
317
print(f"Created workspace: {workspace.name}")
318
```
319
320
### Configure Azure AD Administrator
321
322
```python
323
from azure.mgmt.synapse.models import WorkspaceAadAdminInfo
324
325
aad_admin = WorkspaceAadAdminInfo(
326
tenant_id="your-tenant-id",
327
login="admin@domain.com",
328
administrator_type="ActiveDirectory",
329
sid="object-id-of-admin-user"
330
)
331
332
operation = client.workspace_aad_admins.create_or_update_aad_admin(
333
resource_group_name="my-resource-group",
334
workspace_name="my-synapse-workspace",
335
aad_admin_info=aad_admin
336
)
337
338
admin_info = operation.result()
339
print(f"Set Azure AD admin: {admin_info.login}")
340
```