Skip to main content

SDK for interacting with the Microsoft Partner Center

Project description

MS Partner Tools



Wrapper for the Microsoft Partner Center REST API.

Supports Python 3.8+.

Currently, only a few Partner Center interactions are supported:

  • Enrolling devices in Autopilot on your customers tenant
  • Listing customers
  • Listing devices in a batch group


pip install ms-partner-tools

or clone the repo and run python install.

App Registration

In the Azure AD portal, create a new App registration.

Under API permissions, add the Microsoft Partner Center user_impersonation permission. You can search for it under "APIs my organization uses". Please note that this only supports delegated permissions, not application permissions.

The device code flow requires the "Allow public client flows" option to be turned on. This needs a client secret.

If the interactive auth flow is used, you must add the "Mobile and desktop applications" platform and set the "Redirect URI" to http://localhost:8400.

Sample Usage


You must first run partnertools-cli configure to set up the authentication details (from the app registration).

Registering a device

$ partnertools-cli register-device
To sign in, use a web browser to open the page and enter the code <CODE> to authenticate.
? Please select a customer: Test Customer - (00000000-0000-0000-0000-000000000000)
? Please select a device type: Surface Laptop 4 - Microsoft Corporation
? Please enter the serial number: 000000 

Device was added


Listing customers

import os
from partner_tools.auth import DeviceCode
from partner_tools import PartnerTools

client = PartnerTools(auth_info=DeviceCode(

customers = client.customer.get_customers()

for customer in customers:
    print(f'Customer: {customer["companyProfile"]["companyName"]}, Tenant ID: {customer["id"]}')

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

ms_partner_tools-0.1.1-py3.8.egg (31.9 kB view hashes)

Uploaded Source

ms_partner_tools-0.1.1-py3-none-any.whl (14.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page