%3CLINGO-SUB%20id%3D%22lingo-sub-1525185%22%20slang%3D%22en-US%22%3EImprove%20the%20Effectiveness%20of%20your%20SOC%20with%20Office%20365%20ATP%20and%20the%20O365%20Management%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1525185%22%20slang%3D%22en-US%22%3E%3CH4%20id%3D%22toc-hId--598887252%22%20id%3D%22toc-hId--598887252%22%20id%3D%22toc-hId--598887252%22%20id%3D%22toc-hId--598887252%22%20id%3D%22toc-hId--598887252%22%3E%3CFONT%20size%3D%223%22%3EThis%20post%20was%20authored%20by%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37064%22%20target%3D%22_blank%22%3E%40Pawel%20Partyka%3C%2FA%3E%20from%20the%20Office%20365%20ATP%20Customer%20Experience%20Engineering%20team%2C%20along%20with%20the%20Microsoft%26nbsp%3B%3CSPAN%3EDigital%20Security%20and%20Risk%20Engineering%20(DSRE)%20team.%26nbsp%3B%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FH4%3E%0A%3CP%3E%3CFONT%20size%3D%223%22%3E%3CSPAN%3ESpecial%20thanks%20to%26nbsp%3B%5B%23%24dp896%5D%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F219026%22%20target%3D%22_blank%22%3E%40Satyajit%20Dash%3C%2FA%3E%2C%26nbsp%3BAnki%20Narravula%2C%20and%20Sidhartha%20Bose%20for%20their%20contributions.%20%3C%2FSPAN%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1187561003%22%20id%3D%22toc-hId-1187561003%22%20id%3D%22toc-hId-1187561003%22%20id%3D%22toc-hId-1187561003%22%20id%3D%22toc-hId-1187561003%22%3E1%20-%20Introduction%3C%2FH2%3E%0A%3CP%3EOffice%20365%20Advanced%20Threat%20Protection%20provides%20several%20built-in%20security%20alerts%20to%20help%20customers%20detect%20and%20mitigate%20potential%20threats.%20In%20many%20large%20enterprises%20there%20is%20often%20a%20need%20to%20integrate%20these%20alerts%20with%20a%20SIEM%20platform%20or%20other%20case%20management%20tools%20to%20enable%20a%20Security%20Operations%20Center%20(SOC)%20team%20to%20monitor%20the%20alerts.%20The%20Office%20365%20Management%20Activity%20API%20provides%20these%20SOC%20teams%20the%20ability%20to%20integrate%20O365%20ATP%20alerts%20with%20other%20platforms.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOne%20of%20the%20challenges%20that%20organizations%20often%20face%2C%20particularly%20large%20enterprises%2C%20is%20the%20ever-increasing%20volume%20of%20alerts%20that%20the%20SOC%20needs%20to%20monitor.%20This%20at%20times%20makes%20it%20important%20to%20integrate%20and%20onboard%20only%20specific%20alerts%20to%20the%20monitoring%20and%20case%20management%20platforms%20or%20SIEM.%3C%2FP%3E%0A%3CP%3ELet%E2%80%99s%20take%20an%20integration%20scenario%20that%20we%20worked%20on%20recently.%20As%20part%20of%20effort%20to%20deal%20with%20phishing%20related%20threats%2C%20one%20of%20our%20large%20enterprise%20customers%20wanted%20to%20fetch%20and%20integrate%20%E2%80%9Cuser-reported%20phishing%20alerts%E2%80%9D.%20However%2C%20they%20only%20wanted%20to%20their%20SOC%20to%20get%20those%20alerts%20that%20have%20already%20been%20processed%20by%20an%20Automated%20Investigation%20and%20Response%20(AIR)%20playbook%20%26nbsp%3Bto%20reduce%20false%20positives%20and%20focus%20on%20real%20threats.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOur%20engineering%20team%20worked%20on%20a%20solution%20which%20efficiently%20fetches%20only%20the%20relevant%20alerts%20using%20the%20Office%20365%20Management%20API%20and%20integrates%20them%20with%20the%20SIEM%20and%20case%20management%20platform.%20Below%20is%20the%20solution%20and%20the%20reference%20architecture.%20This%20could%20potentially%20be%20used%20to%20fetch%20and%20integrate%20other%20relevant%20alerts%20from%20Office%20365%20ATP.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--619893460%22%20id%3D%22toc-hId--619893460%22%20id%3D%22toc-hId--619893460%22%20id%3D%22toc-hId--619893460%22%20id%3D%22toc-hId--619893460%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680671%22%3E%3C%2FA%3E2%20-%20Azure%20Components%3C%2FH2%3E%0A%3CP%3EAs%20mentioned%20in%20the%20introduction%2C%20we%20have%20used%20the%20Azure%20cloud%20to%20set%20up%20end-to-end%20infrastructure%20for%20getting%20O365%20audit%20events%20and%20storing%20the%20required%20filtered%20data%20for%20near%20real-time%20security%20monitoring%20and%20historical%20analysis.%20After%20evaluating%20and%20analyzing%20various%20combinations%20of%20Azure%20services%2C%20we%20have%20decided%20to%20use%20following%20Azure%20components.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E-ERR%3AREF-NOT-FOUND-Azure%20Data%20Explorer%20(Kusto)%20for%20final%20storage%2C%20which%20gives%20us%20real-time%20querying%20capabilities%20for%20data%20analysis.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fdata-explorer%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20blob%20containers%3C%2FA%3E%20-%20As%20a%20staging%20area%20and%20for%20data%20archival.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fstorage%2Fblobs%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20automation%20account%3C%2FA%3E%20%E2%80%93%20For%20deploying%20and%20automating%20the%20PowerShell%20scripts%20we%20used%20to%20fetch%20audit%20data%20using%20the%20Office%20365%20Management%20API.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fautomation%2Fautomation-intro%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Logic%20app%3C%2FA%3E%20%E2%80%93%20For%20scheduling%20and%20calling%20the%20PowerShell%20runbooks.%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Flogic-apps%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Key%20Vault%3C%2FA%3E%20%E2%80%93%20For%20storing%20the%20secrets%20required%20for%20accessing%20the%20Management%20API.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EThe%20architecture%20diagram%20below%20depicts%20the%20end-to-end%20setup.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_0%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_33%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSTRONG%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Pawel.jpg%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205644i9C338A5E28513188%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Pawel.jpg%22%20alt%3D%22Figure%201%3A%20Architecture%20diagram%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%201%3A%20Architecture%20diagram%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1867619373%22%20id%3D%22toc-hId-1867619373%22%20id%3D%22toc-hId-1867619373%22%20id%3D%22toc-hId-1867619373%22%20id%3D%22toc-hId-1867619373%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680672%22%3E%3C%2FA%3E3%20-%20Setting%20up%20the%20Azure%20Active%20Directory%20application%3C%2FH2%3E%0A%3CP%3ETo%20access%20audit%20data%20from%20the%20O365%20Management%20API%2C%20we%E2%80%99ll%20configure%20access%20though%20an%20Azure%20Active%20Directory%20(AAD)%20application.%20Create%20an%20AAD%20application%20using%20the%20steps%20below%2C%20and%20get%20access%20to%20this%20AAD%20application%20from%20the%20tenant%20admin.%20Once%20you%20have%20access%2C%20keep%20a%20note%20of%20the%20Client%20Id%20and%20secret%20key%20of%20this%20application%2C%20because%20we%20will%20need%20these%20details%20later.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--1736786449%22%20id%3D%22toc-hId--1736786449%22%20id%3D%22toc-hId--1736786449%22%20id%3D%22toc-hId--1736786449%22%20id%3D%22toc-hId--1736786449%22%3E3.1%20-%20Azure%20AD%20app%20registration%3C%2FH3%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20the%26nbsp%3B-ERR%3AREF-NOT-FOUND-Azure%20AD%20admin%20portal.%3C%2FLI%3E%0A%3CLI%3EClick%20%E2%80%9CNew%20registration%E2%80%9D.%3C%2FLI%3E%0A%3CLI%3EEnter%20a%20name%20for%20your%20app%20(for%20example%20%22Management%20Activity%20API%22).%20Leave%20the%20%E2%80%9CAccounts%20in%20this%20organizational%20directory%20only%E2%80%9D%20option%20selected.%3C%2FLI%3E%0A%3CLI%3ESelect%20%E2%80%9CWeb%E2%80%9D%20and%20click%20%22Register%22.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_1%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205645iD4C0E7661F8AD77E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%222.png%22%20alt%3D%22Figure%202%3A%20Registering%20an%20Azure%20AD%20application%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%202%3A%20Registering%20an%20Azure%20AD%20application%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EClick%20%E2%80%9CAPI%20permissions%E2%80%9D%20from%20left%20navigation%20menu.%3C%2FLI%3E%0A%3CLI%3EClick%20%E2%80%9CAdd%20a%20permission%E2%80%9D%20and%20then%20%22Office%20365%20Management%20APIs%22.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_2%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205646iB9B1830F1B17AE0F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%223.png%22%20alt%3D%22Figure%203%3A%20Requesting%20API%20permissions%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%203%3A%20Requesting%20API%20permissions%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EClick%20%22Application%20permissions%22.%20Expand%20%E2%80%9CActivityFeed%E2%80%9D%20and%20select%20%E2%80%9CActivityFeed.Read%E2%80%9D%2C%20expand%20%E2%80%9CServiceHealth%E2%80%9D%20and%20select%20%E2%80%9CServiceHealth.Read%E2%80%9D.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_3%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%224.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205647i0CEE7F2E79628AEA%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%224.png%22%20alt%3D%22Figure%204%3A%20Configuration%20of%20API%20permissions%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%204%3A%20Configuration%20of%20API%20permissions%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EClick%20Add%20permissions.%3C%2FLI%3E%0A%3CLI%3ERefresh%20the%20list%20of%20permissions.%20Click%20%E2%80%9CGrant%20admin%20consent%20for%20%3CYOUR%20organization%3D%22%22%3E%E2%80%9D.%20Click%20Yes.%3C%2FYOUR%3E%3C%2FLI%3E%0A%3CLI%3EOn%20the%20App%20screen%20click%20%E2%80%9COverview%E2%80%9D%20and%20copy%20%E2%80%9CApplication%20(client)%20ID%E2%80%9D%20to%20the%20clipboard.%20You%20will%20need%20this%20later%20when%20configuring%20the%20ClientIDtoAccessO365%20Automation%20Account%20variable%20value.%3C%2FLI%3E%0A%3CLI%3EClick%20%E2%80%9CCertificates%20%26amp%3B%20secrets%E2%80%9D.%20Click%20%E2%80%9CNew%20client%20secret%E2%80%9D.%20Assign%20a%20name%20to%20the%20secret.%20Click%20Add.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_4%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%225.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205648iA037D87E9645BD28%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%225.png%22%20alt%3D%22Figure%205%3A%20Certificates%20%26amp%3B%20secrets%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%205%3A%20Certificates%20%26amp%3B%20secrets%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EAfter%20the%20secret%20is%20generated%2C%20copy%20the%20secret%20to%20the%20clipboard%20by%20clicking%20on%20the%20%E2%80%9Ccopy%E2%80%9D%20icon%20next%20to%20the%20secret%20value.%20You%20will%20need%20this%20later%20when%20configuring%20the%20ClientSecrettoAccessO365%20Automation%20Account%20variable%20value.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_5%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%226.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205649iE206E69BBCBF0FC9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%226.png%22%20alt%3D%22Figure%206%3A%20Client%20secrets%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%206%3A%20Client%20secrets%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1747289553%22%20id%3D%22toc-hId--1747289553%22%20id%3D%22toc-hId--1747289553%22%20id%3D%22toc-hId--1747289553%22%20id%3D%22toc-hId--1747289553%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680673%22%3E%3C%2FA%3E4%20-%20Setup%20storage%20account%3C%2FH2%3E%0A%3CP%3EWe%20need%20to%20set%20up%20a%20storage%20account%20for%20data%20storage%2C%20which%20we%20will%20use%20%26nbsp%3Bas%20a%20staging%20area.%20We%20can%20retain%20data%20here%20for%20longer%20term%2C%20to%20be%20used%20for%20historical%20data%20analysis.%20Below%20is%20the%20step-by-step%20process%20for%20setting%20up%20the%20storage%20account.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3ENote%3C%2FSTRONG%3E%3A%20Use%20the%20same%20%E2%80%9CResource%20Group%20Name%E2%80%9D%20for%20all%20the%20resources%20we%20are%20setting%20up%2C%20so%20that%20we%20can%20track%20all%20the%20resources%20easily.%3C%2FLI%3E%0A%3CLI%3EMake%20a%20note%20of%20the%20name%20of%20the%20blob%20storage%20account%20and%20name%20of%20the%20container%2C%20because%20we%20will%20need%20to%20assign%20this%20%26nbsp%3Bto%20a%20variable%20in%20the%20automation%20account.%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3EOnce%20we%20create%20the%20container%2C%20we%20can%20see%20the%20container%20like%20below%20when%20we%20navigate%20to%20%E2%80%9CContainer%E2%80%9D%20section%20inside%20the%20storage%20account.%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3ESteps%20to%20create%20Storage%20Account%3C%2FSTRONG%3E%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20%E2%80%9CStorage%20account%E2%80%9D%20service%20in%20the%20Azure%20portal%20and%20select%20%E2%80%9CAdd%20new%E2%80%9D%20to%20create%20a%20new%20storage%20account.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_6%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%227.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205650i456020BD096E360E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%227.png%22%20alt%3D%22Figure%207%3A%20Storage%20accounts%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%207%3A%20Storage%20accounts%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_7%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%228.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205651i6DC694021AA99C79%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%228.png%22%20alt%3D%22Figure%208%3A%20Create%20storage%20account%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%208%3A%20Create%20storage%20account%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EOnce%20we%20have%20a%20storage%20account%20created%2C%20click%20on%20%E2%80%9CContainers%E2%80%9D%20to%20create%20one%20container.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_8%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%229.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205652i10FC64C8505BB465%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%229.png%22%20alt%3D%22Figure%209%3A%20Create%20a%20container%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%209%3A%20Create%20a%20container%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EClick%20%E2%80%9CContainer%E2%80%9D%20to%20add%20a%20new%20container.%3C%2FLI%3E%0A%3CLI%3EProvide%20name%20for%20the%20container.%20Make%20sure%20that%20%E2%80%9CPrivate%E2%80%9D%20access%20is%20selected.%3C%2FLI%3E%0A%3CLI%3EFor%20more%20details%2C%20refer%20to%20these%20steps%20to%20create%20a%20-ERR%3AREF-NOT-FOUND-blob%20storage%20account%3CSPAN%3E.%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22toc-hId-740223280%22%20id%3D%22toc-hId-740223280%22%20id%3D%22toc-hId-740223280%22%20id%3D%22toc-hId-740223280%22%20id%3D%22toc-hId-740223280%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680674%22%3E%3C%2FA%3E5%20-%20Create%20a%20file%20share%20in%20the%20storage%20account%3C%2FH2%3E%0A%3CP%3EWe%20will%20use%20Azure%20File%20share%20to%20store%20the%20.dlls%20needed%20by%20Azure%20Data%20Explorer%20for%20the%20ingestion%20process.%20Follow%20the%20-ERR%3AREF-NOT-FOUND-step-by-step%20process%20as%20described%20to%20create%20an%20Azure%20file%20share%20in%20the%20storage%20account.%20We%20can%20create%20this%20file%20share%20under%20the%20same%20storage%20account%2C%20which%20we%20have%20created%20in%20previous%20step.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20the%20storage%20account%20we%20have%20created%20above%20and%20select%20%E2%80%9CFile%20share%E2%80%9D.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_9%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2210.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205656iE95471E677F4B358%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2210.png%22%20alt%3D%22Figure%2010%3A%20File%20shares%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2010%3A%20File%20shares%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EClick%20%E2%80%9CFile%20share%E2%80%9D%20to%20create%20new%20file%20share.%20Provide%20a%20name%20for%20the%20file%20share%20and%20allocate%20a%201GB%20quota.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_10%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2211.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205657i5E0685A8B87083F9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2211.png%22%20alt%3D%22Figure%2011%3A%20Creating%20a%20file%20share%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2011%3A%20Creating%20a%20file%20share%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EKeep%20a%20note%20on%20the%20storage%20account%20and%20file%20share%20name%2C%20we%20will%20require%20them%20in%20the%20Automation%20Account.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22toc-hId--1067231183%22%20id%3D%22toc-hId--1067231183%22%20id%3D%22toc-hId--1067231183%22%20id%3D%22toc-hId--1067231183%22%20id%3D%22toc-hId--1067231183%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680675%22%3E%3C%2FA%3E6%20-%20Setting%20up%20Azure%20Data%20Explorer%20(Kusto)%20Data%20store%3C%2FH2%3E%0A%3CP%3ECreate%20an%20Azure%20Data%20Explorer%20cluster%20and%20database%20by%20-ERR%3AREF-NOT-FOUND-following%20this%20step-by-step%20guide%20or%20the%20steps%20given%20below.%20Once%20the%20cluster%20is%20created%2C%20copy%20the%20details%20of%20cluster%20and%20database%20which%20we%E2%80%99ll%20need%20when%20inputting%20the%20Azure%20Automation%20Account%20variables.%3C%2FP%3E%0A%3CP%3EFor%20writing%20data%20into%20Azure%20Data%20Explorer%20we%20will%20use%20%E2%80%9CService%20Principal%20%2F%20AAD%20application%E2%80%9D%20access%20(using%20the%20service%20principal%20secret).%20We%20will%20need%20%E2%80%9CAdmin%E2%80%9D%20permissions%20during%20the%20first%20run%20of%20the%20script%20to%20create%20a%20table%20in%20the%20Kusto%20database.%20After%20the%20table%20is%20successfully%20created%2C%20permissions%20can%20be%20reduced%20to%20%E2%80%9CIngestor%E2%80%9D%20permissions.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ELogin%20to%20the%20Azure%20portal.%20Search%20for%20the%20service%20%E2%80%9CAzure%20Data%20Explorer%E2%80%9D.%20Click%20%E2%80%9CAdd%E2%80%9D%20to%20create%20a%20new%20cluster.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_11%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2212.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205658i491460021AB563D1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2212.png%22%20alt%3D%22Figure%2012%3A%20Azure%20Data%20Explorer%20Clusters%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2012%3A%20Azure%20Data%20Explorer%20Clusters%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EProvide%20the%20required%20details%20and%20create%20the%20cluster.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_12%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2213.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205659iD623CF1ECC16AED0%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2213.png%22%20alt%3D%22Figure%2013%3A%20Create%20an%20Azure%20Data%20Explorer%20Cluster%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2013%3A%20Create%20an%20Azure%20Data%20Explorer%20Cluster%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EOnce%20we%20have%20the%20Azure%20Data%20Explorer%20Cluster%20created%2C%20we%20need%20to%20create%20a%20database%20under%20this%20cluster.%20Navigate%20to%20the%20cluster%20we%20have%20created%20and%20click%20%E2%80%9CAdd%20database%E2%80%9D.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_13%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2214.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%2F205660i1325521305D009D5%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2214.png%22%20alt%3D%22Figure%2014%3A%20Create%20new%20database%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2014%3A%20Create%20new%20database%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH3%20id%3D%22toc-hId--376669709%22%20id%3D%22toc-hId--376669709%22%20id%3D%22toc-hId--376669709%22%20id%3D%22toc-hId--376669709%22%20id%3D%22toc-hId--376669709%22%3E6.1%20-%20-ERR%3AREF-NOT-FOUND-Add%20Azure%20Active%20Directory%20app%20%2F%20Service%20principal%20for%20write%20access%20in%20Azure%20Data%20Explorer.%3C%2FH3%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20Azure%20Data%20Explorer%20Clusters.%3C%2FLI%3E%0A%3CLI%3EOpen%20the%20cluster%20that%20you%20have%20created%20in%20previous%20step.%3C%2FLI%3E%0A%3CLI%3EOpen%20the%20database%20created%20under%20Kusto%20cluster.%20Click%20%E2%80%9CPermissions%E2%80%9D.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_14%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2215.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205661i26E1D99CAB64BD7F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2215.png%22%20alt%3D%22Figure%2015%3A%20Database%20Permissions%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2015%3A%20Database%20Permissions%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3EClick%20Add.%20Make%20sure%20the%20%E2%80%9CAdmin%E2%80%9D%20role%20is%20selected.%20Click%20%E2%80%9CSelect%20principals%E2%80%9D.%20In%20the%20New%20Principals%20fly-out%2C%20paste%20the%20Application%20ID%20of%20the%20Run%20As%20Automation%20account.%20Select%20the%20Application%20ID%20entity.%20Click%20%E2%80%9CSelect%E2%80%9D%20and%20click%20%E2%80%9CSave%E2%80%9D.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_15%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2216.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205662i971DB4AC182CE523%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2216.png%22%20alt%3D%22Figure%2016%3A%20Add%20Permissions%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2016%3A%20Add%20Permissions%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3ETo%20find%20the%20Azure%20Run%20As%20Account%20Application%20ID%20follow%20these%20steps%3A%20On%20the%20Automation%20Accounts%20page%2C%20select%20your%20Automation%20account%20from%20the%20list.%20In%20the%20left%20pane%2C%20select%26nbsp%3B%3CSTRONG%3ERun%20As%20Accounts%3C%2FSTRONG%3E%26nbsp%3Bin%20the%20account%20settings%20section.%20Click%20%3CSTRONG%3EAzure%20Run%20As%20Account.%20%3C%2FSTRONG%3ECopy%20the%20Application%20ID.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_16%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2217.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%2F205663i8341AC4A9674DEC6%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2217.png%22%20alt%3D%22Figure%2017%3A%20AzureRunAs%20account%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2017%3A%20AzureRunAs%20account%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--387172813%22%20id%3D%22toc-hId--387172813%22%20id%3D%22toc-hId--387172813%22%20id%3D%22toc-hId--387172813%22%20id%3D%22toc-hId--387172813%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680676%22%3E%3C%2FA%3E7%20-%20Upload%20Kusto%20library%20to%20file%20share%3C%2FH2%3E%0A%3CP%3EWe%20need%20to%20upload%20Kusto%20libraries%20to%20the%20Azure%20Storage%20Account%20File%20Share.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EDownload%20Microsoft.Azure.Kusto.Tools%20Nuget%20package%20Here.%20%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.Azure.Kusto.Tools%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.nuget.org%2Fpackages%2FMicrosoft.Azure.Kusto.Tools%2F%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3EThe%20downloaded%20NuPKG%20file%20is%20just%20an%20archive%20file.%20Extract%20the%20files%20from%20%E2%80%9Ctools%E2%80%9D%20folder%20NuGet%20package%2C%20to%20any%20folder%20on%20your%20computer.%3C%2FLI%3E%0A%3CLI%3EIn%20the%20web%20browser%20navigate%20to%20the%20%E2%80%9CFile%20share%E2%80%9D%20created%20in%20chapter%205.%20Open%20the%20file%20share.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_17%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2218.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205664iC9CAE0DC27286C2A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2218.png%22%20alt%3D%22Figure%2018%3A%20File%20Shares%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2018%3A%20File%20Shares%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3EClick%20%E2%80%9CAdd%20directory%E2%80%9D.%20Enter%20a%20name%20for%20the%20directory%3A%20%E2%80%9CMicrosoft.Azure.Kusto.Tools%E2%80%9D%3C%2FLI%3E%0A%3CLI%3EEnter%20the%20newly%20created%20folder%20and%20click%20%E2%80%9CUpload%E2%80%9D.%20Select%20all%20the%20files%20extracted%20from%20%E2%80%9Ctools%E2%80%9D%20folder%20package%20in%20step%202%20and%20upload%20them.%20After%20the%20upload%20completes%20you%20should%20see%20following%20list%20of%20files%20in%20the%20folder%3A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_18%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2219.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205665i9B28742DFA1C957F%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2219.png%22%20alt%3D%22Figure%2019%3A%20Uploaded%20files%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2019%3A%20Uploaded%20files%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--520857537%22%20id%3D%22toc-hId--520857537%22%20id%3D%22toc-hId--520857537%22%20id%3D%22toc-hId--520857537%22%20id%3D%22toc-hId--520857537%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680677%22%3E%3C%2FA%3E8%20-%20Setup%20Automation%20Account%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3EIn%20the%20Azure%20Portal%2C%20navigate%20to%20the%20Automation%20Accounts%20service%20and%20select%20to%20create%20new.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_19%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2220.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205666i75F917A8F739F2BE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2220.png%22%20alt%3D%22Figure%2020%3A%20Automation%20Accounts%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2020%3A%20Automation%20Accounts%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EProvide%20an%20Automation%20Account%20name%2C%20Azure%20subscription%2C%20and%20Resource%20group.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_20%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%2221.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%2F205667iB10937CE558BCFB4%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2221.png%22%20alt%3D%22Figure%2021%3A%20Add%20Automation%20Account%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2021%3A%20Add%20Automation%20Account%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EOnce%20we%20create%20the%20account%2C%20we%20can%20see%20the%20Automation%20Account%20in%20the%20Azure%20portal.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_21%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2222.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205668i1CAEF9DC7A7D405D%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2222.png%22%20alt%3D%22Figure%2022%3A%20Created%20Automation%20account%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2022%3A%20Created%20Automation%20account%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3EFor%20more%20details%20refer%20-ERR%3AREF-NOT-FOUND-this%20document%20for%20creating%20the%20automation%20account.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22toc-hId-1966655296%22%20id%3D%22toc-hId-1966655296%22%20id%3D%22toc-hId-1966655296%22%20id%3D%22toc-hId-1966655296%22%20id%3D%22toc-hId-1966655296%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680678%22%3E%3C%2FA%3E9%20-%20Setup%20Azure%20Key%20Vault%20and%20store%20secrets%3C%2FH2%3E%0A%3CP%3E-ERR%3AREF-NOT-FOUND-Setup%20Azure%20Key%20Vault%20and%20store%20the%20required%20secrets.%20Key%20vault%20name%20and%20secret%20names%20will%20be%20used%20in%20PowerShell%20runbooks.%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3EStorageAccountforBlobstorageAccessKey%3C%2FLI%3E%0A%3CLI%3EStorageAccountforFileShareAccessKey%3C%2FLI%3E%0A%3CLI%3EClientSecrettoAccessO365%3C%2FLI%3E%0A%3CLI%3EKustoAccessAppKey%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EMake%20sure%20that%20Run-as%20account%20of%20Automation%20account%20has%20access%20to%20the%20Key%20Vault%20(Read%20%E2%80%93%20Get%20Keys%20and%20Secrets).%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20key%20vault%20from%20the%20portal%20and%20select%20access%20policies%20and%20add%20policy.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_22%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2223.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205669i32C778CB318CF888%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2223.png%22%20alt%3D%22Figure%2023%3A%20Key%20Vault%20Access%20Policies%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2023%3A%20Key%20Vault%20Access%20Policies%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3ESelect%20%E2%80%9CGet%E2%80%9D%20and%20%E2%80%9CList%E2%80%9D%20secret%20permissions.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_23%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2224.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205670i962D16057B94E40A%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2224.png%22%20alt%3D%22Figure%2024%3A%20Add%20Access%20policy%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2024%3A%20Add%20Access%20policy%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3EIn%20the%20%E2%80%9CSelect%20principal%E2%80%9D%20field%20enter%20the%20name%20of%20your%20Azure%20Automation%20Account%20Run%20As%20Account.%20You%20can%20find%20it%20by%20navigating%20to%20your%20Automation%20Accounts.%20On%20the%20Automation%20Accounts%20page%2C%20select%20your%20Automation%20account%20from%20the%20list.%20In%20the%20left%20pane%2C%20select%26nbsp%3B%3CSTRONG%3ERun%20As%20Accounts%3C%2FSTRONG%3E%26nbsp%3Bin%20the%20account%20settings%20section.%20Click%20%3CSTRONG%3EAzure%20Run%20As%20Account%3C%2FSTRONG%3E%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_24%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2225.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%2F205671i5C7885B1CB4F074E%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2225.png%22%20alt%3D%22Figure%2025%3A%20Azure%20Run%20As%20Account%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2025%3A%20Azure%20Run%20As%20Account%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-159200833%22%20id%3D%22toc-hId-159200833%22%20id%3D%22toc-hId-159200833%22%20id%3D%22toc-hId-159200833%22%20id%3D%22toc-hId-159200833%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680679%22%3E%3C%2FA%3E10%20-%20Get%20dependent%20modules%20to%20Automation%20accounts%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3EWe%20require%20the%20following%20modules.%20If%20these%20are%20not%20available%2C%20we%20need%20to%20import%20these%20into%20the%20automation%20account.%3CUL%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.accounts%2F%3Fview%3Dazps-3.7.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAz.Accounts%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fstorage%3Fview%3Dazure-cli-latest%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAz.Storage%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.automation%2F%3Fview%3Dazps-3.7.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAz.Automation%3C%2FA%3E%3C%2FLI%3E%0A%3CLI%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fpowershell%2Fmodule%2Faz.keyvault%2F%3Fview%3Dazps-3.7.0%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAz.KeyVault%3C%2FA%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3EFor%20importing%20a%20new%20module%2C%20navigate%20to%20automation%20account%20and%20select%20%E2%80%9CModules%E2%80%9D%20from%20the%20menu.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_25%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2226.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205672iEFEBCEB29388EB62%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2226.png%22%20alt%3D%22Figure%2026%3A%20Modules%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2026%3A%20Modules%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%223%22%3E%0A%3CLI%3ESelect%20%E2%80%9CBrowse%20gallery%E2%80%9D%20and%20search%20for%20the%20required%20modules.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_26%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2227.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205673i37ACBB14A32F90AF%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2227.png%22%20alt%3D%22Figure%2027%3A%20Browse%20Gallery%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2027%3A%20Browse%20Gallery%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%224%22%3E%0A%3CLI%3EClick%20on%20Import%20and%20select%20OK%20to%20import%20to%20the%20automation%20account.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_27%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2228.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205674i87F61E3B889EF03E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2228.png%22%20alt%3D%22Figure%2028%3A%20Import%20module%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2028%3A%20Import%20module%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3COL%20start%3D%225%22%3E%0A%3CLI%3ERepeat%20the%20same%20steps%20for%20all%20required%20modules.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CH2%20id%3D%22toc-hId--1648253630%22%20id%3D%22toc-hId--1648253630%22%20id%3D%22toc-hId--1648253630%22%20id%3D%22toc-hId--1648253630%22%20id%3D%22toc-hId--1648253630%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680680%22%3E%3C%2FA%3E11%20-%20Adding%20Runbooks%20in%20automation%20account%20(PowerShell%20Runbooks)%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20have%20broken%20down%20our%20PowerShell%20scripts%20into%203%20different%20runbooks%20to%20achieve%20the%20following.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ESegregation%20of%20duties%3C%2FLI%3E%0A%3CLI%3EParallelism%3C%2FLI%3E%0A%3CLI%3EAdd%20plug-and-play%20capability%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3EDeploy%203%20runbooks%20into%20the%20automation%20account%20by%20following%20the%20steps%20below.%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20the%20Automation%20account%20we%20have%20created%20above%20and%20select%20%E2%80%9CRunbooks%E2%80%9D.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_28%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2229.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205675iF36886653E351B16%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2229.png%22%20alt%3D%22Figure%2029%3A%20Runbooks%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2029%3A%20Runbooks%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EClick%20on%20%E2%80%9CImport%20Runbook%E2%80%9D%2C%20choose%20the%20file%20from%20local%20system%2C%20and%20provide%20runbook%20type%20as%20%E2%80%9CPowerShell%E2%80%9D%3C%2FLI%3E%0A%3CLI%3EWe%20have%20the%20following%203%20PowerShell%20scripts%2C%20which%20need%20to%20be%20imported.%20Make%20sure%20to%20provide%20the%20names%20of%20the%20runbooks%20as%20we%20have%20specified%20in%20below%20table%2C%20otherwise%20scripts%20execution%20may%20fail.%3C%2FLI%3E%0A%3CLI%3EDownload%20the%20zip%20file%20from%20-ERR%3AREF-NOT-FOUND-here.%20Once%20you%20unzip%2C%20you%20can%20find%20the%20following%203%20files.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CEM%3E%3CFONT%20size%3D%222%22%3ETable%201%3A%20Runbook%20scripts%3C%2FFONT%3E%3C%2FEM%3E%3C%2FP%3E%0A%3CTABLE%20style%3D%22border-style%3A%20solid%3B%20width%3A%20623px%3B%22%20border%3D%222%22%20width%3D%22623%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22239%22%3E%3CP%3E%3CSTRONG%3EName%20of%20the%20runbook%20(Provide%20the%20same%20as%20below%20while%20importing)%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22121%22%3E%3CP%3E%3CSTRONG%3EType%20of%20Runbook%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22263%22%3E%3CP%3E%3CSTRONG%3EPowerShell%20Script%20to%20import%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22239%22%3E%3CP%3EGetO365DataBlobURLs%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22121%22%3E%3CP%3EPowerShell%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22263%22%3E%3CP%3EGetO365DataBlobURLs.ps1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22239%22%3E%3CP%3EGetO365GeneralAuditData%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22121%22%3E%3CP%3EPowerShell%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22263%22%3E%3CP%3EGetO365GeneralAuditData.ps1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%22239%22%3E%3CP%3EExporttoKusto_O365AuditGeneralData%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22121%22%3E%3CP%3EPowerShell%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%22263%22%3E%3CP%3EExporttoKusto_O365AuditGeneralData.ps1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-839259203%22%20id%3D%22toc-hId-839259203%22%20id%3D%22toc-hId-839259203%22%20id%3D%22toc-hId-839259203%22%20id%3D%22toc-hId-839259203%22%3E%3CA%20target%3D%22_blank%22%20name%3D%22_Toc41680681%22%3E%3C%2FA%3E12%20-%20Adding%20variables%20in%20the%20automation%20account%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3ENavigate%20to%20the%20automation%20account%20and%20select%20variables%20from%20the%20menu.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_29%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2230.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205676iE3D1A446AAB97CF5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2230.png%22%20alt%3D%22Figure%2030%3A%20Variables%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2030%3A%20Variables%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%20start%3D%222%22%3E%0A%3CLI%3EThe%20following%20table%20lists%20the%20variables%20to%20be%20added.%20Add%20variables%20by%20selecting%20%E2%80%9CAdd%20a%20Variable%E2%80%9D.%26nbsp%3BMake%20sure%20to%20select%20%E2%80%9Cencryption%2Fhiding%E2%80%9D%20in%20case%20of%20secrets.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CFONT%20size%3D%222%22%3E%3CEM%3ETable%202%3A%20Variables%3C%2FEM%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CTABLE%20style%3D%22border-style%3A%20solid%3B%20width%3A%2099.86187845303868%25%3B%22%20border%3D%222%22%20width%3D%2299.86187845303868%25%22%3E%0A%3CTBODY%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3E%3CSTRONG%3EVariable%20Name%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3E%3CSTRONG%3EData%20Type%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3E%3CSTRONG%3EValue%20description%3C%2FSTRONG%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EAutomationAccountName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20the%20Automation%20Account%20created%20in%20chapter%208%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EAutomationAccountResourceGroupName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20Resource%20Group%20which%20Automation%20Account%20was%20created%20in.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EBlobStorageContainerName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20Container%20created%20in%20chapter%204%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EClientIDtoAccessO365%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EAzure%20AD%20application%20ID%20created%20in%20chapter%203.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EClientSecrettoAccessO365%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%20(encrypted%20or%20from%20KeyVault)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EAzure%20AD%20application%20secret%20created%20in%20chapter%203.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EFileShareNameinStorageAccount%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20the%20file%20share%20created%20in%20chapter%205%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EKeyVaultName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20the%20Azure%20Key%20Vault%20created%20in%20chapter%209%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EKustoAccessAppId%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EAzure%20Run%20As%20Account%20application%20ID.%20Steps%20to%20find%20it%20are%20described%20in%20chapter%2012.1%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EKustoAccessAppKey%20(optional)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%20(encrypted%20or%20from%20KeyVault)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3ENot%20required%20if%20access%20key%20is%20stored%20in%20Azure%20Key%20Vault%20in%20KustoAccessAppKey%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EKustoClusterName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EAzure%20Data%20Explorer%20cluster%20name%20created%20in%20chapter%206%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EKustoDatabaseName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EAzure%20Data%20Explorer%20database%20name%20created%20in%20chapter%206%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EKustoIngestionURI%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EKustoTableName%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20the%20Azure%20Data%20Explorer%20table%20that%20PowerShell%20script%20will%20create.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EMicrosoftLoginURL%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Flogin.microsoftonline.com%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Flogin.microsoftonline.com%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EO365ResourceUrl%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fmanage.office.com%2F.default%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fmanage.office.com%2F.default%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EO365TenantDomain%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EDefault%20domain%20name%20of%20the%20tenant%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EO365TenantGUID%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EThis%20is%20the%20ID%20of%20the%20Office%20365%20tenant%20where%20alerts%20and%20investigation%20will%20be%20pulled%20out%20from.%20Follow%20this%20article%20to%20locate%20tenant%20ID.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fonedrive%2Ffind-your-office-365-tenant-id%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fonedrive%2Ffind-your-office-365-tenant-id%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EPathforKustoExportDlls%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20the%20folder%20created%20in%20the%20file%20share%20in%20chapter%205.%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3ERunbookNameforExportDatatoKusto%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EExporttoKusto_O365AuditGeneralData%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3ERunbookNameforGetAuditDataBlobURIs%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EGetO365DataBlobURLs%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3ERunbookNameforGetAuditDataFromURIs%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EGetO365GeneralAuditData%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EStorageAccountforBlobstorage%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EName%20of%20the%20storage%20account%20created%20in%20chapter%204%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EStorageAccountforBlobstorageAccessKey%3C%2FP%3E%0A%3CP%3E(optional)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%20(encrypted%20or%20from%20KeyVault)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3ENot%20required%20if%20access%20key%20is%20stored%20in%20Azure%20Key%20Vault%20in%20StorageAccountforBlobstorageAccessKey%20(default%20configuration)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EStorageAccountforFileShare%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EStorage%20account%20created%20in%20chapter%204%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3EStorageAccountforFileShareAccessKey%3C%2FP%3E%0A%3CP%3E(optional)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%20(encrypted%20or%20from%20KeyVault)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3ENot%20required%20if%20access%20key%20is%20stored%20in%20Azure%20Key%20Vault%20in%20StorageAccountforFileShareAccessKey%20(default%20configuration)%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3CTR%3E%0A%3CTD%20width%3D%2241.988950276243095%25%22%3E%3CP%3ETenantIdforKustoAccessApp%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2216.16022099447514%25%22%3E%3CP%3EString%3C%2FP%3E%0A%3C%2FTD%3E%0A%3CTD%20width%3D%2241.71270718232044%25%22%3E%3CP%3EThis%20is%20the%20ID%20of%20the%20Azure%20AD%20tenant%20where%20Azure%20Run%20As%20Account%20is%20provisioned.%20Follow%20this%20article%20to%20locate%20tenant%20ID.%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fonedrive%2Ffind-your-office-365-tenant-id%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fonedrive%2Ffind-your-office-365-tenant-id%3C%2FA%3E%3C%2FP%3E%0A%3C%2FTD%3E%0A%3C%2FTR%3E%0A%3C%2FTBODY%3E%0A%3C%2FTABLE%3E%0A%3CH3%20id%3D%22toc-hId--839112541%22%20id%3D%22toc-hId--839112541%22%20id%3D%22toc-hId--839112541%22%20id%3D%22toc-hId--839112541%22%20id%3D%22toc-hId--839112541%22%3E%3CSPAN%3E12.1%20-%20Finding%20the%20Azure%20Run%20As%20Account%20application%20ID.%3C%2FSPAN%3E%3C%2FH3%3E%0A%3CP%3EYou%20can%20find%20the%20%3CSTRONG%3EKustoAccessAppId%3C%2FSTRONG%3E%20by%20navigating%20to%20your%20Automation%20Accounts.%20On%20the%20Automation%20Accounts%20page%2C%20select%20your%20Automation%20account%20from%20the%20list.%20In%20the%20left%20pane%2C%20select%26nbsp%3B%3CSTRONG%3E%3CSTRONG%3ERun%20As%20Accounts%3C%2FSTRONG%3E%3C%2FSTRONG%3E%26nbsp%3Bin%20the%20account%20settings%20section.%20Click%20%3CSTRONG%3E%3CSTRONG%3EAzure%20Run%20As%20Account.%20%3C%2FSTRONG%3ECopy%20Application%20ID%20and%20paste%20it%20as%20%3CSTRONG%3EKustoAccessAppId%3C%2FSTRONG%3E%20variable%20value.%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_30%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2231.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%2F205677i21C9CFEFD0993B3C%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20title%3D%2231.png%22%20alt%3D%22Figure%2031%3A%20Copy%20the%20Application%20ID%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2031%3A%20Copy%20the%20Application%20ID%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1519317573%22%20id%3D%22toc-hId-1519317573%22%20id%3D%22toc-hId-1519317573%22%20id%3D%22toc-hId-1519317573%22%20id%3D%22toc-hId-1519317573%22%3E13%20-%20Querying%20the%20data%3C%2FH2%3E%0A%3CP%3EAfter%20data%20is%20successfully%20imported%20by%20the%20scripts%20you%20can%20query%20it%20using%20-ERR%3AREF-NOT-FOUND-KQL.%3C%2FP%3E%0A%3CP%3EIn%20the%20Azure%20Portal%20navigate%20to%20Azure%20Data%20Explorer%20Clusters.%20Click%20on%20the%20cluster%20name.%20Click%20on%20Query.%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_31%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2232.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205678i86894C10AB9944B1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2232.png%22%20alt%3D%22Figure%2032%3A%20Query%20the%20data%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2032%3A%20Query%20the%20data%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EExample%20query%20to%20verify%20that%20data%20is%20ingested%3A%3C%2FP%3E%0A%3CPRE%3EKustoAuditTable%3CBR%20%2F%3E%7C%20extend%20IngestionTime%3Dingestion_time()%3CBR%20%2F%3E%7C%20order%20by%20IngestionTime%20desc%3CBR%20%2F%3E%7C%20project%20Name%2CSeverity%2CInvestigationType%2CInvestigationName%2CInvestigationId%2CCreationTime%2CStartTimeUtc%2CLastUpdateTimeUtc%2CEndTimeUtc%2COperation%2CResultStatus%2CUserKey%2CObjectId%2CData%2CActions%2CSource%2CComments%2CStatus%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAnd%20finally%2C%20after%20all%20this%20effort%20an%20example%20of%20the%20output%3A%3C%2FP%3E%0A%3CDIV%20id%3D%22tinyMceEditorGiulian%20Garruba_32%22%20class%3D%22mceNonEditable%20lia-copypaste-placeholder%22%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%2233.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F205679iDB8204B40EA98E65%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%2233.png%22%20alt%3D%22Figure%2033%3A%20Data%20Output%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%2033%3A%20Data%20Output%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%26nbsp%3B%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--288136890%22%20id%3D%22toc-hId--288136890%22%20id%3D%22toc-hId--288136890%22%20id%3D%22toc-hId--288136890%22%20id%3D%22toc-hId--288136890%22%3E14%20-%20Final%20Remarks%3C%2FH2%3E%0A%3COL%3E%0A%3CLI%3EUse%20the%20following%20-ERR%3AREF-NOT-FOUND-article%20to%20create%20a%20schedule%20to%20run%20scripts%20periodically%20(for%20example%20every%20hour).%20It%20is%20enough%20to%20create%20a%20schedule%20for%20the%20GetO365DataBlobURLs%20runbook.%3C%2FLI%3E%0A%3CLI%3EDuring%20the%20first%20execution%20of%20the%20PowerShell%20scripts%2C%20a%20Kusto%20table%20will%20be%20created%20with%20its%20entire%20schema.%20Afterwards%20permissions%20of%20the%20Azure%20Run%20As%20Account%20can%20be%20lowered%20from%20%E2%80%9CAdmins%E2%80%9D%20to%20%E2%80%9CIngestor%E2%80%9D.%3C%2FLI%3E%0A%3CLI%3EData%20ingestion%20is%20delayed%20by%20approximately%205%20minutes.%20Even%20after%20the%20script%20successfully%20completes%2C%20data%20may%20not%20show%20up%20immediately%20in%20the%20Azure%20Data%20Explorer%20cluster.%20This%20is%20caused%20by%20the%20IngestFromStreamAsync%20method%20used%20to%20ingest%20data%20to%20the%20Azure%20Data%20Explorer%20cluster.%3C%2FLI%3E%0A%3CLI%3EAfter%20Alerts%20and%20Investigations%20data%20is%20ingested%20into%20the%20Azure%20Data%20Explorer%20cluster%20you%20will%20notice%20some%20empty%20columns%20in%20the%20table.%20This%20is%20deliberate%20to%20accommodate%20for%20data%20coming%20from%20other%20workloads%20if%20you%20wish%20to%20ingest%20them%20as%20well.%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1525185%22%20slang%3D%22en-US%22%3E%3CP%3ELeverage%20Office%20365%20ATP%20and%20the%20O365%20Management%20API%20to%20improve%20the%20effectiveness%20of%20your%20Security%20Operations%20Center.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1533819%22%20slang%3D%22en-US%22%3ERe%3A%20Improve%20the%20Effectiveness%20of%20your%20SOC%20with%20Office%20365%20ATP%20and%20the%20O365%20Management%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1533819%22%20slang%3D%22en-US%22%3E%3CP%3EThank%20you.%20was%20helpful%20to%20some%20level%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1619078%22%20slang%3D%22en-US%22%3ERe%3A%20Improve%20the%20Effectiveness%20of%20your%20SOC%20with%20Office%20365%20ATP%20and%20the%20O365%20Management%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1619078%22%20slang%3D%22en-US%22%3E%3CP%3EThis%20is%20awesome%2C%20thank%20you!%20Just%20one%20question%3A%20wouldn't%20it%20be%20easier%20and%20cheaper%20to%20use%20Log%20Analytics%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1640103%22%20slang%3D%22en-US%22%3ERe%3A%20Improve%20the%20Effectiveness%20of%20your%20SOC%20with%20Office%20365%20ATP%20and%20the%20O365%20Management%20API%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1640103%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F774755%22%20target%3D%22_blank%22%3E%40NunoMota%3C%2FA%3E%26nbsp%3B-%20Yes%2C%20it%20is.%20Cost%20wise%20log%20analytics%20is%20better%20option.%20We%20have%20considered%20ADX%20for%20implementation%20at%20MSFT%20based%20on%20our%20current%20orchestration%20and%20case%20management%20tools%20integration%20options.%20Consider%20this%20as%20just%20an%20example%20integration.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

