MSO_E5_Dev_AutoRenew is a Python application based on Git Actions that uses Microsoft Graph API to activate Microsoft Office 365 E5 Developer Trail membership auto-renewal automatically. This guide will provide you with easy-to-understand steps for setting up and running the application.
- Normal version address: https://github.com/kylierst/MSO_E5_Dev_AutoRenew_REVISION_2
- Thanks to Ken5998 for code improvements and fix job skipping
- A GitHub account
- An existing or new Microsoft Developer E5 account with trial Subscription
- An Azure Portal account
- Basic knowledge of GitHub, Python, and Azure Portal
- Fork the MSO_E5_Dev_AutoRenew repository to your GitHub account.
- Register a new application in Azure Active Directory.
- Select any organization directory, select "Web" for the redirect URL, and enter "http://localhost:53682/" for the redirect URL.
- Save the Application ID
- Create a new Secret with max validity.
- Set application permissions.
- Select the following permissions:
files.read.all
,files.readwrite.all
,sites.read.all
,sites.readwrite.all
,user.read.all
,user.readwrite.all
,directory.read.all
,directory.readwrite.all
,mail.read
,mail.readwrite
,mailboxsetting.read
, andmailboxsetting.readwrite
. - Grant permission for all 13 selected permissions.
- Select the following permissions:
- install rclone in your system. It is required to get refresh token (one time only)
- Execute the command
rclone authorize "onedrive" <app_id> <app_secret>
.- Confirm the prompt and save the refresh token.
- id is the Application ID you get it from previous steps
- secret is the Application secret you get it from previous steps
- Install JsonHandle chrome extention and open it. Paste the access_token acquired from previous step in the dialog box and copy the refresh token from it
- Keep Application ID, Secret, Refresh_token handly you will need it in the next step
- Go to the project settings and from the left hand side menu select Secrets and Variables > Actions
- Click New repository secrets. and create three variables and set the value as given below
- Name:
CONFIG_ID
value id=r'your applcation_id' (within the quotes) - Name:
CONFIG_KEY
value secret=r'your_secret' - Name:
REFRESH_TOKEN
value token=r'your_refresh_token'
- Name:
- Goto the project setting again and choose Actions menu and scroll down until you see Workflow permissions click Read and write permission option
- Go to your personal settings page on GitHub, select Developer settings > Personal access tokens > Generate new token.
- Set the name to
GITHUB_TOKEN
. - Check the options
repo
,admin:repo_hook
, andworkflow
. - Generate the token.
- Set the name to
- Update secret.txt with REFRESH_TOKEN.
- Click on the star button at the top right corner of the page to call it once.
- Click on the Actions tab above to see the log of each run and check if the API is called correctly and if there are any errors.
- The default setting is to run three rounds every six hours from Monday to Friday. You can modify your own crontab to change the frequency and time.
- If you need to modify the API calls, you can check the Graph Explorer at https://developer.microsoft.com/graph/graph-explorer/preview.
- The GitHub Action provides a virtual environment with 2-core CPU, 7 GB RAM memory, and 14 GB SSD hard disk space.
- Each repository can only support 20 concurrent calls.
This repo may lead to unknown issues, problems, information leaks, etc.
Use at your own risk.
The author DO NOT provide help or further assistance for personal reasons.
Please DO NOT open issues or PR over this project, I do not have enough time to respond due to personal reasons, thanks for understanding.
GitAction skipp problem(zhtok#4) fixed. (thanks for notifying)
- Nodejs version is incompatible with the code in
main.py
. - Certain MS Graph APIs are updated with slightly changes.
Major changes are made:
- Remove
main.py
- New
test.py
- New
autoTestApi.yml
- Import
random
to generate the number of tests instead of fixed 10 times for each action. - From
ubuntu-latest
toubuntu-22.04
- From
actions/setup-python@v2
toactions/setup-python@v4