0
# Azure Management Core
1
2
Azure Management Core provides essential ARM (Azure Resource Management) extensions and utilities that are shared across Azure management client libraries. It offers base classes for ARM-specific pipeline clients, custom exception handling, ARM-specific policies for authentication and request processing, specialized polling mechanisms for long-running operations, and utility functions for ARM resource operations.
3
4
## Package Information
5
6
- **Package Name**: azure-mgmt-core
7
- **Language**: Python
8
- **Installation**: `pip install azure-mgmt-core`
9
- **Minimum Python Version**: 3.9+
10
- **Dependencies**: azure-core >= 1.32.0
11
12
## Core Imports
13
14
```python
15
from azure.mgmt.core import ARMPipelineClient, AsyncARMPipelineClient, VERSION, __version__
16
```
17
18
For specific functionality:
19
20
```python
21
from azure.mgmt.core.exceptions import TypedErrorInfo, ARMErrorFormat
22
from azure.mgmt.core.tools import parse_resource_id, resource_id, is_valid_resource_id
23
from azure.mgmt.core.policies import (
24
ARMAutoResourceProviderRegistrationPolicy,
25
ARMChallengeAuthenticationPolicy,
26
ARMHttpLoggingPolicy
27
)
28
from azure.mgmt.core.polling.arm_polling import ARMPolling, AzureAsyncOperationPolling, BodyContentPolling
29
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
30
```
31
32
## Basic Usage
33
34
```python
35
from azure.mgmt.core import ARMPipelineClient
36
from azure.core.credentials import DefaultAzureCredential
37
38
# Create an ARM pipeline client
39
credential = DefaultAzureCredential()
40
base_url = "https://management.azure.com"
41
42
# Initialize with configuration
43
from azure.core.configuration import Configuration
44
45
config = Configuration()
46
client = ARMPipelineClient(
47
base_url=base_url,
48
config=config
49
)
50
51
# The client automatically includes ARM-specific policies:
52
# - Resource provider auto-registration
53
# - ARM-specific HTTP logging
54
# - Authentication challenge handling
55
```
56
57
## Architecture
58
59
Azure Management Core implements the Azure SDK's pipeline architecture with ARM-specific enhancements:
60
61
- **Pipeline Clients**: ARMPipelineClient and AsyncARMPipelineClient extend core pipeline clients with ARM-specific policies and behaviors
62
- **Policies**: ARM-specific HTTP policies for authentication challenges, resource provider registration, and enhanced logging
63
- **Polling**: Specialized long-running operation (LRO) polling strategies for Azure ARM asynchronous operations
64
- **Tools**: Utilities for parsing and validating Azure resource identifiers and names
65
- **Exceptions**: ARM-specific error formatting that extends OData v4 error formats
66
67
This design provides maximum reusability across Azure management SDKs while maintaining consistency with Azure's authentication systems, continuous access evaluation (CAE), and ARM's asynchronous operation patterns.
68
69
## Capabilities
70
71
### Pipeline Clients
72
73
ARM-specific pipeline clients for synchronous and asynchronous HTTP operations, with built-in support for ARM policies, authentication, and request processing.
74
75
```python { .api }
76
# Version information
77
VERSION: str # Package version string
78
__version__: str # Package version alias
79
80
class ARMPipelineClient(PipelineClient):
81
def __init__(self, base_url: str, **kwargs) -> None: ...
82
83
class AsyncARMPipelineClient(AsyncPipelineClient):
84
def __init__(self, base_url: str, **kwargs) -> None: ...
85
```
86
87
[Pipeline Clients](./pipeline-clients.md)
88
89
### ARM Policies
90
91
Specialized HTTP pipeline policies for Azure Resource Manager operations, including automatic resource provider registration, authentication challenge handling, and ARM-specific logging.
92
93
```python { .api }
94
class ARMAutoResourceProviderRegistrationPolicy(HTTPPolicy): ...
95
class ARMChallengeAuthenticationPolicy(BearerTokenCredentialPolicy): ...
96
class ARMHttpLoggingPolicy(HttpLoggingPolicy): ...
97
```
98
99
[ARM Policies](./policies.md)
100
101
### Long-Running Operation Polling
102
103
ARM-specific polling strategies for managing long-running operations, supporting Azure-AsyncOperation headers, location headers, and body content polling patterns.
104
105
```python { .api }
106
class ARMPolling(LROBasePolling): ...
107
class AsyncARMPolling(AsyncLROBasePolling): ...
108
class AzureAsyncOperationPolling(OperationResourcePolling): ...
109
class BodyContentPolling(LongRunningOperation): ...
110
```
111
112
[Polling](./polling.md)
113
114
### Resource Management Tools
115
116
Utilities for parsing Azure resource identifiers, constructing resource IDs, and validating resource names according to ARM specifications.
117
118
```python { .api }
119
def parse_resource_id(rid: str) -> Mapping[str, Union[str, int]]: ...
120
def resource_id(**kwargs: Optional[str]) -> str: ...
121
def is_valid_resource_id(rid: str, exception_type: Optional[Type[BaseException]] = None) -> bool: ...
122
def is_valid_resource_name(rname: str, exception_type: Optional[Type[BaseException]] = None) -> bool: ...
123
def get_arm_endpoints(cloud_setting: AzureClouds) -> Dict[str, Any]: ...
124
```
125
126
[Resource Tools](./resource-tools.md)
127
128
### Exception Handling
129
130
ARM-specific error formatting and exception handling that extends Azure Core's OData v4 error format with additional ARM-specific error information.
131
132
```python { .api }
133
class TypedErrorInfo:
134
def __init__(self, type: str, info: Mapping[str, Any]) -> None: ...
135
136
class ARMErrorFormat(ODataV4Format):
137
def __init__(self, json_object: Mapping[str, Any]) -> None: ...
138
```
139
140
[Exception Handling](./exceptions.md)
141
142
## Types
143
144
```python { .api }
145
# Type aliases for HTTP request/response handling
146
HTTPResponseType = TypeVar("HTTPResponseType")
147
HTTPRequestType = TypeVar("HTTPRequestType")
148
AllHttpResponseType = Union[LegacyHttpResponse, HttpResponse, LegacyAsyncHttpResponse, AsyncHttpResponse]
149
```