This post was authored by @Pawel Partyka from the Office 365 ATP Customer Experience Engineering team, along with the Microsoft Digital Security and Risk Engineering (DSRE) team. 

Special thanks to @Satyajit Dash, Anki Narravula, and Sidhartha Bose for their contributions.

 

1 - Introduction

Office 365 Advanced Threat Protection provides several built-in security alerts to help customers detect and mitigate potential threats. In many large enterprises there is often a need to integrate these alerts with a SIEM platform or other case management tools to enable a Security Operations Center (SOC) team to monitor the alerts. The Office 365 Management Activity API provides these SOC teams the ability to integrate O365 ATP alerts with other platforms.

 

One of the challenges that organizations often face, particularly large enterprises, is the ever-increasing volume of alerts that the SOC needs to monitor. This at times makes it important to integrate and onboard only specific alerts to the monitoring and case management platforms or SIEM.

Let’s take an integration scenario that we worked on recently. As part of effort to deal with phishing related threats, one of our large enterprise customers wanted to fetch and integrate “user-reported phishing alerts”. However, they only wanted to their SOC to get those alerts that have already been processed by an Automated Investigation and Response (AIR) playbook  to reduce false positives and focus on real threats.

 

Our engineering team worked on a solution which efficiently fetches only the relevant alerts using the Office 365 Management API and integrates them with the SIEM and case management platform. Below is the solution and the reference architecture. This could potentially be used to fetch and integrate other relevant alerts from Office 365 ATP.

 

