This repository contains Python scripts that can generate either an access token or refresh token used for interacting with Partner Center, Azure & Microsoft Graph APIs.
The scripts also require the app credentials (client_id, client_secret) as well as a tenant id stored in the Azure Key Vault that will store the tokens once generated.
The scripts generate and store the auth tokens in Azure Key Vault as secrets, when generating refresh tokens, an expiry date of 90 days is calculated and updated along with the secret.
-
Create and activate a virtual environment.
-
Install dependencies from the requirements.txt file.
-
Run the Python script by executing 'generate_access_token.py', 'generate_refresh_token.py', 'generate_ms_graph_client.py'.