Test or Troubleshoot an Azure Integration
Troubleshoot a Mondoo Azure integration by scanning from cnspec to isolate certificate, secret, and app registration issues.
If an Azure integration fails to scan, run the same checks from cnspec to isolate whether the issue is the certificate, the app registration, or your permissions.
Scan with cnspec
-
Download the latest cnspec from releases.mondoo.com/cnspec. For example:
wget https://releases.mondoo.com/cnspec/14.0.1/cnspec_14.0.1_linux_amd64.tar.gz tar -xvf cnspec_14.0.1_linux_amd64.tar.gz -
Scan your Azure subscription:
cnspec scan azure \ --subscription YOUR-SUBSCRIPTION-ID \ --tenant-id YOUR-TENANT-ID \ --client-id YOUR-CLIENT-ID \ --certificate-path certificate.combo.pem \ --policy-bundle https://raw.githubusercontent.com/mondoohq/cnspec/refs/heads/main/content/mondoo-azure-security.mql.yamlThe client ID is the same as the application ID (or app ID).
Pay attention to queries with Error results. They usually point at missing permissions.
If the certificate scan fails, try a client secret
Authenticate with a client secret to isolate certificate issues:
-
Create a client secret:
- In the Azure portal, open Microsoft Entra ID > App registrations.
- Select the Mondoo app.
- Select Certificates & secrets > New client secret.
- Enter a description and a Duration.
- Select Add and copy the
Valueimmediately (it disappears shortly).
-
Scan with the secret:
cnspec scan azure \ --subscription YOUR-SUBSCRIPTION-ID \ --tenant-id YOUR-TENANT-ID \ --client-id YOUR-CLIENT-ID \ --client-secret YOUR-CLIENT-SECRET-VALUE \ --policy-bundle https://raw.githubusercontent.com/mondoohq/cnspec/refs/heads/main/content/mondoo-azure-security.mql.yamlIf this scan succeeds, the issue is the certificate. Generate and upload a new one.
If the app scan fails, try direct authentication
To rule out the app registration itself, scan as your own user account. This only works if your account has the needed privileges.
cnspec scan azure \
--subscription YOUR-SUBSCRIPTION-ID \
--policy-bundle https://raw.githubusercontent.com/mondoohq/cnspec/refs/heads/main/content/mondoo-azure-security.mql.yamlRenew the application certificate
If you set up the integration with the Terraform setup, the application certificate cnspec integrate azure created has a limited lifetime: 4,096 hours, roughly 170 days. When the certificate expires, the integration stops working. Renew it from the Azure CLI, which creates a new certificate with the Azure CLI's own default lifetime of 1 year. The keyless automated setup uses no certificate, so it has nothing to renew.
To renew the certificate:
-
Navigate to the app registration you created for Mondoo. Copy its application ID for the next step.
-
Open Azure Cloud Shell (top right of the window) and create a new certificate, inserting the application ID you copied:
az ad app credential reset --id XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXX --create-cert -
The certificate is stored in your cloud shell. Download it using the Manage files button in Azure Cloud Shell.
-
In the Mondoo App, open Settings > Credentials for the space. Find the certificate credential that belongs to your Azure integration, then select Rotate.
-
Upload the new certificate file and select ROTATE. The integration starts using it to communicate with Azure.
If you can't find a credential for the integration (its edit page has no Authentication step), its certificate can't be replaced from the Mondoo App. Recreate the integration, preferably with the keyless automated setup.
Still stuck?
If none of the above works, try Microsoft's manual app registration path: Manually Set Up Azure Continuous Scanning.