%3CLINGO-SUB%20id%3D%22lingo-sub-1339298%22%20slang%3D%22en-US%22%3EAugmenting%20Azure%20Advisor%20Cost%20Recommendations%20for%20Automated%20Continuous%20Optimization%20%E2%80%93%20Part%201%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1339298%22%20slang%3D%22en-US%22%3E%3CP%3E%3CEM%3EHere%20is%20Helder%20Pinto%20PFE%20presenting%20the%20first%20post%20of%20a%20series%20dedicated%20to%20the%20implementation%20of%20automated%20Continuous%20Optimization%20with%20Azure%20Advisor%20Cost%20recommendations.%3C%2FEM%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1356166514%22%20id%3D%22toc-hId--1356166514%22%3E%3CSPAN%3EIntroduction%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20can%20define%20Continuous%20Optimization%20(CO)%20in%20the%20context%20of%20Microsoft%20Azure%20and%20IT%20environments%20in%20general%20as%20an%20iterative%20process%20aiming%20at%20constantly%20assessing%20optimization%20opportunities%20in%20our%20infrastructure%20and%20implement%20required%20changes.%20This%20is%20done%20routinely%20in%20many%20organizations%20%E2%80%93%20finding%20and%20implementing%20performance%2C%20security%2C%20or%20cost%20optimization%20opportunities%20can%20be%20a%20full-time%20job%20in%20some%20large%20enterprise%20scenarios.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAzure%20Advisor%20is%20a%20great%2C%20free%20governance%20tool%20that%20every%20Azure%20customer%20should%20look%20at%20often%20and%20use%20as%20a%20source%20of%20CO.%20In%20Azure%20Advisor%2C%20you%20can%20find%20recommendations%20for%20several%20categories%3A%20Performance%2C%20High%20Availability%2C%20Security%20(sourced%20from%20Azure%20Security%20Center)%2C%20Operational%20Excellence%2C%20and%20Cost%20(coming%20from%20Azure%20Cost%20Management).%20Each%20recommendation%20comes%20with%20a%20justification%2C%20impact%20level%20and%20details%20on%20how%20to%20optimize%20the%20impacted%20resources.%20See%20more%20details%20%5B%23%24dp5%5D%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fadvisor%2Fadvisor-overview%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehere%3C%2FA%3E.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22augmenting-azure-advisor-co-pt1-figure1.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%2F186724iB035967EA98AE4DE%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22augmenting-azure-advisor-co-pt1-figure1.jpg%22%20alt%3D%22augmenting-azure-advisor-co-pt1-figure1.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1131346319%22%20id%3D%22toc-hId-1131346319%22%3E%3CSPAN%3EThe%20problem%26nbsp%3B%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EAll%20Advisor%20recommendations%20are%20actionable%20and%2C%20in%20many%20cases%2C%20automatable%20%E2%80%93%20ultimately%2C%20CO%20should%20be%20as%20automatic%20as%20CI%2FCD.%20For%20example%2C%20when%20Advisor%20finds%20Virtual%20Machines%20missing%20endpoint%20protection%2C%20we%20can%20automate%20the%20deployment%20of%20the%20corresponding%20VM%20extension.%20%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWhen%20it%20comes%20to%20Cost%20recommendations%2C%20there%20are%20also%20some%20scenarios%20where%20optimization%20automation%20is%20easy%20to%20implement%3A%20deleting%20orphaned%20Public%20IPs%20or%20moving%20snapshots%20to%20Standard%20Storage%20are%20some%20examples.%20However%2C%20%3CSTRONG%3Ewhen%20customers%20look%20at%20Virtual%20Machine%20right-size%20recommendations%20%E2%80%93%20one%20of%20the%20recommendations%20with%20higher%20cost%20optimization%20impact%20%E2%80%93%2C%20very%20few%20feel%20comfortable%20enough%20to%20act%20accordingly%2C%20even%20more%20if%20asked%20to%20automate%20the%20action%3C%2FSTRONG%3E%2C%20as%20Advisor%20lacks%20some%20important%20details.%20These%20are%20some%20questions%20many%20customers%20ask%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSPAN%3E%E2%80%9C%3CEM%3EWhat%20was%20the%20rationale%20behind%20this%20recommendation%3F%20Which%20actual%20metrics%20and%20thresholds%20were%20considered%20to%20make%20the%20decision%3F%E2%80%9D%3C%2FEM%3E%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CEM%3E%3CSPAN%3E%E2%80%9CHow%20confident%20can%20I%20be%20to%20execute%20the%20recommended%20downsize%20and%20not%20have%20a%20performance%20issue%20afterwards%3F%3C%2FSPAN%3E%3C%2FEM%3E%3CSPAN%3E%E2%80%9D%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3E%E2%80%9C%3CEM%3EHow%20can%20I%20be%20sure%20the%20recommended%20size%20can%20cope%20with%20the%20current%20amount%20of%20data%20disks%20or%20network%20interfaces%3F%3C%2FEM%3E%E2%80%9D%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%3EAs%20of%20today%2C%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fadvisor%2Fadvisor-cost-recommendations%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Edocumentation%20about%20Cost%20recommendations%3C%2FA%3E%20states%20that%20Advisor%20%E2%80%9C%3CEM%3Econsiders%20virtual%20machines%20for%20shut-down%20when%20P95th%20of%20the%20max%20of%20max%20value%20of%20CPU%20utilization%20is%20less%20than%203%25%20and%20network%20utilization%20is%20less%20than%202%25%20over%20a%207%20day%20period.%20Virtual%20machines%20are%20considered%20for%20right%20size%20when%20it%20is%20possible%20to%20fit%20the%20current%20load%20in%20a%20smaller%20SKU%20(within%20the%20same%20SKU%20family)%20or%20a%20smaller%20number%20%23%20of%20instance%20such%20that%20the%20current%20load%20doesn%E2%80%99t%20go%20over%2080%25%20utilization%20when%20non-user%20facing%20workloads%20and%20not%20above%2040%25%20when%20user-facing%20workload.%3C%2FEM%3E%E2%80%9D%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EWe%20have%20an%20idea%20of%20how%20the%20recommendation%20was%20generated%2C%20but%20customers%20need%20more%20details%2C%20such%20as%20the%20actual%20Azure%20Monitor%20metrics%20that%20supported%20the%20recommendation%20and%20projections%20of%20the%20smaller%20SKU%20against%20the%20current%20capacity%20requirements.%20The%20algorithm%20itself%20is%20not%20clearly%20documented%2C%20e.g.%2C%20what%20%E2%80%9CP95th%20of%20the%20max%20of%20max%E2%80%9D%20or%20%E2%80%9Ccurrent%20load%E2%80%9D%20mean%3F%20And%20it%20is%20not%20considering%20storage%20I%2FO%20metrics%20nor%20disk%20or%20NIC%20count%20properties.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EReviewing%20and%20validating%20recommendations%20one-by-one%20requires%20thus%20a%20lot%20of%20effort%2C%20the%20more%20for%20large-scale%20customers%20with%20hundreds%20of%20right-size%20recommendations.%20Ideally%2C%20any%20detail%20accompanying%20a%20recommendation%20should%20be%20provided%20in%20a%20machine-understandable%20manner%2C%20so%20that%20automated%20actions%20can%20be%20implemented%20on%20top.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EFor%20the%20reasons%20above%2C%20some%20customers%20I%20work%20with%20have%20asked%20guidance%20on%20how%20to%20get%20higher%20confidence%20on%20cost%20recommendations%20so%20that%20they%20can%20automate%20remediation%20or%2C%20at%20least%2C%20filter%20out%20recommendations%20that%20haven%E2%80%99t%20a%20strong%20enough%20ground%20to%20be%20further%20investigated.%20This%20post%20gives%20an%20overview%20of%20a%20possible%20solution%20for%20this%20requirement%20and%20the%20remaining%20articles%20in%20the%20series%20will%20provide%20you%20with%20the%20actual%20technical%20details%20of%20the%20solution.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--676108144%22%20id%3D%22toc-hId--676108144%22%3E%3CSPAN%3EA%20solution%20architecture%3C%2FSPAN%3E%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EGetting%20higher%20confidence%20on%20Advisor%20Cost%20right-size%20recommendations%20and%20enabling%20remediation%20automation%20means%3A%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3COL%3E%0A%3CLI%3E%3CSPAN%3EAugmenting%20Advisor%20recommendations%20with%20Virtual%20Machine%20performance%20metrics%20and%20properties%3A%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3EProcessor%20(including%20per%20core)%2C%20memory%2C%20disk%20(IOPS%20and%20throughput)%2C%20and%20network%20usage%20metrics%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EOS%20Type%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ECurrent%20SKU%20memory%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EData%20disk%20and%20network%20interface%20count%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3ECalculating%20a%20confidence%20score%20based%20on%20customer-defined%20performance%20thresholds%20and%20platform-defined%20target%20SKU%20limits%3A%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3ECustomer-provided%20CPU%2C%20memory%2C%20or%20disk%20usage%20thresholds%20%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EAzure%20platform%20VM%20SKU%20limits%20(max.%20data%20disk%20count%2C%20max.%20NIC%20count%2C%20max.%20IOPS%2C%20etc.)%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EProviding%20augmented%20recommendations%20both%20in%20human-%20and%20machine-accessible%20ways%3A%3C%2FSPAN%3E%3CUL%3E%0A%3CLI%3E%3CSPAN%3EVisualize%20latest%20recommendations%20in%20a%20dashboard%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EProvide%20historical%20perspective%2C%20i.e.%2C%20for%20how%20long%20a%20recommendation%20has%20been%20done%3C%2FSPAN%3E%3C%2FLI%3E%0A%3CLI%3E%3CSPAN%3EAccess%20via%20query%20API%20or%20CSV%20exports%3C%2FSPAN%3E%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3C%2FLI%3E%0A%3C%2FOL%3E%0A%3CP%3E%3CSPAN%3EThese%20requirements%20imply%20the%20usage%20of%20multiple%20sources%20of%20information%20beyond%20Azure%20Advisor%20itself.%20The%20architecture%20depicted%20below%20summarizes%20the%20tools%20and%20services%20that%20can%20possibly%20be%20used%20to%20build%20such%20a%20solution.%20The%20solution%20architecture%20is%20a%20typical%20ETL%20and%20analytics%20pattern%20implemented%20on%20top%20of%20Azure%20Automation%20and%20Log%20Analytics.%3C%2FSPAN%3E%3C%2FP%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%22augmenting-azure-advisor-co-pt1-figure2.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%2F186726i3E16B1E622DF59E4%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22augmenting-azure-advisor-co-pt1-figure2.jpg%22%20alt%3D%22augmenting-azure-advisor-co-pt1-figure2.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EDimension%20Data%20Collection%20Runbooks%20periodically%20collect%20data%20from%20Azure%20Advisor%20(Cost%20recommendations)%20and%20Azure%20Resource%20Graph%20(Virtual%20Machine%20and%20Managed%20Disk%20properties)%20and%20dump%20to%20an%20Azure%20Storage%20Account%20container%20a%20selection%20of%20properties%20as%20CSV%20raw%20data%26nbsp%3B.%20The%20Azure%20Storage%20Account%20repository%20has%20a%20long-term%20retention%20and%20can%20be%20used%20as%20well%20as%20a%20source%20for%20replaying%20transformation%20and%20load%20operations.%20We%20are%20using%20here%20only%20a%20couple%20of%20data%20sources%2C%20but%20others%20could%20easily%20be%20plugged%20in%20(Azure%20Billing%2C%20Azure%20Monitor%20metrics%2C%20etc.).%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERaw%20data%20files%20are%20ingested%20into%20the%20Log%20Analytics%20workspace%20by%20the%20Log%20Analytics%20Ingestion%20Runbook%2C%20where%20Virtual%20Machines%20also%20send%20performance%20metrics%20thanks%20to%20the%20Log%20Analytics%20agents.%20With%20all%20the%20data%20together%20in%20the%20same%20repository%20and%20with%20the%20power%20of%20Log%20Analytics%2C%20it%20is%20possible%20to%20augment%20Azure%20Advisor%20recommendations%20with%20very%20useful%20information%20and%20even%20generate%20new%20recommendation%20types%20out%20of%20Azure%20Resource%20Graph%20and%20performance%20counters%26nbsp%3B.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ERecommendation%20Generation%20Runbooks%20have%20recommendation%20type-specific%20logic%20that%20queries%20the%20Log%20Analytics%20workspace%20as%20well%20as%20other%20sources%20of%20information%20(e.g.%2C%20the%20Compute%20ARM%20provider)%20to%20augment%20or%20generate%20a%20recommendation.%20In%20this%20scenario%2C%20Advisor%20Cost%20recommendations%20are%20merged%20with%20VM%20properties%20and%20performance%20metrics%20aggregates.%20Other%20scenarios%20could%20easily%20arise%20from%20the%20available%20data%2C%20such%20as%20recommendations%20for%20deleting%20orphaned%20disks.%20Again%2C%20all%20these%20runbooks%20dump%20the%20augmented%20recommendations%20to%20an%20Azure%20Storage%20Account%20container.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EFinally%2C%20the%20SQL%20Server%20Injection%20Runbook%20periodically%20parses%20the%20raw%20recommendation%20files%20and%20sends%20them%20as%20new%20rows%20to%20an%20Azure%20SQL%20database%20containing%20all%20the%20recommendations%20history.%20The%20result%20of%20the%20process%20is%20visible%20in%20a%20Power%20BI%20dashboard%20%E2%80%93%20see%20sample%20view%20below.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22augmenting-azure-advisor-co-pt1-figure3.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%2F186727iBCA91C6725FF31FB%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22augmenting-azure-advisor-co-pt1-figure3.jpg%22%20alt%3D%22augmenting-azure-advisor-co-pt1-figure3.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EA%20little%20note%20on%20some%20architectural%20decisions.%20First%2C%20the%20Power%20BI%20report%20could%20connect%20directly%20to%20the%20Azure%20Storage%20Account%20instead%20of%20using%20an%20intermediary%20SQL%20Database.%20However%2C%20using%20a%20SQL%20interface%20enables%20better%20querying%20and%20data%20transformation%20capabilities%20and%20makes%20integration%20with%20third-party%20reporting%20solutions%20easier.%20Secondly%2C%20one%20can%20argue%20that%2C%20when%20trying%20to%20save%20on%20Azure%20costs%2C%20we%20are%20adding%20other%20costs%20(Automation%2C%20Storage%20Account%2C%20SQL%20Database%20and%20Log%20Analytics).%20The%20fact%20is%20that%20almost%20all%20components%20are%20very%20cheap%20and%20the%20amount%20of%20ingested%20data%20in%20Log%20Analytics%20for%20VM%20metrics%20can%20be%20optimized%20to%20collect%20only%20the%20required%20counters%20with%20a%20large%20collection%20interval.%20Moreover%2C%20if%20an%20organization%20was%20already%20using%20Log%20Analytics%20for%20VM%20metrics%2C%20we%20are%20just%20leveraging%20this%20data%20with%20no%20additional%20costs.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20the%20upcoming%20posts%20in%20this%20series%20(%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Faugmenting-azure-advisor-cost-recommendations-for-automated%2Fba-p%2F1457687%22%20target%3D%22_self%22%3Epart%202%3C%2FA%3E%2C%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fcore-infrastructure-and-security%2Faugmenting-azure-advisor-cost-recommendations-for-automated%2Fba-p%2F1544796%22%20target%3D%22_self%22%3Epart%203%3C%2FA%3E%20and%20part%204)%2C%20we%20will%20look%20at%20the%20implementation%20details%20of%20each%20step%20of%20the%20process%20and%20understand%20how%20this%20solution%20can%20be%20used%20to%20automate%20right-size%20remediations%20with%20high%20confidence.%20Stay%20tuned!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1339298%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3EHere%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eis%20Helder%20Pinto%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3EPFE%20presenting%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3Ethe%20first%20post%20of%20a%20series%20dedicated%20to%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3Ethe%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Eimplement%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3Eation%20of%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3Eautomated%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3EContinuous%20Optimization%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3Ewith%20Azure%20Advisor%20Cost%20recommendations.%20This%20post%20described%20how%20Azure%20Advisor%20Cost%20recommendations%20can%20be%20augmented%20with%20a%20confidence%20score%20generated%20with%20the%20help%20of%20Azure%20Resource%20Graph%2C%20Automation%20and%20Log%20Analytics.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22TextRun%20SCXW165567554%20BCX0%22%20data-contrast%3D%22auto%22%3E%3CSPAN%20class%3D%22NormalTextRun%20SCXW165567554%20BCX0%22%20data-ccp-charstyle%3D%22Emphasis%22%20data-wac-het%3D%221%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22augmenting-azure-advisor-co-pt1-figure2.jpg%22%20style%3D%22width%3A%20975px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F186728iCDFAD68FB3BD4454%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22augmenting-azure-advisor-co-pt1-figure2.jpg%22%20alt%3D%22augmenting-azure-advisor-co-pt1-figure2.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1339298%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EHelderPinto%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