2 - Azure Components

As mentioned in the introduction, we have used the Azure cloud to set up end-to-end infrastructure for getting O365 audit events and storing the required filtered data for near real-time security monitoring and historical analysis. After evaluating and analyzing various combinations of Azure services, we have decided to use following Azure components.

  • Azure Data Explorer (Kusto) for final storage, which gives us real-time querying capabilities for data analysis.
  • Azure blob containers - As a staging area and for data archival.
  • Azure automation account – For deploying and automating the PowerShell scripts we used to fetch audit data using the Office 365 Management API.
  • Azure Logic app – For scheduling and calling the PowerShell runbooks.
  • Azure Key Vault – For storing the secrets required for accessing the Management API.

The architecture diagram below depicts the end-to-end setup.

 
 

Figure 1: Architecture diagramFigure 1: Architecture diagram

 

3 - Setting up the Azure Active Directory application

To access audit data from the O365 Management API, we’ll configure access though an Azure Active Directory (AAD) application. Create an AAD application using the steps below, and get access to this AAD application from the tenant admin. Once you have access, keep a note of the Client Id and secret key of this application, because we will need these details later.

 

3.1 - Azure AD app registration

  1. Navigate to the Azure AD admin portal.
  2. Click “New registration”.
  3. Enter a name for your app (for example "Management Activity API"). Leave the “Accounts in this organizational directory only” option selected.
  4. Select “Web” and click "Register".
 

