Build Python apps with Microsoft Graph

This tutorial teaches you how to build a Python console app that uses the Microsoft Graph API.


The Microsoft Graph Core Python Client Library is currently in preview and should not be used in production. During this period breaking changes are expected to happen. This tutorial was written with version 0.2.2.


If you prefer to just download the completed tutorial, you can download or clone the GitHub repository.


Before you start this tutorial, you should have Python and pip installed on your development machine.

You should also have either a personal Microsoft account with a mailbox on, or a Microsoft work or school account. If you don't have a Microsoft account, there are a couple of options to get a free account:


This tutorial was written with Python version 3.10.4 and pip version 20.0.2. The steps in this guide may work with other versions, but that has not been tested.