Here is Helder Pinto PFE presenting the first post of a series dedicated to the implementation of automated Continuous Optimization with Azure Advisor Cost recommendations.

 

Introduction

 

We can define Continuous Optimization (CO) in the context of Microsoft Azure and IT environments in general as an iterative process aiming at constantly assessing optimization opportunities in our infrastructure and implement required changes. This is done routinely in many organizations – finding and implementing performance, security, or cost optimization opportunities can be a full-time job in some large enterprise scenarios.

 

Azure Advisor is a great, free governance tool that every Azure customer should look at often and use as a source of CO. In Azure Advisor, you can find recommendations for several categories: Performance, High Availability, Security (sourced from Azure Security Center), Operational Excellence, and Cost (coming from Azure Cost Management). Each recommendation comes with a justification, impact level and details on how to optimize the impacted resources. See more details here.

 

augmenting-azure-advisor-co-pt1-figure1.jpg

 

The problem 

 

All Advisor recommendations are actionable and, in many cases, automatable – ultimately, CO should be as automatic as CI/CD. For example, when Advisor finds Virtual Machines missing endpoint protection, we can automate the deployment of the corresponding VM extension.

 

When it comes to Cost recommendations, there are also some scenarios where optimization automation is easy to implement: deleting orphaned Public IPs or moving snapshots to Standard Storage are some examples. However, when customers look at Virtual Machine right-size recommendations – one of the recommendations with higher cost optimization impact –, very few feel comfortable enough to act accordingly, even more if asked to automate the action, as Advisor lacks some important details. These are some questions many customers ask:

 

  • What was the rationale behind this recommendation? Which actual metrics and thresholds were considered to make the decision?”
  • “How confident can I be to execute the recommended downsize and not have a performance issue afterwards?
  • How can I be sure the recommended size can cope with the current amount of data disks or network interfaces?

