If you’re running workloads in Azure, one question matters more than most:
“How secure is my environment right now?”
Microsoft provides Secure Score capabilities in Defender for Cloud and Microsoft Entra, but those scores are product-specific. They do not necessarily answer a more operational question: which identity, access, and activity risks should you prioritize in your tenant right now?
The data you need is often spread across:
- Azure Monitor logs
- Microsoft Entra ID identity signals
- Microsoft Defender for Cloud recommendations
- Microsoft Graph reports for some identity-registration data
In this guide, you’ll learn how to build a custom Azure risk score step-by-step using real data from your tenant.
What Is a Custom Azure Risk Score?
A custom Azure risk score is a numerical representation—typically 0–100—of the security risks you choose to measure across your tenant.
It can combine signals such as:
- Identity risk (MFA posture, risky sign-ins)
- Access risk (privileged roles and standing access)
- Activity risk (suspicious behavior and service principal activity)
Important distinction: Unlike Microsoft Secure Score, the example model in this guide is risk-oriented. A score of 0 means lower observed risk, while 100 means higher observed risk.
The goal is simple:
Turn complex security data into one actionable number.
Step 1: Define Azure Security Risk Signals
To build a useful risk score, start with a small set of high-impact signals that can be measured consistently.
Identity Risk Signals
- Users who are not MFA-capable
- Risky sign-ins
- Weak or legacy authentication methods
Access Risk Signals
- Excessive permanent Global Administrator assignments
- Owner/Contributor role sprawl
- Standing privileged access outside controlled groups or PIM
Activity Risk Signals
- Impossible-travel or unfamiliar sign-in signals
- Unexpected privileged changes
- Service principal anomalies
Pro tip: Focus on 5–10 signals max to keep your model understandable and maintainable.
Step 2: Query Azure and Entra Data with KQL (and Graph Where Needed)
Most activity signals can be pulled from Log Analytics. Common native tables include:
SigninLogsAuditLogsAADServicePrincipalSignInLogs
Registration-state data—such as whether a user has an MFA method registered or is MFA-capable—is exposed through Microsoft Graph unless you deliberately ingest that report into Log Analytics as a custom table.
Example: Detect Risky Sign-Ins
SigninLogs
| where TimeGenerated >= ago(30d)
| where isnotempty(UserPrincipalName)
| where RiskLevelDuringSignIn in ("medium", "high")
| summarize RiskySignIns = count(), LastRiskySignIn = max(TimeGenerated) by UserPrincipalName
| order by RiskySignIns desc
This query looks for medium- and high-risk sign-ins during the last 30 days and summarizes them by user. Risk details depend on Microsoft Entra ID Protection licensing; without the required licensing, some risk values can appear as hidden.
Example: Identify Users Without MFA
Do not infer MFA registration from SigninLogs alone. The authoritative Microsoft Entra registration report is the Microsoft Graph userRegistrationDetails endpoint.
GET https://graph.microsoft.com/v1.0/reports/authenticationMethods/userRegistrationDetails?$filter=isMfaRegistered eq false
For a stricter security-posture metric, consider isMfaCapable instead of isMfaRegistered. isMfaCapable indicates that the user has registered a strong authentication method that is allowed by the tenant’s authentication-methods policy.
If you ingest this Graph report into Log Analytics, you can then join it to recent SigninLogs data with KQL. The custom table name will depend on how you ingest the report, so avoid hard-coding a generic AuthenticationMethods table unless you have actually created one.
Step 3: Assign Weights to Each Risk
Not all risks are equal. Assign weights based on potential impact and how strongly each signal should influence the overall score. The following model is illustrative:
| Risk Type | Weight | | --- | ---: | | Users not MFA-capable | 30 | | Privileged role sprawl | 25 | | Risky sign-ins | 20 | | Service principal risk | 15 | | Legacy authentication | 10 |
Total possible score = 100
Step 4: Calculate Your Azure Risk Score
Normalize each signal before applying its weight. This prevents raw counts from dominating the score simply because one tenant is larger than another.
For a simple model, define a threshold for each signal and scale the observed value against it:
Signal Points = min(Observed Value / Threshold, 1) × Weight
Example for the 30-point MFA signal:
- 0% of active users not MFA-capable → 0 points
- 5% or more of active users not MFA-capable → full 30 points
- Values between 0% and 5% → scaled proportionally
Then calculate:
Total Risk Score = Identity + Access + Activity
Example interpretation:
- 0–19: Low Risk
- 20–49: Medium Risk
- 50–100: High Risk
The exact thresholds should reflect your tenant size, risk tolerance, licensing, and operational priorities.
Step 5: Visualize the Risk Score in Azure
Once calculated, visualize the score and its underlying signals so that teams can understand what is driving risk.
You can use:
- Azure Workbooks
- Azure dashboards or other monitoring tools fed by Log Analytics
Your dashboard should include:
- Overall risk score
- Breakdown by category (identity, access, activity)
- Trend over time
- Drilldowns into each signal
Visualization turns raw data into actionable insight.
Common Challenges When Building an Azure Risk Score
Most teams run into the same issues:
- Different signals live in different data sources
- Licensing affects the visibility of some Entra risk signals
- Normalizing counts across tenants of different sizes
- Maintaining KQL and data mappings over time
- Balancing signal against noise
Building the first version is relatively easy. Keeping the model accurate, explainable, and maintainable is the real challenge.
Faster Alternative: Use the AzureWise Identity Security Assessment
If you want to skip building and maintaining everything from scratch, AzureWise packages the assessment into a deployable toolkit that runs in your own Azure environment.
The toolkit includes:
- Azure Workbook risk dashboard
- Azure ITDR KQL query pack
- Custom Azure Security Risk Score (0–100)
- Step-by-step setup documentation
- No SaaS dependency—your Azure data remains in your tenant
Learn more about AzureWise: https://www.azurewise.io/
Get the AzureWise Identity Security Assessment: https://azurewise.gumroad.com/l/buy
Final Thoughts
Microsoft provides rich security data across Azure, Microsoft Entra, Defender for Cloud, and Microsoft Graph. The challenge is turning those signals into a view that reflects the risks your organization actually wants to prioritize.
A custom risk score helps you:
- Understand your current security posture
- Prioritize the highest-impact risks
- Track whether risk is improving or getting worse
- Move from reactive to proactive security
Key Takeaways
- Microsoft provides Secure Score products, but a custom risk score lets you weight the identity, access, and activity signals that matter most to your environment.
- Use native Log Analytics tables such as
SigninLogs,AuditLogs, andAADServicePrincipalSignInLogsfor activity data. - Use Microsoft Graph
userRegistrationDetailsfor MFA registration/capability unless you ingest that data into Log Analytics. - Focus on a small number of high-impact signals and normalize them before weighting.
- Visualization is critical for making the score understandable and actionable.
Microsoft References
- Defender for Cloud Secure Score
- Azure Monitor SigninLogs table
- Microsoft Graph userRegistrationDetails
Want the Azure identity assessment already built?
AzureWise Identity Security Assessment turns Microsoft Entra ID telemetry into a weighted Security Rating, detailed findings, and prioritized remediation guidance inside Azure Monitor.
Get AzureWise — $99