Figure 2: Registering an Azure AD applicationFigure 2: Registering an Azure AD application

 

  1. Click “API permissions” from left navigation menu.
  2. Click “Add a permission” and then "Office 365 Management APIs". 
 

 

Figure 3: Requesting API permissionsFigure 3: Requesting API permissions

  1. Click "Application permissions". Expand “ActivityFeed” and select “ActivityFeed.Read”, expand “ServiceHealth” and select “ServiceHealth.Read”.
 

 

Figure 4: Configuration of API permissionsFigure 4: Configuration of API permissions

 

  1. Click Add permissions.
  2. Refresh the list of permissions. Click “Grant admin consent for <your organization’s name>”. Click Yes.
  3. On the App screen click “Overview” and copy “Application (client) ID” to the clipboard. You will need this later when configuring the ClientIDtoAccessO365 Automation Account variable value.
  4. Click “Certificates & secrets”. Click “New client secret”. Assign a name to the secret. Click Add.
 

 

Figure 5: Certificates & secretsFigure 5: Certificates & secrets

  1. After the secret is generated, copy the secret to the clipboard by clicking on the “copy” icon next to the secret value. You will need this later when configuring the ClientSecrettoAccessO365 Automation Account variable value.
 

 

Figure 6: Client secretsFigure 6: Client secrets

 