As of today, the documentation about Cost recommendations states that Advisor “considers virtual machines for shut-down when P95th of the max of max value of CPU utilization is less than 3% and network utilization is less than 2% over a 7 day period. Virtual machines are considered for right size when it is possible to fit the current load in a smaller SKU (within the same SKU family) or a smaller number # of instance such that the current load doesn’t go over 80% utilization when non-user facing workloads and not above 40% when user-facing workload.

 

We have an idea of how the recommendation was generated, but customers need more details, such as the actual Azure Monitor metrics that supported the recommendation and projections of the smaller SKU against the current capacity requirements. The algorithm itself is not clearly documented, e.g., what “P95th of the max of max” or “current load” mean? And it is not considering storage I/O metrics nor disk or NIC count properties.

 

Reviewing and validating recommendations one-by-one requires thus a lot of effort, the more for large-scale customers with hundreds of right-size recommendations. Ideally, any detail accompanying a recommendation should be provided in a machine-understandable manner, so that automated actions can be implemented on top.

 

For the reasons above, some customers I work with have asked guidance on how to get higher confidence on cost recommendations so that they can automate remediation or, at least, filter out recommendations that haven’t a strong enough ground to be further investigated. This post gives an overview of a possible solution for this requirement and the remaining articles in the series will provide you with the actual technical details of the solution.

 

