SOLVED

Query for Azure Backup

%3CLINGO-SUB%20id%3D%22lingo-sub-1532385%22%20slang%3D%22en-US%22%3EQuery%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1532385%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20using%20the%20below%20script%20to%20get%20the%20backup%20information%2C%20but%20in%20this%20script%20I%20can't%20found%20were%20or%20how%20can%20I%20get%20the%20error%20message%2C%20error%20code%20and%20the%20recommendations%20message.%3C%2FP%3E%3CP%3ECan%20anyone%20help%20me%20on%20this%3F%20%3A)%3C%2Fimg%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%26nbsp%3BEvents%26nbsp%3B%3D%26nbsp%3BAzureDiagnostics%0A%0A%7C%26nbsp%3Bwhere%26nbsp%3BCategory%26nbsp%3B%3D%3D%26nbsp%3B%22AzureBackupReport%22%26nbsp%3B%3B%0A%0AEvents%0A%0A%7C%26nbsp%3Bwhere%26nbsp%3BOperationName%26nbsp%3B%3D%3D%26nbsp%3B%22Job%22%26nbsp%3Band%26nbsp%3BJobOperation_s%26nbsp%3B%3D%3D%26nbsp%3B%22Backup%22%0A%0A%7C%26nbsp%3Bproject%26nbsp%3BProtectedServerUniqueId_s%2C%26nbsp%3BJobStatus_s%2C%26nbsp%3BResource%26nbsp%3B%2C%26nbsp%3BTimeGenerated%26nbsp%3B%2C%26nbsp%3BJobStartDateTime_s%26nbsp%3B%2C%26nbsp%3BJobDurationInSecs_s%0A%0A%7C%26nbsp%3Bjoin%26nbsp%3Bkind%3Dinner%0A%0A(%0A%0AEvents%0A%0A%7C%26nbsp%3Bwhere%26nbsp%3BOperationName%26nbsp%3B%3D%3D%26nbsp%3B%22ProtectedServer%22%0A%0A%7C%26nbsp%3Bwhere%26nbsp%3BProtectedServerFriendlyName_s%26nbsp%3B!%3D%26nbsp%3B%22%22%0A%0A%7C%26nbsp%3Bdistinct%26nbsp%3BProtectedServerUniqueId_s%2C%26nbsp%3BProtectedServerFriendlyName_s%0A%0A%7C%26nbsp%3Bproject%26nbsp%3BProtectedServerUniqueId_s%2C%26nbsp%3BProtectedServerFriendlyName_s%0A%0A)%0A%0Aon%26nbsp%3BProtectedServerUniqueId_s%0A%0A%7C%26nbsp%3Bproject%26nbsp%3BProtectedServerFriendlyName_s%2C%26nbsp%3BJobStatus_s%2C%26nbsp%3BResource%2C%26nbsp%3BTimeGenerated%26nbsp%3B%2C%26nbsp%3BJobStartDateTime_s%26nbsp%3B%2C%26nbsp%3BJobDurationInSecs_s%0A%0A%7C%26nbsp%3Bextend%26nbsp%3BVault%3D%26nbsp%3BResource%0A%0A%7C%26nbsp%3Bsummarize%26nbsp%3Bcount()%26nbsp%3Bby%26nbsp%3BProtectedServerFriendlyName_s%2C%26nbsp%3BJobStatus_s%2C%26nbsp%3BVault%2C%26nbsp%3BTimeGenerated%26nbsp%3B%2C%26nbsp%3BJobStartDateTime_s%26nbsp%3B%2C%26nbsp%3BJobDurationInSecs_s%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1532385%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%20Log%20Analytics%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1533188%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1533188%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F115965%22%20target%3D%22_blank%22%3E%40Lucas%20Chies%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20remove%20the%20filters%2C%20like%20this%2C%20do%20you%20see%20the%20Columns%20of%20data%20you%20need%3F%26nbsp%3B%20I%20don't%20see%20names%20like%20Error%20message%20or%20error%20code%20but%20they%20may%20have%20other%20names%3F%26nbsp%3B%20If%20you%20find%20the%20right%20data%20you%20can%20add%20them%20to%20the%20%3CSTRONG%3EProject%3C%2FSTRONG%3E%20and%20%3CSTRONG%3EDistinct%3C%2FSTRONG%3E%20lines%3C%2FP%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-cpp%22%3E%3CCODE%3Elet%20Events%20%3D%20AzureDiagnostics%0A%7C%20where%20Category%20%3D%3D%20%22AzureBackupReport%22%20%3B%0AEvents%0A%7C%20where%20OperationName%20%3D%3D%20%22Job%22%20and%20JobOperation_s%20%3D%3D%20%22Backup%22%0A%2F%2F%7C%20project%20ProtectedServerUniqueId_s%2C%20JobStatus_s%2C%20Resource%20%2C%20TimeGenerated%20%2C%20JobStartDateTime_s%20%2C%20JobDurationInSecs_s%0A%7C%20join%20kind%3Dinner%0A(%0AEvents%0A%7C%20where%20OperationName%20%3D%3D%20%22ProtectedServer%22%0A%7C%20where%20ProtectedServerFriendlyName_s%20!%3D%20%22%22%0A%2F%2F%7C%20distinct%20ProtectedServerUniqueId_s%2C%20ProtectedServerFriendlyName_s%0A%2F%2F%7C%20project%20ProtectedServerUniqueId_s%2C%20ProtectedServerFriendlyName_s%0A)%0Aon%20ProtectedServerUniqueId_s%0A%2F%2F%7C%20project%20ProtectedServerFriendlyName_s%2C%20JobStatus_s%2C%20Resource%2C%20TimeGenerated%20%2C%20JobStartDateTime_s%20%2C%20JobDurationInSecs_s%0A%7C%20extend%20Vault%3D%20Resource%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1533450%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1533450%22%20slang%3D%22en-US%22%3E%3CP%3EHello%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239477%22%20target%3D%22_blank%22%3E%40Clive%20Watson%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETks%20for%20your%20help.%3C%2FP%3E%3CP%3ESo%2C%20all%20scripts%20doesn't%20show%20the%20recommendation.%20I'm%20trying%20to%20find%20this%20message%20on%20the%20below%20screen%3A%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22image.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F206377iC6A3C3AF164133EC%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%22image.png%22%20alt%3D%22image.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3EI'm%20trying%20use%20the%20%22RecommendedAction_s%22%2C%20but%20doesn't%20show%20any%20information.%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3Elet%20Events%20%3D%20AzureDiagnostics%20%0A%7C%20where%20Category%20%3D%3D%20%22AzureBackupReport%22%3B%20Events%20%0A%7C%20extend%20JobOperationSubType_s%20%3D%20columnifexists(%22JobOperationSubType_s%22%2C%20%22%22)%20%0A%7C%20where%20OperationName%20%3D%3D%20%22Job%22%20and%20JobOperation_s%20%3D%3D%20%22Backup%22%20and%20JobStatus_s%20%3D%3D%20%22Failed%22%20and%20JobOperationSubType_s%20!%3D%20%22Log%22%20and%20JobOperationSubType_s%20!%3D%20%22Recovery%20point_Log%22%0A%7C%20distinct%20JobUniqueId_g%2C%20BackupItemUniqueId_s%2C%20JobStatus_s%2C%20Resource%2C%20JobFailureCode_s%2C%20JobStartDateTime_s%2C%20RecommendedAction_s%0A%7C%20project%20BackupItemUniqueId_s%2C%20JobStatus_s%2C%20Resource%2C%20JobFailureCode_s%2C%20JobStartDateTime_s%2C%20RecommendedAction_s%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1538000%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1538000%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F115965%22%20target%3D%22_blank%22%3E%40Lucas%20Chies%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E.%3C%2FP%3E%0A%3CP%3EThat%20is%20an%20%22Alert%22%20operation%20so%20you%20need%20to%20add%20that.%20ie.%26nbsp%3B%3C%2FP%3E%0A%3CDIV%3E%0A%3CDIV%3E%3CSTRONG%3E%7C%20where%20OperationName%20%3D%3D%20%22Alert%22%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FSTRONG%3EAmended%20query%3A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CPRE%20class%3D%22lia-code-sample%20language-cpp%22%3E%3CCODE%3Elet%20Events%20%3D%20AzureDiagnostics%20%0A%7C%20where%20Category%20%3D%3D%20%22AzureBackupReport%22%3B%0A%20Events%20%0A%7C%20extend%20JobOperationSubType_s%20%3D%20columnifexists(%22JobOperationSubType_s%22%2C%20%22%22)%20%0A%7C%20where%20OperationName%20%3D%3D%20%22Alert%22%20or%20%20OperationName%20%3D%3D%20%22Job%22%20%0A%20%20%20%20%20%20%20%20and%20JobOperation_s%20%3D%3D%20%22Backup%22%20and%20JobStatus_s%20%3D%3D%20%22Failed%22%0A%20%20%20%20%20%20%20%20and%20JobOperationSubType_s%20!in%20(%22Log%22%2C%22Recovery%20point_Log%22)%0A%7C%20distinct%20JobUniqueId_g%2C%20BackupItemUniqueId_s%2C%20JobStatus_s%2C%20Resource%2C%20JobFailureCode_s%2C%20JobStartDateTime_s%2C%20RecommendedAction_s%0A%7C%20project%20BackupItemUniqueId_s%2C%20JobStatus_s%2C%20Resource%2C%20JobFailureCode_s%2C%20JobStartDateTime_s%2C%20RecommendedAction_s%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1543708%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1543708%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F239477%22%20target%3D%22_blank%22%3E%40Clive%20Watson%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%20Clive%2C%3C%2FP%3E%3CP%3EI%C2%B4m%20trying%20to%20achieve%20the%20same%20here.%20Tested%20the%20amended%20query%2C%20but%20no%20luck%20on%20getting%20the%20Error%20Message%20or%20the%20Recommended%20Action%20yet.%3C%2FP%3E%3CP%3EQuest%20continues...%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1543732%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1543732%22%20slang%3D%22en-US%22%3EAddonAzureBackupJobs%3CBR%20%2F%3E%7C%20where%20JobOperation%3D%3D%22Backup%22%3CBR%20%2F%3E%7C%20summarize%20arg_max(TimeGenerated%2C*)%20by%20JobUniqueId%3CBR%20%2F%3E%7C%20where%20JobStatus%3D%3D%22Completed%22%3CBR%20%2F%3E%7C%20join%20kind%3Dinner%3CBR%20%2F%3E(%3CBR%20%2F%3ECoreAzureBackup%3CBR%20%2F%3E%7C%20where%20OperationName%20%3D%3D%20%22BackupItem%22%3CBR%20%2F%3E%7C%20where%20BackupItemType%3D%3D%22VM%22%20and%20BackupManagementType%3D%3D%22IaaSVM%22%3CBR%20%2F%3E%7C%20distinct%20BackupItemUniqueId%2C%20BackupItemFriendlyName%3CBR%20%2F%3E)%3CBR%20%2F%3Eon%20BackupItemUniqueId%3CBR%20%2F%3E%3CBR%20%2F%3EI%20hope%20this%20code%20helps%20you%20out.%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1548850%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1548850%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F493704%22%20target%3D%22_blank%22%3E%40Lewis-H%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETried%20the%20same%2C%20but%20neither%20Error%20Message%20nor%20Recommended%20action%20are%20returned%20by%20this%20query.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1553771%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1553771%22%20slang%3D%22en-US%22%3EHi%20Everyone%2C%3CBR%20%2F%3Ejust%20to%20make%20sure%2C%20this%20thread%20should%20be%20re-opened%20until%20a%20working%20solution%20is%20achieved%2C%20right%3F%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1555226%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1555226%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F735174%22%20target%3D%22_blank%22%3E%40GBADARO%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThat's%20correct%2C%20question%20is%20still%20open%20until%20you%20are%20happy%20or%20our%20collective%20knowledge%20is%20exhausted.%26nbsp%3B%20I%20see%20this%20data%20with%20the%20query%20I%20provided.%26nbsp%3B%20You%20can%20see%20it%20working%20in%20the%20demo%20data%20set%20here%3A%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fms.portal.azure.com%23%4072f988bf-86f1-41af-91ab-2d7cd011db47%2Fblade%2FMicrosoft_Azure_Monitoring_Logs%2FDemoLogsBlade%2FresourceId%2F%252FDemo%2Fsource%2FLogsBlade.AnalyticsShareLinkToQuery%2Fq%2FH4sIAAAAAAAAA72RTU4DMQyF95V6B5NVK80N0CxKC1IRAmla1qM0Y4bAJA6JU1rE4Uk6%25252FRMqW7K0X56%25252FZ3fIcLtGywFKmHxFjzMtW0uBtQowHHzD5yt6hKlkbMlvoSxB7HQ3Ur1HV6Ejz%25252BJ6ODjY5D%25252B4YbQN3NPqyaGXrMku4mq5dVjnOYq6aKx%25252BwY0OHEbiok4UIMT4DOEoeZQGe44O02wgDxeayVSk37B%25252F8hdPBkmqPoU4tBcsOYZ9707qDhvxt8cp05W2MBIP1IpCVKhojWlVjrTlOhfHOUWTwmqrOFs8W%25252F0Rcd7UbQE9wpzRHKuhOIcpoMJA0SvclTNW2v%25252BUGjwJPc%25252FShZbaYK9XZEw6ATYT1afNBM7TGyaA%25252F5n4A%25252B5BT3VbAgAA%2Ftimespan%2FP7D%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3EGo%20to%20Log%20Analytics%20and%20run%20query%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAs%20to%20why%20you%20don't%20have%20it%2C%20perhaps%20its%20the%20back%20up%20type%20or%20other%20issue.%26nbsp%3B%20I'm%20not%20familiar%20with%20backup%2C%20so%20perhaps%20others%20will%20comment%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1623879%22%20slang%3D%22en-US%22%3ERe%3A%20Query%20for%20Azure%20Backup%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1623879%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F493704%22%20target%3D%22_blank%22%3E%40Lewis-H%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHi%2C%20I%20used%20your%20query%20and%20it%20works%20fine.%20Can%20you%20please%20add%20lines%20to%20display%20database%20backups%20(SQL%20in%20Azure%20VM)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

