securityresources | where type == "microsoft.security/assessments" | extend source = trim(' ', tolower(tostring(properties.resourceDetails.Source))) | extend resourceId = trim(' ', tolower(tostring(case( source =~ "azure", properties.resourceDetails.Id, source =~ "aws" and isnotempty(tostring(properties.resourceDetails.ConnectorId)), properties.resourceDetails.Id, source =~ "gcp" and isnotempty(tostring(properties.resourceDetails.ConnectorId)), properties.resourceDetails.Id, source =~ 'aws', properties.resourceDetails.AzureResourceId, source =~ 'gcp', properties.resourceDetails.AzureResourceId, extract('^(.+)/providers/Microsoft.Security/assessments/.+$',1,id) )))) | extend status = trim(" ", tostring(properties.status.code)) | extend cause = trim(" ", tostring(properties.status.cause)) | extend assessmentKey = tostring(name) | where assessmentKey == "050ac097-3dda-4d24-ab6d-82568e7a50cf"