4 - Setup storage account

We need to set up a storage account for data storage, which we will use  as a staging area. We can retain data here for longer term, to be used for historical data analysis. Below is the step-by-step process for setting up the storage account.

  • Note: Use the same “Resource Group Name” for all the resources we are setting up, so that we can track all the resources easily.
  • Make a note of the name of the blob storage account and name of the container, because we will need to assign this  to a variable in the automation account.

Once we create the container, we can see the container like below when we navigate to “Container” section inside the storage account.

Steps to create Storage Account

  1. Navigate to “Storage account” service in the Azure portal and select “Add new” to create a new storage account.
 

 

Figure 7: Storage accountsFigure 7: Storage accounts

 

 

Figure 8: Create storage accountFigure 8: Create storage account

  1. Once we have a storage account created, click on “Containers” to create one container.
 

 

Figure 9: Create a containerFigure 9: Create a container

 

  1. Click “Container” to add a new container.
  2. Provide name for the container. Make sure that “Private” access is selected.
  3. For more details, refer to these steps to create a blob storage account.

5 - Create a file share in the storage account

We will use Azure File share to store the .dlls needed by Azure Data Explorer for the ingestion process. Follow the step-by-step process as described to create an Azure file share in the storage account. We can create this file share under the same storage account, which we have created in previous step.

  1. Navigate to the storage account we have created above and select “File share”.
 

 

