To add domains and create mailboxes in Microsoft Office 365, you need to create a Microsoft Office 365 admin account. This process is quite simple, and you can follow this setup guide for assistance.
Once you have completed the admin account setup, you will need to perform app registrations. This step allows Lily to connect with your account and obtain the necessary permissions.
To add domains and create users in Microsoft, you require the following credentials in addition to Cloudflare ones:
Client ID
Tenant ID
Client Secret
Each of these credentials is unique to every admin account. Therefore, if you intend to utilize multiple accounts to create mailboxes in Outlook, you will need these credentials for each admin account.
Now, let's explore how you can obtain these credentials:
To create the "Client ID, Tenant ID, and Client Secret" in Microsoft 365, follow these steps:
Begin by signing in to your admin account at admin.microsoft.com.
Next, log in to portal.azure.com.
First, search for "App Registrations" at the top search bar.
Next, click on it. When you do this, you will find a panel similar to this:
Click on the "+ New registration" link just below the title "App registrations."
Upon doing that, a window similar to this will open.
Enter the name "Automation."
Keep the supported account types the same.
Select "Web" as the Redirect URL from the dropdown menu.
After that, mention this URL: "https://www.integromat.com/oauth/cb/app."
Then simply click the "Register" button at the bottom.
Afterwards, it will generate the "Client ID and Tenant ID."
Copy these "Client ID and Tenant ID" and save them somewhere else.
Next, you need to create a Client secret. To do that, click on the "Add a certificate or secret" link.
Then click on "+ New Client Secret," which will open a window similar to the screenshot below.
Now, type "Credentials" in the description field and select a duration of 12 months from the dropdown box.
Click the "Add" button at the bottom. Your client secret ID is now created.
Copy the "Value" as highlighted, not the Secret ID, and save it along with the Client ID and Tenant ID.
Copy this secret value immediately, as it will be hidden after a certain time.
You have now created all three credentials. Now, you need to assign a few API permissions. To do that, click on the "API Permissions" link in the sidebar, which will open a page similar to the one shown below.
Click on "Microsoft Graph" marked by the pointer, and then click on "Application permissions" as shown in the given screenshot.
Next, search for "USER."
Scroll down and select all six options under the "USER" dropdown, then hit "Update permissions."
Once again, click on "Microsoft Graph" marked by the pointer, and then click on "Application permissions" as shown in the below screenshot.
Search for "DOMAIN" and select both options, then click the "Update permissions" button at the bottom.
Once again, click on "Microsoft Graph" marked by the pointer, and then click on "Application permissions" as shown in the selected screenshot. This time, search for "License" and select the available option, then hit the "Update permissions" button at the bottom.
Once all ten permissions are added, click on "Grant admin consent for ___."
After doing that, all the permissions will be assigned, and the status will change from "Not granted for ___" to "Granted for ___."
Now you are ready to use all three credentials in the automation to add domains and create users in Microsoft.