Before You Start
You need three pieces of information from Microsoft Entra ID:
- Tenant ID — identifies your organisation in Entra ID
- Client ID — identifies the app registration you create to access the API
- Client Secret — the password for that app registration
Setting Up Entra ID Access
Step 1 — Register an Application
- Sign in to the Azure Portal
- Go to Microsoft Entra ID → App registrations → New registration
- Give it a name (e.g.
Entrust-Discovery-MsDefender) and click Register - Copy the Directory (tenant) ID and Application (client) ID from the Overview page
Step 2 — Create a Client Secret
- In your new app registration, go to Certificates & secrets → New client secret
- Set a description and expiry, then click Add
- Copy the Value immediately — it is only shown once
Step 3 — Grant API Permission
- Go to API permissions → Add a permission → APIs my organization uses
- Search for WindowsDefenderATP and select it
- Choose Application permissions and tick
Vulnerability.Read.All - Click Add permissions, then click Grant admin consent (requires an Entra ID admin)