Figure 10: File sharesFigure 10: File shares

 

  1. Click “File share” to create new file share. Provide a name for the file share and allocate a 1GB quota.
 

 

Figure 11: Creating a file shareFigure 11: Creating a file share

 

  1. Keep a note on the storage account and file share name, we will require them in the Automation Account.

6 - Setting up Azure Data Explorer (Kusto) Data store

Create an Azure Data Explorer cluster and database by following this step-by-step guide or the steps given below. Once the cluster is created, copy the details of cluster and database which we’ll need when inputting the Azure Automation Account variables.

For writing data into Azure Data Explorer we will use “Service Principal / AAD application” access (using the service principal secret). We will need “Admin” permissions during the first run of the script to create a table in the Kusto database. After the table is successfully created, permissions can be reduced to “Ingestor” permissions.

  1. Login to the Azure portal. Search for the service “Azure Data Explorer”. Click “Add” to create a new cluster.
 

 

Figure 12: Azure Data Explorer ClustersFigure 12: Azure Data Explorer Clusters

 

  1. Provide the required details and create the cluster.
 

 

Figure 13: Create an Azure Data Explorer ClusterFigure 13: Create an Azure Data Explorer Cluster

 

  1. Once we have the Azure Data Explorer Cluster created, we need to create a database under this cluster. Navigate to the cluster we have created and click “Add database”.
 

 

