0
# Service Management
1
2
Core API Management service lifecycle operations including creating, updating, configuring, and monitoring API Management instances. Includes service-level settings, SKU management, network configuration, backup/restore capabilities, and multi-region deployment.
3
4
## Capabilities
5
6
### Service Lifecycle Operations
7
8
Fundamental operations for managing API Management service instances throughout their lifecycle.
9
10
```python { .api }
11
class ApiManagementServiceOperations:
12
def get(self, resource_group_name: str, service_name: str, **kwargs) -> ApiManagementServiceResource: ...
13
def begin_create_or_update(self, resource_group_name: str, service_name: str, parameters: ApiManagementServiceResource, **kwargs) -> LROPoller[ApiManagementServiceResource]: ...
14
def begin_update(self, resource_group_name: str, service_name: str, parameters: ApiManagementServiceUpdateParameters, **kwargs) -> LROPoller[ApiManagementServiceResource]: ...
15
def begin_delete(self, resource_group_name: str, service_name: str, **kwargs) -> LROPoller[None]: ...
16
def list_by_subscription(self, **kwargs) -> ItemPaged[ApiManagementServiceResource]: ...
17
def list_by_resource_group(self, resource_group_name: str, **kwargs) -> ItemPaged[ApiManagementServiceResource]: ...
18
def get_sso_token(self, resource_group_name: str, service_name: str, **kwargs) -> ApiManagementServiceGetSsoTokenResult: ...
19
def check_name_availability(self, parameters: ApiManagementServiceCheckNameAvailabilityParameters, **kwargs) -> ApiManagementServiceNameAvailabilityResult: ...
20
def get_domain_ownership_identifier(self, **kwargs) -> ApiManagementServiceGetDomainOwnershipIdentifierResult: ...
21
def begin_apply_network_configuration_updates(self, resource_group_name: str, service_name: str, parameters: Optional[ApiManagementServiceApplyNetworkConfigurationParameters] = None, **kwargs) -> LROPoller[ApiManagementServiceResource]: ...
22
def begin_backup(self, resource_group_name: str, service_name: str, parameters: ApiManagementServiceBackupRestoreParameters, **kwargs) -> LROPoller[ApiManagementServiceResource]: ...
23
def begin_restore(self, resource_group_name: str, service_name: str, parameters: ApiManagementServiceBackupRestoreParameters, **kwargs) -> LROPoller[ApiManagementServiceResource]: ...
24
```
25
26
### Service SKU Management
27
28
Management of service pricing tiers and capacity scaling operations.
29
30
```python { .api }
31
class ApiManagementServiceSkusOperations:
32
def list_available_service_skus(self, resource_group_name: str, service_name: str, **kwargs) -> ItemPaged[ResourceSkuResult]: ...
33
34
class ApiManagementSkusOperations:
35
def list(self, **kwargs) -> ItemPaged[ApiManagementSku]: ...
36
```
37
38
### Deleted Services Recovery
39
40
Operations for managing and recovering soft-deleted API Management services.
41
42
```python { .api }
43
class DeletedServicesOperations:
44
def get_by_name(self, service_name: str, location: str, **kwargs) -> DeletedServiceContract: ...
45
def list_by_subscription(self, **kwargs) -> ItemPaged[DeletedServiceContract]: ...
46
def purge(self, service_name: str, location: str, **kwargs) -> LROPoller[DeletedServiceContract]: ...
47
```
48
49
### Network Status Operations
50
51
Network connectivity and status monitoring for API Management services.
52
53
```python { .api }
54
class NetworkStatusOperations:
55
def list_by_service(self, resource_group_name: str, service_name: str, **kwargs) -> List[NetworkStatusContract]: ...
56
def list_by_location(self, resource_group_name: str, service_name: str, location_name: str, **kwargs) -> NetworkStatusContract: ...
57
```
58
59
### Outbound Network Dependencies
60
61
Management of outbound network dependencies and connectivity requirements.
62
63
```python { .api }
64
class OutboundNetworkDependenciesEndpointsOperations:
65
def list_by_service(self, resource_group_name: str, service_name: str, **kwargs) -> ItemPaged[OutboundNetworkDependenciesEndpoints]: ...
66
```
67
68
### Operations Management
69
70
Discovery and management of available operations for the API Management service.
71
72
```python { .api }
73
class ApiManagementOperationsOperations:
74
def list(self, **kwargs) -> ItemPaged[OperationDisplay]: ...
75
```
76
77
### Region Operations
78
79
Multi-region deployment and geographic distribution management.
80
81
```python { .api }
82
class RegionOperations:
83
def list_by_service(self, resource_group_name: str, service_name: str, **kwargs) -> ItemPaged[RegionContract]: ...
84
```
85
86
### Tenant Configuration
87
88
Tenant-level configuration management including Git synchronization and access settings.
89
90
```python { .api }
91
class TenantConfigurationOperations:
92
def deploy(self, resource_group_name: str, service_name: str, configuration_name: str, parameters: DeployConfigurationParameters, **kwargs) -> LROPoller[OperationResultContract]: ...
93
def save(self, resource_group_name: str, service_name: str, configuration_name: str, parameters: SaveConfigurationParameter, **kwargs) -> LROPoller[OperationResultContract]: ...
94
def validate(self, resource_group_name: str, service_name: str, configuration_name: str, parameters: DeployConfigurationParameters, **kwargs) -> LROPoller[OperationResultContract]: ...
95
def get_sync_state(self, resource_group_name: str, service_name: str, configuration_name: str, **kwargs) -> TenantConfigurationSyncStateContract: ...
96
97
class TenantAccessOperations:
98
def get(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> AccessInformationContract: ...
99
def update(self, resource_group_name: str, service_name: str, access_name: str, if_match: str, parameters: AccessInformationUpdateParameters, **kwargs) -> AccessInformationContract: ...
100
def list_by_service(self, resource_group_name: str, service_name: str, filter: Optional[str] = None, **kwargs) -> ItemPaged[AccessInformationContract]: ...
101
def regenerate_primary_key(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> None: ...
102
def regenerate_secondary_key(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> None: ...
103
def list_secrets(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> AccessInformationSecretsContract: ...
104
def get_entity_tag(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> bool: ...
105
106
class TenantAccessGitOperations:
107
def get(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> AccessInformationContract: ...
108
def regenerate_primary_key(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> None: ...
109
def regenerate_secondary_key(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> None: ...
110
def list_secrets(self, resource_group_name: str, service_name: str, access_name: str, **kwargs) -> AccessInformationSecretsContract: ...
111
```
112
113
### Tenant Settings
114
115
Global tenant settings and configuration management.
116
117
```python { .api }
118
class TenantSettingsOperations:
119
def get(self, resource_group_name: str, service_name: str, settings_type: str, **kwargs) -> TenantSettingsContract: ...
120
def list_by_service(self, resource_group_name: str, service_name: str, filter: Optional[str] = None, **kwargs) -> ItemPaged[TenantSettingsContract]: ...
121
```
122
123
## Usage Examples
124
125
### Creating a New API Management Service
126
127
```python
128
from azure.mgmt.apimanagement.models import (
129
ApiManagementServiceResource,
130
ApiManagementServiceProperties,
131
ApiManagementServiceSkuProperties,
132
SkuType,
133
VirtualNetworkType
134
)
135
136
# Define service properties
137
service_properties = ApiManagementServiceProperties(
138
publisher_name="Contoso",
139
publisher_email="admin@contoso.com",
140
sku=ApiManagementServiceSkuProperties(
141
name=SkuType.DEVELOPER,
142
capacity=1
143
),
144
location="East US",
145
virtual_network_type=VirtualNetworkType.NONE
146
)
147
148
# Create service resource
149
service_resource = ApiManagementServiceResource(
150
location="East US",
151
properties=service_properties,
152
tags={"Environment": "Development", "Team": "API"}
153
)
154
155
# Create the service
156
service = client.api_management_service.begin_create_or_update(
157
resource_group_name="my-resource-group",
158
service_name="my-apim-service",
159
parameters=service_resource
160
).result()
161
162
print(f"Created service: {service.name} in {service.location}")
163
```
164
165
### Updating Service Configuration
166
167
```python
168
from azure.mgmt.apimanagement.models import ApiManagementServiceUpdateParameters
169
170
# Update service settings
171
update_params = ApiManagementServiceUpdateParameters(
172
properties=ApiManagementServiceUpdateProperties(
173
publisher_name="Updated Publisher Name",
174
publisher_email="newemail@contoso.com",
175
sku=ApiManagementServiceSkuProperties(
176
name=SkuType.STANDARD,
177
capacity=2 # Scale up
178
)
179
),
180
tags={"Environment": "Production", "Team": "API", "CostCenter": "IT"}
181
)
182
183
# Apply updates
184
updated_service = client.api_management_service.begin_update(
185
resource_group_name="my-resource-group",
186
service_name="my-apim-service",
187
parameters=update_params
188
).result()
189
190
print(f"Updated service SKU to: {updated_service.properties.sku.name}")
191
```
192
193
### Service Backup and Restore
194
195
```python
196
from azure.mgmt.apimanagement.models import ApiManagementServiceBackupRestoreParameters
197
198
# Backup service
199
backup_params = ApiManagementServiceBackupRestoreParameters(
200
storage_account="mybackupstorage",
201
container_name="apim-backups",
202
backup_name="apim-backup-2023-09-07",
203
access_type="SystemAssignedManagedIdentity"
204
)
205
206
# Start backup operation
207
backup_operation = client.api_management_service.begin_backup(
208
resource_group_name="my-resource-group",
209
service_name="my-apim-service",
210
parameters=backup_params
211
)
212
213
backup_result = backup_operation.result()
214
print(f"Backup completed for service: {backup_result.name}")
215
216
# Restore service from backup
217
restore_params = ApiManagementServiceBackupRestoreParameters(
218
storage_account="mybackupstorage",
219
container_name="apim-backups",
220
backup_name="apim-backup-2023-09-07",
221
access_type="SystemAssignedManagedIdentity"
222
)
223
224
restore_operation = client.api_management_service.begin_restore(
225
resource_group_name="my-resource-group",
226
service_name="my-apim-service",
227
parameters=restore_params
228
)
229
230
restored_service = restore_operation.result()
231
print(f"Service restored: {restored_service.name}")
232
```
233
234
### Network Configuration
235
236
```python
237
from azure.mgmt.apimanagement.models import ApiManagementServiceApplyNetworkConfigurationParameters
238
239
# Apply network configuration updates
240
network_config = ApiManagementServiceApplyNetworkConfigurationParameters(
241
location="East US"
242
)
243
244
# Apply network updates
245
network_operation = client.api_management_service.begin_apply_network_configuration_updates(
246
resource_group_name="my-resource-group",
247
service_name="my-apim-service",
248
parameters=network_config
249
)
250
251
updated_service = network_operation.result()
252
print(f"Network configuration updated for: {updated_service.name}")
253
```
254
255
## Types
256
257
### Core Service Types
258
259
```python { .api }
260
class ApiManagementServiceResource:
261
id: Optional[str]
262
name: Optional[str]
263
type: Optional[str]
264
location: str
265
tags: Optional[Dict[str, str]]
266
properties: Optional[ApiManagementServiceProperties]
267
sku: Optional[ApiManagementServiceSkuProperties]
268
identity: Optional[ApiManagementServiceIdentity]
269
system_data: Optional[SystemData]
270
zones: Optional[List[str]]
271
272
class ApiManagementServiceProperties:
273
publisher_email: str
274
publisher_name: str
275
notification_sender_email: Optional[str]
276
provisioning_state: Optional[str]
277
target_provisioning_state: Optional[str]
278
created_at_utc: Optional[datetime]
279
gateway_url: Optional[str]
280
gateway_regional_url: Optional[str]
281
portal_url: Optional[str]
282
management_api_url: Optional[str]
283
scm_url: Optional[str]
284
developer_portal_url: Optional[str]
285
hostname_configurations: Optional[List[HostnameConfiguration]]
286
public_ip_addresses: Optional[List[str]]
287
private_ip_addresses: Optional[List[str]]
288
additional_locations: Optional[List[AdditionalLocation]]
289
virtual_network_configuration: Optional[VirtualNetworkConfiguration]
290
custom_properties: Optional[Dict[str, str]]
291
certificates: Optional[List[CertificateConfiguration]]
292
enable_client_certificate: Optional[bool]
293
disable_gateway: Optional[bool]
294
virtual_network_type: Optional[VirtualNetworkType]
295
api_version_constraint: Optional[ApiVersionConstraint]
296
restore: Optional[bool]
297
298
class ApiManagementServiceSkuProperties:
299
name: SkuType
300
capacity: Optional[int]
301
302
class ApiManagementServiceIdentity:
303
type: ApimIdentityType
304
principal_id: Optional[str]
305
tenant_id: Optional[str]
306
user_assigned_identities: Optional[Dict[str, UserIdentityProperties]]
307
```
308
309
### Service Enums
310
311
```python { .api }
312
class SkuType:
313
DEVELOPER = "Developer"
314
STANDARD = "Standard"
315
PREMIUM = "Premium"
316
BASIC = "Basic"
317
CONSUMPTION = "Consumption"
318
ISOLATED = "Isolated"
319
320
class VirtualNetworkType:
321
NONE = "None"
322
EXTERNAL = "External"
323
INTERNAL = "Internal"
324
325
class ApimIdentityType:
326
SYSTEM_ASSIGNED = "SystemAssigned"
327
USER_ASSIGNED = "UserAssigned"
328
SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned"
329
NONE = "None"
330
331
class HostnameType:
332
PROXY = "Proxy"
333
PORTAL = "Portal"
334
MANAGEMENT = "Management"
335
SCM = "Scm"
336
DEVELOPER_PORTAL = "DeveloperPortal"
337
338
class CertificateSource:
339
MANAGED = "Managed"
340
KEY_VAULT = "KeyVault"
341
CUSTOM = "Custom"
342
BUILT_IN = "BuiltIn"
343
```