Azure ManagementPartner Management Client Library

1.0.0 · abandoned · verified Sat Apr 11

The Microsoft Azure ManagementPartner Management Client Library for Python (current version 1.0.0, released in 2020) provides programmatic access to manage Microsoft Partner Network (MPN) IDs. This library is effectively abandoned due to the deprecation of its underlying Azure API, meaning it is not suitable for new development and existing integrations may cease to function.

Warnings

Install

Imports

Quickstart

This quickstart attempts to retrieve a partner using `ManagementPartnerClient`. However, it's critical to note that the underlying Azure ManagementPartner API is deprecated. The official Azure SDK samples explicitly state this library will not work. This code is provided for reference but is expected to fail at runtime due to API deprecation.

import os
from azure.identity import DefaultAzureCredential
from azure.mgmt.managementpartner import ManagementPartnerClient

# NOTE: This library interacts with a deprecated Azure API.
# The official samples state this code will not work as the API is no longer supported.
# See: https://github.com/Azure/azure-sdk-for-python/issues/23977

def main():
    # Replace with your actual partner ID, if the API were functional
    partner_id = os.environ.get("MANAGEMENT_PARTNER_ID", "0000000") 

    # Authenticate with Azure
    # Ensure AZURE_CLIENT_ID, AZURE_CLIENT_SECRET, AZURE_TENANT_ID are set,
    # or other credentials for DefaultAzureCredential.
    credential = DefaultAzureCredential()

    # Create a ManagementPartnerClient. Note: subscription_id is not used for this client.
    client = ManagementPartnerClient(credential)

    try:
        # Attempt to get a partner (this call is expected to fail due to API deprecation)
        print(f"Attempting to retrieve partner: {partner_id}")
        partner = client.partner.get(partner_id)
        print(f"Successfully retrieved partner: {partner.partner_id}")
    except Exception as e:
        print(f"An error occurred, likely due to API deprecation: {e}")
        print("This library is no longer functional due to the underlying API being deprecated.")

if __name__ == '__main__':
    main()

view raw JSON →