{"id":1372,"library":"azure-mgmt-marketplaceordering","title":"Microsoft Azure Market Place Ordering Client Library for Python","description":"This is the Microsoft Azure Market Place Ordering Client Library for Python, enabling management of marketplace agreements within Azure. It's part of the Azure SDK for Python and uses Azure Resource Manager (ARM) APIs. The current stable version is 1.1.0, released in March 2021. The package generally follows a stable release cadence, with updates primarily for API version bumps or minor features, reflecting the management plane operations it supports.","status":"active","version":"1.1.0","language":"en","source_language":"en","source_url":"https://github.com/Azure/azure-sdk-for-python","tags":["azure","management","marketplace","cloud"],"install":[{"cmd":"pip install azure-mgmt-marketplaceordering azure-identity","lang":"bash","label":"Install stable version with identity"}],"dependencies":[{"reason":"Required for modern Azure Active Directory token authentication.","package":"azure-identity","optional":false}],"imports":[{"note":"The primary client class for this library is `MarketplaceOrderingAgreements`, not `MarketplaceOrderingAgreementsManagementClient` as might be expected by the general Azure SDK naming convention.","wrong":"from azure.mgmt.marketplaceordering import MarketplaceOrderingAgreementsManagementClient","symbol":"MarketplaceOrderingAgreements","correct":"from azure.mgmt.marketplaceordering import MarketplaceOrderingAgreements"}],"quickstart":{"code":"import os\nfrom azure.identity import DefaultAzureCredential\nfrom azure.mgmt.marketplaceordering import MarketplaceOrderingAgreements\n\n# Set environment variables AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET, AZURE_SUBSCRIPTION_ID\n\nsub_id = os.environ.get(\"AZURE_SUBSCRIPTION_ID\", \"\")\nif not sub_id:\n    raise ValueError(\"AZURE_SUBSCRIPTION_ID environment variable not set.\")\n\n# Authenticate using DefaultAzureCredential\ncredential = DefaultAzureCredential()\n\n# Create the client\nclient = MarketplaceOrderingAgreements(credential=credential, subscription_id=sub_id)\n\n# Example: List marketplace agreements (this operation may require specific permissions)\n# Replace 'publisherId' and 'offerId' with actual values if needed for listing or getting a specific agreement\n# For simplicity, this example just attempts to list, which might be empty or require specific resources.\n# Real-world usage often involves 'get' and 'create_or_update' based on a specific offer.\n\nprint(\"Attempting to list marketplace agreements...\")\nagreements = client.marketplace_agreements.list()\n\nfor agreement in agreements:\n    print(f\"Agreement: {agreement.name} (Publisher: {agreement.publisher_id}, Offer: {agreement.offer_id})\")\n\nprint(\"Quickstart complete.\")","lang":"python","description":"Demonstrates how to authenticate using `DefaultAzureCredential` and list marketplace agreements. Ensure `AZURE_SUBSCRIPTION_ID`, `AZURE_CLIENT_ID`, `AZURE_TENANT_ID`, and `AZURE_CLIENT_SECRET` environment variables are set for authentication."},"warnings":[{"fix":"Migrate to `azure-identity` classes, specifically `DefaultAzureCredential` for common scenarios. The `credentials` parameter was also renamed to `credential`.","message":"The credential system was completely revamped in version 1.0.0b1. Older `azure.common.credentials` or `msrestazure.azure_active_directory` instances are no longer supported.","severity":"breaking","affected_versions":"<1.0.0b1"},{"fix":"Update code to explicitly use keyword arguments when instantiating models or calling client methods (e.g., `AgreementTerms(publisher_id='...', product_id='...')` instead of `AgreementTerms('...', '...')`).","message":"Starting from version 0.2.0, all model signatures and client methods primarily use keyword-only arguments. Positional arguments for models are no longer supported.","severity":"breaking","affected_versions":"<0.2.0"},{"fix":"Pass configuration options (e.g., `enable_logging=True`) directly to the client constructor: `MarketplaceOrderingAgreements(credential, subscription_id, enable_logging=True)`.","message":"The `config` attribute is no longer available on client objects since version 1.0.0b1. Client configuration must be passed as keyword arguments during instantiation.","severity":"gotcha","affected_versions":">=1.0.0b1"},{"fix":"Upgrade to Python 3.8 or newer to ensure continued support and compatibility.","message":"Support for Python 2.7 has officially ended for Azure SDK Python packages as of January 1, 2022. This library is tested with Python 3.8+.","severity":"deprecated","affected_versions":"All versions when used with Python 2.7"}],"env_vars":null,"last_verified":"2026-04-09T00:00:00.000Z","next_check":"2026-07-08T00:00:00.000Z"}