A solution architecture

 

Getting higher confidence on Advisor Cost right-size recommendations and enabling remediation automation means:

 

  1. Augmenting Advisor recommendations with Virtual Machine performance metrics and properties:
    • Processor (including per core), memory, disk (IOPS and throughput), and network usage metrics
    • OS Type
    • Current SKU memory
    • Data disk and network interface count
  2. Calculating a confidence score based on customer-defined performance thresholds and platform-defined target SKU limits:
    • Customer-provided CPU, memory, or disk usage thresholds
    • Azure platform VM SKU limits (max. data disk count, max. NIC count, max. IOPS, etc.)
  3. Providing augmented recommendations both in human- and machine-accessible ways:
    • Visualize latest recommendations in a dashboard
    • Provide historical perspective, i.e., for how long a recommendation has been done
    • Access via query API or CSV exports

These requirements imply the usage of multiple sources of information beyond Azure Advisor itself. The architecture depicted below summarizes the tools and services that can possibly be used to build such a solution. The solution architecture is a typical ETL and analytics pattern implemented on top of Azure Automation and Log Analytics.

 

augmenting-azure-advisor-co-pt1-figure2.jpg

 

Dimension Data Collection Runbooks periodically collect data from Azure Advisor (Cost recommendations) and Azure Resource Graph (Virtual Machine and Managed Disk properties) and dump to an Azure Storage Account container a selection of properties as CSV raw data . The Azure Storage Account repository has a long-term retention and can be used as well as a source for replaying transformation and load operations. We are using here only a couple of data sources, but others could easily be plugged in (Azure Billing, Azure Monitor metrics, etc.).

 

