Automatically Set Up Microsoft 365 Continuous Scanning
Use the automated setup to create the Microsoft Entra app registration with a generated script and connect it to the Mondoo Microsoft 365 integration.
The automated setup gives you a script that creates the Microsoft Entra app registration Mondoo needs to continuously scan your Microsoft 365 environment. You run the script, then enter the values it prints in the Mondoo App.
Prefer to create the app registration yourself in the Microsoft Entra admin center? See the manual setup instead.
Before you begin
- Editor or Owner access to the Mondoo space, or another role with permission to add integrations. To see every role, read Roles and permissions.
- A Microsoft Entra user who can grant admin consent and assign directory roles, such as a Global Administrator or a Privileged Role Administrator. If you can't do both, the script still creates the app registration, and at the end it tells you which steps an administrator must finish.
- The Azure CLI, signed in to the tenant you want to scan. Azure Cloud Shell already includes it. To sign in to a tenant that has no Azure subscription, run
az login --allow-no-subscriptions. - For the Bicep option only: an Azure subscription and the Contributor role on the resource group you deploy to.
Add a Microsoft 365 integration
In the Mondoo App, navigate to the space where you want to add the integration. In the side navigation bar, select Integrations. In the top right, select INSTALL. On the Install Integration page, find the integration you want by browsing a category or searching by name:
-
Under SaaS Security, select Microsoft 365. The Automated Setup tab opens by default.
-
Under Choose an integration name, enter a name that identifies the tenant. The script names the app registration after the integration.
-
Under Create your Microsoft app registration, choose how to authenticate and how to run the script:
-
In the Credential box, select Certificate (recommended) or Client secret.
SharePoint Online refuses a token issued from a client secret, so with a client secret the SharePoint Online check reports an error. Exchange Online, Teams, and the rest of the tenant scan normally. Use a certificate if SharePoint coverage matters.
-
Select the Bash, PowerShell, or Bicep tab. Bash and PowerShell run the Azure CLI. Bicep deploys through Azure Resource Manager, so it needs an Azure subscription; Microsoft Entra tenants without a subscription should use Bash or PowerShell.
To see every permission and the directory role the app registration receives, and why Mondoo needs each one, expand the list below the script.
-
-
Copy the script and run it, for example in Azure Cloud Shell. For Bicep, select Download mondoo-ms365-app-registration.bicep, optionally change the Resource group, and run the commands shown.
The script:
- Creates the app registration and its service principal
- Adds the Microsoft Graph, SharePoint Online, Exchange Online, and Security & Compliance permissions Mondoo needs
- Grants admin consent
- Assigns the Global Reader directory role
- Creates a certificate or client secret valid for one year
- Prints the Tenant ID, the Client ID, and the path of the PEM file (or the client secret)
If you chose a certificate, download the PEM file. In Azure Cloud Shell, select Manage files > Download and enter the path the script printed.
If the output ends with lines that begin
NOT DONE, admin consent or the Global Reader assignment failed. Ask a Global Administrator or Privileged Role Administrator to finish the steps the script lists before you continue. -
Under Provide the app registration's credentials, choose where the credential comes from:
- Enter a certificate or client secret: Select the Credential type that matches the one the script created, and enter the Tenant ID and Client ID (Application ID) the script printed. For a certificate, select UPLOAD PEM FILE and choose the PEM file you downloaded. For a client secret, enter it in the Client secret box. Mondoo stores what you enter as a credential in the space.
- Use an existing credential: If the space already holds a credential for this app registration, select it instead. The tenant and client IDs come from the credential.
If you can't create credentials in the space, the form doesn't offer these choices. It accepts a certificate only.
-
(Optional) Under Enable security policies (optional), enable the policies you want Mondoo to score your Microsoft 365 tenant against. To learn more, read Manage Policies.
-
(Optional) Under Set Annotations (optional), add key-value pairs that Mondoo applies to every asset this integration discovers. To learn more, read Annotate assets.
-
Select START SCANNING.
The new integration appears under Integrations and begins scanning your Microsoft 365 environment.
Verify the integration
-
In the Mondoo App, select Integrations in the side navigation bar, then select Microsoft 365 and open your integration. Its status is Active when Mondoo can scan the tenant. Error means the last scan failed; check the integration page for the message.

-
When the first scan completes, your Microsoft 365 tenant appears on the INVENTORY page with its check results.
-
If the integration uses a client secret, the SharePoint Online check reports an error. That's expected; the rest of the tenant scans normally.
If the integration page shows Scans are paused, or checks report access errors, read Test and Troubleshoot a Microsoft 365 Integration. To learn what each status means, read Integration status and troubleshooting.
Renew the certificate or client secret
The certificate or client secret the script creates is valid for one year. When it expires, the integration stops scanning. If you stored it as a credential in the space (the form does this whenever you can create credentials), Mondoo marks the credential Expired and shows a Scans are paused alert on the integration page: Credential "<name>" has expired. Rotate it to resume scanning.
Renew it before it expires. To learn how, read Renew the certificate or client secret.
Next steps
Last updated on