{"generated":"2026-12-02T00:54:08.537Z","source":"https://azureblog.co.uk","count":22,"note":"Ready-to-run KQL queries from posts on azureblog.co.uk, for Log Analytics, Sentinel and Advanced Hunting.","queries":[{"title":"If your organisation uses 1Password (EmailEvents)","table":"EmailEvents","post":"What the 1Password breach means for Entra and Azure admins","url":"https://azureblog.co.uk/posts/1password-breach-azure-admins/#if-your-organisation-uses-1password","query":"EmailEvents\n| where Timestamp > ago(14d)\n| where Subject has \"1Password\" or SenderDisplayName has \"1Password\"\n| where SenderFromDomain != \"1password.com\"\n    and not(SenderFromDomain endswith \".1password.com\")\n| summarize Emails = count(), Recipients = dcount(RecipientEmailAddress)\n    by SenderFromDomain, SenderDisplayName, Subject, DeliveryAction\n| order by Emails desc"},{"title":"If your organisation uses 1Password (SigninLogs)","table":"SigninLogs","post":"What the 1Password breach means for Entra and Azure admins","url":"https://azureblog.co.uk/posts/1password-breach-azure-admins/#if-your-organisation-uses-1password","query":"SigninLogs\n| where TimeGenerated > ago(14d)\n| where AppDisplayName has \"1Password\"\n| summarize SignIns = count(),\n            Failures = countif(ResultType != \"0\"),\n            Countries = make_set(tostring(LocationDetails.countryOrRegion))\n    by UserPrincipalName\n| order by Failures desc"},{"title":"Find what you still have","table":"az","post":"Where Azure web roles and worker roles go before March 2027","url":"https://azureblog.co.uk/posts/azure-web-role-vs-worker-role/#find-what-you-still-have","query":"az graph query -q \"resources\n| where type =~ 'microsoft.compute/cloudservices'\n| project name, resourceGroup, subscriptionId, location\" -o table"},{"title":".NET 8 and .NET 9","table":"resources","post":"10 November is the biggest end-of-support day of the year","url":"https://azureblog.co.uk/posts/10-november-2026-end-of-support-checklist/#net-8-and-net-9","query":"resources\n| where type =~ \"microsoft.web/sites\" or type =~ \"microsoft.web/sites/slots\"\n| mv-expand p = properties.siteProperties.properties\n| where tostring(p.name) =~ \"LinuxFxVersion\"\n| extend stack = tostring(p.value)\n| where stack matches regex @\"(?i)^dotnet(core|-isolated)?\\|(8|9)\\.0\"\n| project name, kind, resourceGroup, subscriptionId, stack\n| order by stack asc"},{"title":"Find every PHP app you run","table":"resources","post":"The PHP flaw that took websites offline, and how to patch PHP apps in Azure","url":"https://azureblog.co.uk/posts/php-critical-security-release-azure-app-service/#find-every-php-app-you-run","query":"resources\n| where type =~ \"microsoft.web/sites\" or type =~ \"microsoft.web/sites/slots\"\n| mv-expand p = properties.siteProperties.properties\n| where tostring(p.name) =~ \"LinuxFxVersion\" and tostring(p.value) startswith \"PHP|\"\n| project name, resourceGroup, subscriptionId, stack = tostring(p.value)\n| order by stack asc"},{"title":"Day-two operations (Resources)","table":"Resources","post":"Azure Arc setup for servers: the complete guide","url":"https://azureblog.co.uk/posts/azure-arc-servers-complete-setup/#day-two-operations","query":"Resources\n| where type == 'microsoft.hybridcompute/machines'\n| summarize Servers = count() by Status = tostring(properties.status)"},{"title":"Day-two operations (AdvisorResources)","table":"AdvisorResources","post":"Azure Arc setup for servers: the complete guide","url":"https://azureblog.co.uk/posts/azure-arc-servers-complete-setup/#day-two-operations","query":"AdvisorResources\n| where type == 'microsoft.advisor/recommendations'\n| where properties.category == 'HighAvailability'\n| where properties.shortDescription.solution == 'Upgrade to the latest version of the Azure Connected Machine agent'\n| project id, JoinId = toupper(properties.resourceMetadata.resourceId),\n    machineName = tostring(properties.impactedValue),\n    agentVersion = tostring(properties.extendedProperties.installedVersion),\n    expectedVersion = tostring(properties.extendedProperties.latestVersion)\n| join kind=leftouter (\n    Resources\n    | where type == 'microsoft.hybridcompute/machines'\n    | project machineId = toupper(id), status = tostring(properties.status)\n  ) on $left.JoinId == $right.machineId\n| where status != 'Expired'\n| summarize by id, machineName, agentVersion, expectedVersion\n| order by tolower(machineName) asc"},{"title":"Find every one you have (DeviceInfo)","table":"DeviceInfo","post":"The last security update for Windows Server 2012 ships tomorrow","url":"https://azureblog.co.uk/posts/windows-server-2012-esu-ends/#find-every-one-you-have","query":"DeviceInfo\n| where Timestamp > ago(7d)\n| where OSPlatform startswith \"WindowsServer2012\"\n| summarize arg_max(Timestamp, OSPlatform, OSBuild, PublicIP) by DeviceName\n| order by DeviceName asc"},{"title":"Find every one you have (resources)","table":"resources","post":"The last security update for Windows Server 2012 ships tomorrow","url":"https://azureblog.co.uk/posts/windows-server-2012-esu-ends/#find-every-one-you-have","query":"resources\n| where type in~ (\"microsoft.compute/virtualmachines\", \"microsoft.hybridcompute/machines\")\n| extend os = tostring(coalesce(properties.extended.instanceView.osName, properties.osSku, properties.osName))\n| where os has \"2012\"\n| project name, type, os, resourceGroup, subscriptionId, location"},{"title":"Finding vaults still on access policies","table":"resources","post":"Moving Key Vault from access policies to Azure RBAC","url":"https://azureblog.co.uk/posts/key-vault-rbac-vs-access-policies/#finding-vaults-still-on-access-policies","query":"// Azure Resource Graph\nresources\n| where type == \"microsoft.keyvault/vaults\"\n| extend rbac = tobool(properties.enableRbacAuthorization)\n| where rbac != true\n| project name, resourceGroup, subscriptionId"},{"title":"1. Top sign-in failures","table":"SigninLogs","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#1-top-sign-in-failures","query":"SigninLogs\n| where TimeGenerated > ago(7d) and ResultType != \"0\"\n| summarize Count = count() by ResultType, ResultDescription\n| top 20 by Count"},{"title":"2. One user's recent sign-ins","table":"SigninLogs","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#2-one-user-s-recent-sign-ins","query":"SigninLogs\n| where TimeGenerated > ago(3d)\n| where UserPrincipalName =~ \"jane.doe@contoso.com\"\n| project TimeGenerated, AppDisplayName, ResultType, ResultDescription,\n          IPAddress, Location = tostring(LocationDetails.countryOrRegion),\n          ConditionalAccessStatus\n| order by TimeGenerated desc"},{"title":"3. Sign-ins blocked by Conditional Access","table":"SigninLogs","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#3-sign-ins-blocked-by-conditional-access","query":"SigninLogs\n| where TimeGenerated > ago(1d) and ConditionalAccessStatus == \"failure\"\n| summarize Count = count() by UserPrincipalName, AppDisplayName\n| order by Count desc"},{"title":"4. Successful sign-ins from new countries","table":"let","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#4-successful-sign-ins-from-new-countries","query":"let known = SigninLogs\n| where TimeGenerated between (ago(30d) .. ago(1d)) and ResultType == \"0\"\n| distinct UserPrincipalName, Country = tostring(LocationDetails.countryOrRegion);\nSigninLogs\n| where TimeGenerated > ago(1d) and ResultType == \"0\"\n| extend Country = tostring(LocationDetails.countryOrRegion)\n| join kind=leftanti known on UserPrincipalName, Country\n| project TimeGenerated, UserPrincipalName, Country, IPAddress, AppDisplayName"},{"title":"5. Password spray pattern","table":"SigninLogs","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#5-password-spray-pattern","query":"SigninLogs\n| where TimeGenerated > ago(1h) and ResultType == \"50126\"\n| summarize Users = dcount(UserPrincipalName) by IPAddress\n| where Users > 10\n| order by Users desc"},{"title":"6. Legacy authentication still in use","table":"SigninLogs","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#6-legacy-authentication-still-in-use","query":"SigninLogs\n| where TimeGenerated > ago(14d)\n| where ClientAppUsed !in (\"Browser\", \"Mobile Apps and Desktop clients\")\n| summarize Count = count() by ClientAppUsed, UserPrincipalName, AppDisplayName\n| order by Count desc"},{"title":"7. Non-interactive sign-ins by app","table":"AADNonInteractiveUserSignInLogs","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#7-non-interactive-sign-ins-by-app","query":"AADNonInteractiveUserSignInLogs\n| where TimeGenerated > ago(1d)\n| summarize Count = count(), Failures = countif(ResultType != \"0\") by AppDisplayName\n| order by Count desc"},{"title":"8. Service principal sign-ins from unexpected IPs","table":"AADServicePrincipalSignInLogs","post":"Six KQL queries for Entra sign-in logs every admin should keep","url":"https://azureblog.co.uk/posts/kql-queries-for-entra-sign-in-logs/#8-service-principal-sign-ins-from-unexpected-ips","query":"AADServicePrincipalSignInLogs\n| where TimeGenerated > ago(7d) and ResultType == \"0\"\n| summarize IPs = make_set(IPAddress, 20), Count = count() by ServicePrincipalName\n| where array_length(IPs) > 3\n| order by Count desc"},{"title":"Building a country block safely","table":"SigninLogs","post":"Getting named locations right in Conditional Access","url":"https://azureblog.co.uk/posts/named-locations-in-conditional-access/#building-a-country-block-safely","query":"SigninLogs\n| where TimeGenerated > ago(30d) and ResultType == \"0\"\n| summarize Users = dcount(UserPrincipalName), SignIns = count() by Country = tostring(LocationDetails.countryOrRegion)\n| order by SignIns desc"},{"title":"Checking coverage","table":"securityresources","post":"Turning on Defender CSPM across a landing zone","url":"https://azureblog.co.uk/posts/defender-cspm-at-scale/#checking-coverage","query":"// Azure Resource Graph: Defender CSPM status per subscription\nsecurityresources\n| where type == \"microsoft.security/pricings\" and name == \"CloudPosture\"\n| project subscriptionId, tier = tostring(properties.pricingTier)\n| order by tier asc"},{"title":"Reviewing the impact","table":"SigninLogs","post":"Test Conditional Access safely with report-only mode and What If","url":"https://azureblog.co.uk/posts/conditional-access-report-only-and-what-if/#reviewing-the-impact","query":"SigninLogs\n| where TimeGenerated > ago(7d)\n| mv-expand ConditionalAccessPolicies\n| where ConditionalAccessPolicies.displayName == \"Require compliant device\"\n| where ConditionalAccessPolicies.result == \"reportOnlyFailure\"\n| summarize Failures = count() by UserPrincipalName, AppDisplayName\n| order by Failures desc"},{"title":"Monitoring","table":"SigninLogs","post":"Break-glass accounts done right","url":"https://azureblog.co.uk/posts/break-glass-accounts-done-right/#monitoring","query":"SigninLogs\n| where UserPrincipalName in~ (\"bg-admin1@contoso.onmicrosoft.com\", \"bg-admin2@contoso.onmicrosoft.com\")\n| project TimeGenerated, UserPrincipalName, IPAddress, AppDisplayName, ResultType"}]}