0
# Azure Maps Management Client
1
2
A comprehensive Python client library for managing Azure Maps resources through the Azure Resource Manager. This library provides programmatic access to create, configure, and manage Azure Maps accounts, creators, and related resources with full support for Azure Active Directory authentication and both synchronous and asynchronous operations.
3
4
## Package Information
5
6
- **Package Name**: azure-mgmt-maps
7
- **Package Type**: Azure SDK Management Library
8
- **Language**: Python
9
- **Installation**: `pip install azure-mgmt-maps azure-identity`
10
- **Python Version**: 3.7+
11
12
## Core Imports
13
14
```python
15
from azure.mgmt.maps import AzureMapsManagementClient
16
from azure.identity import DefaultAzureCredential
17
```
18
19
Asynchronous client:
20
21
```python
22
from azure.mgmt.maps.aio import AzureMapsManagementClient
23
from azure.identity.aio import DefaultAzureCredential
24
```
25
26
Models and types:
27
28
```python
29
from azure.mgmt.maps.models import (
30
MapsAccount, Creator, MapsAccountProperties,
31
MapsAccountKeys, MapsAccountSasToken, AccountSasParameters,
32
MapsAccountUpdateParameters, CreatorUpdateParameters, MapsKeySpecification,
33
ManagedServiceIdentity, CorsRules, CorsRule, CreatorProperties,
34
Sku, Kind, KeyType, SigningKey, ManagedServiceIdentityType
35
)
36
from typing import IO
37
```
38
39
## Basic Usage
40
41
```python
42
import os
43
from azure.identity import DefaultAzureCredential
44
from azure.mgmt.maps import AzureMapsManagementClient
45
from azure.mgmt.maps.models import MapsAccount, Sku, Kind
46
47
# Initialize client with Azure credentials
48
credential = DefaultAzureCredential()
49
subscription_id = os.getenv("AZURE_SUBSCRIPTION_ID")
50
51
client = AzureMapsManagementClient(
52
credential=credential,
53
subscription_id=subscription_id
54
)
55
56
# Create a new Maps account
57
maps_account = MapsAccount(
58
location="eastus",
59
sku=Sku(name="S0"), # Free tier
60
kind=Kind.GEN2,
61
properties={} # Use default properties
62
)
63
64
created_account = client.accounts.create_or_update(
65
resource_group_name="my-resource-group",
66
account_name="my-maps-account",
67
maps_account=maps_account
68
)
69
70
print(f"Created Maps account: {created_account.name}")
71
72
# List accounts in subscription
73
accounts = list(client.accounts.list_by_subscription())
74
print(f"Found {len(accounts)} Maps accounts")
75
76
# Get account keys
77
keys = client.accounts.list_keys(
78
resource_group_name="my-resource-group",
79
account_name="my-maps-account"
80
)
81
print(f"Primary key: {keys.primary_key}")
82
```
83
84
## Architecture
85
86
The Azure Maps Management Client follows the Azure SDK design patterns:
87
88
- **Client**: `AzureMapsManagementClient` serves as the main entry point, managing authentication and providing access to operation groups
89
- **Operations**: Organized into logical groups (`accounts`, `maps`, `creators`) each handling specific resource types
90
- **Models**: Strongly-typed data classes representing Azure Maps resources and their properties
91
- **Authentication**: Integrated with Azure Identity for secure, standards-based authentication
92
93
The client supports both synchronous and asynchronous operations, enabling integration with various Python applications from simple scripts to high-performance async web services.
94
95
## Capabilities
96
97
### Account Management
98
99
Complete lifecycle management of Azure Maps accounts including creation, configuration, monitoring, and deletion. Handles authentication keys, SAS tokens, CORS settings, encryption, and managed identities.
100
101
```python { .api }
102
class AccountsOperations:
103
# Account lifecycle
104
def create_or_update(self, resource_group_name: str, account_name: str, maps_account: Union[MapsAccount, IO], **kwargs) -> MapsAccount: ...
105
def update(self, resource_group_name: str, account_name: str, maps_account_update_parameters: Union[MapsAccountUpdateParameters, IO], **kwargs) -> MapsAccount: ...
106
def delete(self, resource_group_name: str, account_name: str, **kwargs) -> None: ...
107
def get(self, resource_group_name: str, account_name: str, **kwargs) -> MapsAccount: ...
108
109
# Account discovery
110
def list_by_resource_group(self, resource_group_name: str, **kwargs) -> Iterable[MapsAccount]: ...
111
def list_by_subscription(self, **kwargs) -> Iterable[MapsAccount]: ...
112
113
# Authentication & access
114
def list_keys(self, resource_group_name: str, account_name: str, **kwargs) -> MapsAccountKeys: ...
115
def regenerate_keys(self, resource_group_name: str, account_name: str, key_specification: Union[MapsKeySpecification, IO], **kwargs) -> MapsAccountKeys: ...
116
def list_sas(self, resource_group_name: str, account_name: str, maps_account_sas_parameters: Union[AccountSasParameters, IO], **kwargs) -> MapsAccountSasToken: ...
117
```
118
119
[Account Management](./accounts.md)
120
121
### Creator Resources
122
123
Management of Azure Maps Creator resources for uploading and managing custom map data, including indoor maps, floor plans, and custom geographic datasets.
124
125
```python { .api }
126
class CreatorsOperations:
127
# Creator lifecycle
128
def create_or_update(self, resource_group_name: str, account_name: str, creator_name: str, creator_resource: Union[Creator, IO], **kwargs) -> Creator: ...
129
def update(self, resource_group_name: str, account_name: str, creator_name: str, creator_update_parameters: Union[CreatorUpdateParameters, IO], **kwargs) -> Creator: ...
130
def delete(self, resource_group_name: str, account_name: str, creator_name: str, **kwargs) -> None: ...
131
def get(self, resource_group_name: str, account_name: str, creator_name: str, **kwargs) -> Creator: ...
132
133
# Creator discovery
134
def list_by_account(self, resource_group_name: str, account_name: str, **kwargs) -> Iterable[Creator]: ...
135
```
136
137
[Creator Resources](./creators.md)
138
139
### Service Operations
140
141
Discovery and metadata operations for Azure Maps service capabilities, providing information about available operations and service specifications.
142
143
```python { .api }
144
class MapsOperations:
145
# Operations discovery
146
def list_operations(self, **kwargs) -> Iterable[OperationDetail]: ...
147
def list_subscription_operations(self, **kwargs) -> Iterable[OperationDetail]: ...
148
```
149
150
[Service Operations](./operations.md)
151
152
## Core Types
153
154
### Client Configuration
155
156
```python { .api }
157
class AzureMapsManagementClient:
158
"""
159
Azure Maps Management Client.
160
161
Args:
162
credential: Azure credential for authentication
163
subscription_id: Azure subscription ID
164
base_url: Service endpoint (default: https://management.azure.com)
165
api_version: API version (default: 2023-06-01)
166
"""
167
def __init__(
168
self,
169
credential: TokenCredential,
170
subscription_id: str,
171
base_url: str = "https://management.azure.com",
172
**kwargs
173
) -> None: ...
174
175
# Operation groups
176
accounts: AccountsOperations
177
creators: CreatorsOperations
178
maps: MapsOperations
179
180
# Context management
181
def close(self) -> None: ...
182
def __enter__(self) -> "AzureMapsManagementClient": ...
183
def __exit__(self, *exc_details) -> None: ...
184
```
185
186
### Resource Models
187
188
```python { .api }
189
class MapsAccount:
190
"""Azure Maps Account resource."""
191
# Resource properties
192
id: Optional[str]
193
name: Optional[str]
194
type: Optional[str]
195
location: Optional[str]
196
tags: Optional[Dict[str, str]]
197
198
# Maps-specific properties
199
sku: Optional[Sku]
200
kind: Optional[Union[str, Kind]]
201
identity: Optional[ManagedServiceIdentity]
202
properties: Optional[MapsAccountProperties]
203
system_data: Optional[SystemData]
204
205
class MapsAccountUpdateParameters:
206
"""Parameters for updating a Maps Account."""
207
tags: Optional[Dict[str, str]]
208
kind: Optional[Union[str, Kind]]
209
sku: Optional[Sku]
210
identity: Optional[ManagedServiceIdentity]
211
properties: Optional[MapsAccountProperties]
212
213
class Creator:
214
"""Azure Maps Creator resource."""
215
# Resource properties
216
id: Optional[str]
217
name: Optional[str]
218
type: Optional[str]
219
location: Optional[str]
220
tags: Optional[Dict[str, str]]
221
222
# Creator-specific properties
223
properties: Optional[CreatorProperties]
224
system_data: Optional[SystemData]
225
226
class CreatorUpdateParameters:
227
"""Parameters for updating a Creator resource."""
228
tags: Optional[Dict[str, str]]
229
properties: Optional[CreatorProperties]
230
231
class CreatorProperties:
232
"""Creator resource properties."""
233
provisioning_state: Optional[str] # Read-only
234
storage_units: Optional[int] # Required for creation, range 1-100
235
```
236
237
### Authentication Models
238
239
```python { .api }
240
class MapsAccountKeys:
241
"""Maps account access keys."""
242
primary_key: Optional[str] # Read-only
243
secondary_key: Optional[str] # Read-only
244
primary_key_last_updated: Optional[str] # Read-only, last updated timestamp
245
secondary_key_last_updated: Optional[str] # Read-only, last updated timestamp
246
247
class MapsAccountSasToken:
248
"""SAS token for Maps account access."""
249
account_sas_token: Optional[str]
250
251
class AccountSasParameters:
252
"""Parameters for creating SAS tokens."""
253
signing_key: Union[str, SigningKey] # Required
254
principal_id: str # Required
255
regions: Optional[List[str]] # Optional
256
max_rate_per_second: int = 500 # Required, default=500, max=500, min>0
257
start: str # Required, ISO 8601 datetime
258
expiry: str # Required, ISO 8601 datetime
259
```
260
261
### Configuration Enums
262
263
```python { .api }
264
class Kind(str, Enum):
265
"""Maps account kind/generation."""
266
GEN1 = "Gen1"
267
GEN2 = "Gen2"
268
269
class KeyType(str, Enum):
270
"""Account key types."""
271
PRIMARY = "primary"
272
SECONDARY = "secondary"
273
274
class SigningKey(str, Enum):
275
"""SAS signing key types."""
276
PRIMARY_KEY = "primaryKey"
277
SECONDARY_KEY = "secondaryKey"
278
MANAGED_IDENTITY = "managedIdentity"
279
280
class ManagedServiceIdentityType(str, Enum):
281
"""Managed service identity types."""
282
NONE = "None"
283
SYSTEM_ASSIGNED = "SystemAssigned"
284
USER_ASSIGNED = "UserAssigned"
285
SYSTEM_ASSIGNED_USER_ASSIGNED = "SystemAssigned, UserAssigned"
286
287
class MapsKeySpecification:
288
"""Parameters for regenerating account keys."""
289
key_type: Union[str, KeyType] # Required
290
```