CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-azure-mgmt-core

Azure management core library defines extensions to Azure Core that are specific to ARM (Azure Resource Management) needed when you use client libraries

Pending

Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

Overview
Eval results
Files

pipeline-clients.mddocs/

Pipeline Clients

ARM-specific pipeline clients that extend Azure Core's pipeline architecture with ARM-specific policies and behaviors. These clients automatically include resource provider registration, ARM-specific logging, and authentication challenge handling.

Capabilities

ARMPipelineClient

Synchronous pipeline client designed specifically for Azure Resource Manager operations. Automatically includes ARM-specific policies and handles ARM authentication patterns.

class ARMPipelineClient(PipelineClient[HTTPRequestType, HTTPResponseType]):
    """A pipeline client designed for ARM explicitly.

    :param str base_url: URL for the request.
    :keyword Pipeline pipeline: If omitted, a Pipeline object is created and returned.
    :keyword list[HTTPPolicy] policies: If omitted, the standard policies of the configuration object is used.
    :keyword per_call_policies: If specified, the policies will be added into the policy list before RetryPolicy
    :paramtype per_call_policies: Union[HTTPPolicy, SansIOHTTPPolicy, list[HTTPPolicy], list[SansIOHTTPPolicy]]
    :keyword per_retry_policies: If specified, the policies will be added into the policy list after RetryPolicy
    :paramtype per_retry_policies: Union[HTTPPolicy, SansIOHTTPPolicy, list[HTTPPolicy], list[SansIOHTTPPolicy]]
    :keyword HttpTransport transport: If omitted, RequestsTransport is used for synchronous transport.
    """
    def __init__(self, base_url: str, **kwargs: Any) -> None: ...

Usage Example

from azure.mgmt.core import ARMPipelineClient
from azure.core.configuration import Configuration
from azure.core.credentials import DefaultAzureCredential

# Create configuration
config = Configuration()

# Create ARM pipeline client
client = ARMPipelineClient(
    base_url="https://management.azure.com",
    config=config
)

# The client automatically includes:
# - ARMAutoResourceProviderRegistrationPolicy
# - ARMHttpLoggingPolicy (if not already configured)

AsyncARMPipelineClient

Asynchronous pipeline client designed specifically for Azure Resource Manager operations. Provides the same ARM-specific enhancements as ARMPipelineClient but for async/await patterns.

class AsyncARMPipelineClient(AsyncPipelineClient[HTTPRequestType, AsyncHTTPResponseType]):
    """A pipeline client designed for ARM explicitly.

    :param str base_url: URL for the request.
    :keyword AsyncPipeline pipeline: If omitted, a Pipeline object is created and returned.
    :keyword list[AsyncHTTPPolicy] policies: If omitted, the standard policies of the configuration object is used.
    :keyword per_call_policies: If specified, the policies will be added into the policy list before RetryPolicy
    :paramtype per_call_policies: Union[AsyncHTTPPolicy, SansIOHTTPPolicy,
        list[AsyncHTTPPolicy], list[SansIOHTTPPolicy]]
    :keyword per_retry_policies: If specified, the policies will be added into the policy list after RetryPolicy
    :paramtype per_retry_policies: Union[AsyncHTTPPolicy, SansIOHTTPPolicy,
        list[AsyncHTTPPolicy], list[SansIOHTTPPolicy]]
    :keyword AsyncHttpTransport transport: If omitted, AioHttpTransport is used for asynchronous transport.
    """
    def __init__(self, base_url: str, **kwargs: Any) -> None: ...

Usage Example

import asyncio
from azure.mgmt.core import AsyncARMPipelineClient
from azure.core.configuration import Configuration
from azure.core.credentials import DefaultAzureCredential

async def main():
    # Create configuration
    config = Configuration()
    
    # Create async ARM pipeline client
    client = AsyncARMPipelineClient(
        base_url="https://management.azure.com",
        config=config
    )
    
    # The client automatically includes:
    # - AsyncARMAutoResourceProviderRegistrationPolicy
    # - ARMHttpLoggingPolicy (if not already configured)

asyncio.run(main())

Key Features

Automatic Policy Injection

Both pipeline clients automatically inject ARM-specific policies when no explicit policies are provided:

  • Resource Provider Registration: Automatically registers unregistered resource providers when encountering 409 errors with MissingSubscriptionRegistration
  • ARM Logging: Enhanced HTTP logging with ARM-specific safe headers for rate limiting and request tracking
  • Authentication Challenge Handling: Built-in support for Continuous Access Evaluation (CAE) challenges

Configuration Requirements

Both clients require either:

  • Explicit policies parameter, OR
  • Valid config parameter (Configuration object)

If neither is provided, a ValueError is raised.

Policy Order

When using configuration-based initialization, policies are added in this order:

  1. Per-call policies (user-provided)
  2. ARMAutoResourceProviderRegistrationPolicy (automatically added)
  3. Standard configuration policies
  4. Per-retry policies (user-provided)

Types

HTTPResponseType = TypeVar("HTTPResponseType")
HTTPRequestType = TypeVar("HTTPRequestType")
AsyncHTTPResponseType = TypeVar("AsyncHTTPResponseType", bound=AsyncContextManager)

Install with Tessl CLI

npx tessl i tessl/pypi-azure-mgmt-core

docs

exceptions.md

index.md

pipeline-clients.md

policies.md

polling.md

resource-tools.md

tile.json