A Java Script (JS) script to self-service create account on your tenant.
Please note that this creates need global admin for Microsoft Office 365.
1 Enter Azure AD to create a new app, get tenant id and client id
2. Authorize the app with the permission of Directory. ReadWrite.All of the graph
3 Create a new client secretÂ
4 Get the subscribed skuid, thanks @tanst for the method
In the admin panel of Microsoft 365 admin center-Bills-License and click on the “License” you want to see, there will be skuid in the address bar
5 Configure reCAPTCHA, go to https://www.google.com/recaptcha/intro/v3.html to create a new reCAPTCHA v2 checkbox to verify, fill in your domain name, get the site key and secretÂ
6 Copy the contents of index.js to cf workers, fill in the corresponding data