Hello All,

 

I'm using the below script to get the backup information, but in this script I can't found were or how can I get the error message, error code and the recommendations message.

Can anyone help me on this? :)

 

 

let Events = AzureDiagnostics

| where Category == "AzureBackupReport" ;

Events

| where OperationName == "Job" and JobOperation_s == "Backup"

| project ProtectedServerUniqueId_s, JobStatus_s, Resource , TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s

| join kind=inner

(

Events

| where OperationName == "ProtectedServer"

| where ProtectedServerFriendlyName_s != ""

| distinct ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s

| project ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s

)

on ProtectedServerUniqueId_s

| project ProtectedServerFriendlyName_s, JobStatus_s, Resource, TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s

| extend Vault= Resource

| summarize count() by ProtectedServerFriendlyName_s, JobStatus_s, Vault, TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s

 

9 Replies

@Lucas Chies 

 

If you remove the filters, like this, do you see the Columns of data you need?  I don't see names like Error message or error code but they may have other names?  If you find the right data you can add them to the Project and Distinct lines

let Events = AzureDiagnostics
| where Category == "AzureBackupReport" ;
Events
| where OperationName == "Job" and JobOperation_s == "Backup"
//| project ProtectedServerUniqueId_s, JobStatus_s, Resource , TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s
| join kind=inner
(
Events
| where OperationName == "ProtectedServer"
| where ProtectedServerFriendlyName_s != ""
//| distinct ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s
//| project ProtectedServerUniqueId_s, ProtectedServerFriendlyName_s
)
on ProtectedServerUniqueId_s
//| project ProtectedServerFriendlyName_s, JobStatus_s, Resource, TimeGenerated , JobStartDateTime_s , JobDurationInSecs_s
| extend Vault= Resource

 