Figure 14: Create new databaseFigure 14: Create new database

 

6.1 - Add Azure Active Directory app / Service principal for write access in Azure Data Explorer.

  1. Navigate to Azure Data Explorer Clusters.
  2. Open the cluster that you have created in previous step.
  3. Open the database created under Kusto cluster. Click “Permissions”.
 

 

Figure 15: Database PermissionsFigure 15: Database Permissions

 

  1. Click Add. Make sure the “Admin” role is selected. Click “Select principals”. In the New Principals fly-out, paste the Application ID of the Run As Automation account. Select the Application ID entity. Click “Select” and click “Save”.

 

 

 

Figure 16: Add PermissionsFigure 16: Add Permissions

  1. To find the Azure Run As Account Application ID follow these steps: On the Automation Accounts page, select your Automation account from the list. In the left pane, select Run As Accounts in the account settings section. Click Azure Run As Account. Copy the Application ID.
 

 

Figure 17: AzureRunAs accountFigure 17: AzureRunAs account

7 - Upload Kusto library to file share

We need to upload Kusto libraries to the Azure Storage Account File Share.

  1. Download Microsoft.Azure.Kusto.Tools Nuget package Here.  https://www.nuget.org/packages/Microsoft.Azure.Kusto.Tools/
  2. The downloaded NuPKG file is just an archive file. Extract the files from “tools” folder NuGet package, to any folder on your computer.
  3. In the web browser navigate to the “File share” created in chapter 5. Open the file share.
 

 

Figure 18: File SharesFigure 18: File Shares

  1. Click “Add directory”. Enter a name for the directory: “Microsoft.Azure.Kusto.Tools”
  2. Enter the newly created folder and click “Upload”. Select all the files extracted from “tools” folder package in step 2 and upload them. After the upload completes you should see following list of files in the folder:
 

 

Figure 19: Uploaded filesFigure 19: Uploaded files

8 - Setup Automation Account

  1. In the Azure Portal, navigate to the Automation Accounts service and select to create new.
 

 

Figure 20: Automation AccountsFigure 20: Automation Accounts

  1. Provide an Automation Account name, Azure subscription, and Resource group.
 

 

Figure 21: Add Automation AccountFigure 21: Add Automation Account

  1. Once we create the account, we can see the Automation Account in the Azure portal.
 

 

Figure 22: Created Automation accountFigure 22: Created Automation account

 

  1. For more details refer this document for creating the automation account.

