Azure ManagementPartner Management Client Library
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
- breaking The underlying Azure ManagementPartner API (used by this library) has been deprecated and is no longer supported by Microsoft. This means the functionality provided by `azure-mgmt-managementpartner` is non-functional for new or existing integrations, and API calls will fail.
- deprecated This Python library itself is effectively abandoned. Its last release (1.0.0) was in May 2020, and there have been no updates since, aligning with the deprecation of the underlying API. It does not follow modern Azure SDK design patterns (Track 2).
- gotcha Unlike many `azure-mgmt-*` libraries, `ManagementPartnerClient` does not take a `subscription_id` during instantiation. It operates at a tenant level, which can be confusing for developers accustomed to subscription-scoped resource management.
- gotcha The library relies on older `msrest` and `azure-common` dependencies. While `azure-identity` for authentication is compatible, the core client itself is not built on the modern `azure-core` framework, which can lead to inconsistencies when integrating with newer Azure SDK components.
Install
-
pip install azure-mgmt-managementpartner azure-identity
Imports
- ManagementPartnerClient
from azure.mgmt.managementpartner import ManagementPartnerClient
- DefaultAzureCredential
from azure.identity import DefaultAzureCredential
Quickstart
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()