Hello @Clive Watson 

 

Tks for your help.

So, all scripts doesn't show the recommendation. I'm trying to find this message on the below screen:

image.png

I'm trying use the "RecommendedAction_s", but doesn't show any information.

let Events = AzureDiagnostics 
| where Category == "AzureBackupReport"; Events 
| extend JobOperationSubType_s = columnifexists("JobOperationSubType_s", "") 
| where OperationName == "Job" and JobOperation_s == "Backup" and JobStatus_s == "Failed" and JobOperationSubType_s != "Log" and JobOperationSubType_s != "Recovery point_Log"
| distinct JobUniqueId_g, BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s
| project BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s

 

@Lucas Chies 

.

That is an "Alert" operation so you need to add that. ie. 

| where OperationName == "Alert"

Amended query:
let Events = AzureDiagnostics 
| where Category == "AzureBackupReport";
 Events 
| extend JobOperationSubType_s = columnifexists("JobOperationSubType_s", "") 
| where OperationName == "Alert" or  OperationName == "Job" 
        and JobOperation_s == "Backup" and JobStatus_s == "Failed"
        and JobOperationSubType_s !in ("Log","Recovery point_Log")
| distinct JobUniqueId_g, BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s
| project BackupItemUniqueId_s, JobStatus_s, Resource, JobFailureCode_s, JobStartDateTime_s, RecommendedAction_s

  