9 - Setup Azure Key Vault and store secrets

Setup Azure Key Vault and store the required secrets. Key vault name and secret names will be used in PowerShell runbooks.

  • StorageAccountforBlobstorageAccessKey
  • StorageAccountforFileShareAccessKey
  • ClientSecrettoAccessO365
  • KustoAccessAppKey

 

Make sure that Run-as account of Automation account has access to the Key Vault (Read – Get Keys and Secrets).

  1. Navigate to key vault from the portal and select access policies and add policy.
 

 

Figure 23: Key Vault Access PoliciesFigure 23: Key Vault Access Policies

  1. Select “Get” and “List” secret permissions.
 

 

Figure 24: Add Access policyFigure 24: Add Access policy

  1. In the “Select principal” field enter the name of your Azure Automation Account Run As Account. You can find it by navigating to your Automation Accounts. On the Automation Accounts page, select your Automation account from the list. In the left pane, select Run As Accounts in the account settings section. Click Azure Run As Account
 

 

Figure 25: Azure Run As AccountFigure 25: Azure Run As Account

10 - Get dependent modules to Automation accounts

 

  1. We require the following modules. If these are not available, we need to import these into the automation account.
  2. For importing a new module, navigate to automation account and select “Modules” from the menu.
 

 

Figure 26: ModulesFigure 26: Modules

 

  1. Select “Browse gallery” and search for the required modules.

 

 

 

Figure 27: Browse GalleryFigure 27: Browse Gallery

 

  1. Click on Import and select OK to import to the automation account.
 

 

Figure 28: Import moduleFigure 28: Import module

  1. Repeat the same steps for all required modules.

11 - Adding Runbooks in automation account (PowerShell Runbooks)

               

We have broken down our PowerShell scripts into 3 different runbooks to achieve the following.

  1. Segregation of duties
  2. Parallelism
  3. Add plug-and-play capability

Deploy 3 runbooks into the automation account by following the steps below.

  1. Navigate to the Automation account we have created above and select “Runbooks”.
 

 

Figure 29: RunbooksFigure 29: Runbooks

 

  1. Click on “Import Runbook”, choose the file from local system, and provide runbook type as “PowerShell”
  2. We have the following 3 PowerShell scripts, which need to be imported. Make sure to provide the names of the runbooks as we have specified in below table, otherwise scripts execution may fail.
  3. Download the zip file from here. Once you unzip, you can find the following 3 files.

Table 1: Runbook scripts

Name of the runbook (Provide the same as below while importing)

Type of Runbook

PowerShell Script to import

GetO365DataBlobURLs

PowerShell

GetO365DataBlobURLs.ps1

GetO365GeneralAuditData

PowerShell

GetO365GeneralAuditData.ps1

ExporttoKusto_O365AuditGeneralData

PowerShell

ExporttoKusto_O365AuditGeneralData.ps1

 

12 - Adding variables in the automation account

 

  1. Navigate to the automation account and select variables from the menu.
 

 

Figure 30: VariablesFigure 30: Variables

 

  1. The following table lists the variables to be added. Add variables by selecting “Add a Variable”. Make sure to select “encryption/hiding” in case of secrets.

Table 2: Variables

Variable Name

Data Type

Value description

AutomationAccountName

String

Name of the Automation Account created in chapter 8

AutomationAccountResourceGroupName

String

Name of Resource Group which Automation Account was created in.

BlobStorageContainerName

String

Name of Container created in chapter 4

ClientIDtoAccessO365

String

Azure AD application ID created in chapter 3.1

ClientSecrettoAccessO365

String (encrypted or from KeyVault)

Azure AD application secret created in chapter 3.1

FileShareNameinStorageAccount

String

Name of the file share created in chapter 5

KeyVaultName

String

Name of the Azure Key Vault created in chapter 9

KustoAccessAppId

String

Azure Run As Account application ID. Steps to find it are described in chapter 12.1

KustoAccessAppKey (optional)

String (encrypted or from KeyVault)

Not required if access key is stored in Azure Key Vault in KustoAccessAppKey

KustoClusterName

String

Azure Data Explorer cluster name created in chapter 6

KustoDatabaseName

String

Azure Data Explorer database name created in chapter 6

KustoIngestionURI

String

 

KustoTableName

String

Name of the Azure Data Explorer table that PowerShell script will create.

MicrosoftLoginURL

String

https://login.microsoftonline.com

O365ResourceUrl

String

https://manage.office.com/.default

O365TenantDomain

String

Default domain name of the tenant

O365TenantGUID

String

This is the ID of the Office 365 tenant where alerts and investigation will be pulled out from. Follow this article to locate tenant ID. https://docs.microsoft.com/en-us/onedrive/find-your-office-365-tenant-id

PathforKustoExportDlls

String

Name of the folder created in the file share in chapter 5.

RunbookNameforExportDatatoKusto

String

ExporttoKusto_O365AuditGeneralData

RunbookNameforGetAuditDataBlobURIs

String

GetO365DataBlobURLs

RunbookNameforGetAuditDataFromURIs

String

GetO365GeneralAuditData

StorageAccountforBlobstorage

String

Name of the storage account created in chapter 4

StorageAccountforBlobstorageAccessKey

(optional)

String (encrypted or from KeyVault)

Not required if access key is stored in Azure Key Vault in StorageAccountforBlobstorageAccessKey (default configuration)

StorageAccountforFileShare

String

Storage account created in chapter 4

StorageAccountforFileShareAccessKey

(optional)

String (encrypted or from KeyVault)

Not required if access key is stored in Azure Key Vault in StorageAccountforFileShareAccessKey (default configuration)

TenantIdforKustoAccessApp

String

This is the ID of the Azure AD tenant where Azure Run As Account is provisioned. Follow this article to locate tenant ID. https://docs.microsoft.com/en-us/onedrive/find-your-office-365-tenant-id

12.1 - Finding the Azure Run As Account application ID.

You can find the KustoAccessAppId by navigating to your Automation Accounts. On the Automation Accounts page, select your Automation account from the list. In the left pane, select Run As Accounts in the account settings section. Click Azure Run As Account. Copy Application ID and paste it as KustoAccessAppId variable value.

 

 

Figure 31: Copy the Application IDFigure 31: Copy the Application ID

13 - Querying the data

After data is successfully imported by the scripts you can query it using KQL.

In the Azure Portal navigate to Azure Data Explorer Clusters. Click on the cluster name. Click on Query.

 

 

Figure 32: Query the dataFigure 32: Query the data

Example query to verify that data is ingested:

KustoAuditTable
| extend IngestionTime=ingestion_time()
| order by IngestionTime desc
| project Name,Severity,InvestigationType,InvestigationName,InvestigationId,CreationTime,StartTimeUtc,LastUpdateTimeUtc,EndTimeUtc,Operation,ResultStatus,UserKey,ObjectId,Data,Actions,Source,Comments,Status

 

And finally, after all this effort an example of the output:

 

 

Figure 33: Data OutputFigure 33: Data Output

 

 

14 - Final Remarks

  1. Use the following article to create a schedule to run scripts periodically (for example every hour). It is enough to create a schedule for the GetO365DataBlobURLs runbook.
  2. During the first execution of the PowerShell scripts, a Kusto table will be created with its entire schema. Afterwards permissions of the Azure Run As Account can be lowered from “Admins” to “Ingestor”.
  3. Data ingestion is delayed by approximately 5 minutes. Even after the script successfully completes, data may not show up immediately in the Azure Data Explorer cluster. This is caused by the IngestFromStreamAsync method used to ingest data to the Azure Data Explorer cluster.
  4. After Alerts and Investigations data is ingested into the Azure Data Explorer cluster you will notice some empty columns in the table. This is deliberate to accommodate for data coming from other workloads if you wish to ingest them as well.

 

 

 

3 Comments
Occasional Visitor

Thank you. was helpful to some level

Senior Member

This is awesome, thank you! Just one question: wouldn't it be easier and cheaper to use Log Analytics?

Microsoft

Hi @NunoMota - Yes, it is. Cost wise log analytics is better option. We have considered ADX for implementation at MSFT based on our current orchestration and case management tools integration options. Consider this as just an example integration.