Raw data files are ingested into the Log Analytics workspace by the Log Analytics Ingestion Runbook, where Virtual Machines also send performance metrics thanks to the Log Analytics agents. With all the data together in the same repository and with the power of Log Analytics, it is possible to augment Azure Advisor recommendations with very useful information and even generate new recommendation types out of Azure Resource Graph and performance counters .

 

Recommendation Generation Runbooks have recommendation type-specific logic that queries the Log Analytics workspace as well as other sources of information (e.g., the Compute ARM provider) to augment or generate a recommendation. In this scenario, Advisor Cost recommendations are merged with VM properties and performance metrics aggregates. Other scenarios could easily arise from the available data, such as recommendations for deleting orphaned disks. Again, all these runbooks dump the augmented recommendations to an Azure Storage Account container.

 

Finally, the SQL Server Injection Runbook periodically parses the raw recommendation files and sends them as new rows to an Azure SQL database containing all the recommendations history. The result of the process is visible in a Power BI dashboard – see sample view below.

 

augmenting-azure-advisor-co-pt1-figure3.jpg

 

A little note on some architectural decisions. First, the Power BI report could connect directly to the Azure Storage Account instead of using an intermediary SQL Database. However, using a SQL interface enables better querying and data transformation capabilities and makes integration with third-party reporting solutions easier. Secondly, one can argue that, when trying to save on Azure costs, we are adding other costs (Automation, Storage Account, SQL Database and Log Analytics). The fact is that almost all components are very cheap and the amount of ingested data in Log Analytics for VM metrics can be optimized to collect only the required counters with a large collection interval. Moreover, if an organization was already using Log Analytics for VM metrics, we are just leveraging this data with no additional costs.

 

In the upcoming posts in this series (part 2, part 3 and part 4), we will look at the implementation details of each step of the process and understand how this solution can be used to automate right-size remediations with high confidence. Stay tuned!