@Clive Watson 

 

Hi Clive,

I´m trying to achieve the same here. Tested the amended query, but no luck on getting the Error Message or the Recommended Action yet.

Quest continues...

best response confirmed by ThereseSolimeno (Microsoft)
Solution
AddonAzureBackupJobs
| where JobOperation=="Backup"
| summarize arg_max(TimeGenerated,*) by JobUniqueId
| where JobStatus=="Completed"
| join kind=inner
(
CoreAzureBackup
| where OperationName == "BackupItem"
| where BackupItemType=="VM" and BackupManagementType=="IaaSVM"
| distinct BackupItemUniqueId, BackupItemFriendlyName
)
on BackupItemUniqueId

I hope this code helps you out.

@Lewis-H 

Tried the same, but neither Error Message nor Recommended action are returned by this query. 

Hi Everyone,
just to make sure, this thread should be re-opened until a working solution is achieved, right?

@GBADARO 

 

That's correct, question is still open until you are happy or our collective knowledge is exhausted.  I see this data with the query I provided.  You can see it working in the demo data set here:

Go to Log Analytics and run query

 

As to why you don't have it, perhaps its the back up type or other issue.  I'm not familiar with backup, so perhaps others will comment? 

@Lewis-H 

Hi, I used your query and it works fine. Can you please add lines to display database backups (SQL in Azure VM)