Giter Site home page Giter Site logo

ajmandourah / ms-e5-dev-auto-renew Goto Github PK

View Code? Open in Web Editor NEW

This project forked from lshung/ms-e5-dev-auto-renew

0.0 0.0 0.0 6.45 MB

This is a Python application based from Git Actions to produce development actions through Microsoft Graph API like a genuine developer in order to activate Microsoft Office 365 E5 Developer Trail membership auto renewal.

License: MIT License

Python 100.00%

ms-e5-dev-auto-renew's Introduction

MS-E5-Dev-Auto-Renew

This repo is forked from https://github.com/kylierst/MSO_E5_Dev_AutoRenew.

MS-E5-Dev-Auto-Renew 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.

Prerequisites

  • 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

Setup Instructions (Encrypted Secure Version)

Setup MS App

The goal of this step is to get the client ID, the client secret, and the refresh token.

  1. Register a new application in Azure Active Directory
    • Select "Accounts in any organizational directory (Any Azure AD directory - Multitenant)", remember Multitenant.
    • Select "Web" for the redirect URL, and enter "http://localhost:53682/" for the redirect URL.
    • Click "Client credentials" and then create client secret.
    • Now you have the client ID and the client secret, save them to a text file.
  2. 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, and mailboxsetting.readwrite.
    • Grant permission for all selected above permissions.
  3. Get refresh token
    • Install rclone on your machine that can open a browser (not on a headless machine).
    • Open terminal and run command rclone authorize "onedrive" "client_id" "client_secret" with client_id and client_secret you get in the first step.
    • Copy the refresh token value from the terminal result (if you are patient enough) or install a Chrome extention called JsonHandle to get it.
    • Save the refresh token to the text file above.

Setup your Github account

  1. Fork the MS-E5-Dev-Auto-Renew repository to your GitHub account
  2. Generate a personal access token
    • Click your avatar at the top right corner > Settings > Developer settings > Personal access tokens > Tokens (classic) > Generate new token.
    • Set the name to anything you like.
    • Check the options repo, admin:repo_hook, and workflow.
    • Click Generate token button.
    • Save the generated token to the text file above.
  3. Setup repo secrets
    • On your repo's homepage, click Settings > Secrets and Variables > Actions (Repo settings not Github account settings).
    • Click New repository secrets button and create 4 secrets with the value as given below:
      • Name: CONFIG_ID - Value: the client ID in the text file
      • Name: CONFIG_KEY - Value: the client secret in the text file
      • Name: REFRESH_TOKEN - Value: the refresh token in the text file
      • Name: GH_TOKEN - Value: the personal access token in the text file
  4. Setup workflow permissions
    • On your repo's homepage, click Settings > Actions > General.
    • In the Workflow permissions section, select Read and write permissions option.

Manually call the workflow

There are two ways to call the workflow manually:

  1. On your repo's homepage, click the star button (above the repo's description section).
  2. Click your repo's Actions tab > Click your workflow name > Click Run workflow dropdown > Click Run workflow button.

Additional Information

  • Click the repo's Actions tab to see the log of the workflow and check if the API is called correctly or if there are any errors.
  • The default setting is to run three rounds every two hours. 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.

ms-e5-dev-auto-renew's People

Contributors

lshung avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.