%3CLINGO-SUB%20id%3D%22lingo-sub-1701251%22%20slang%3D%22en-US%22%3EEmpowering%20Azure%20CLI%20developers%20with%20AI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1701251%22%20slang%3D%22en-US%22%3E%3CP%3EWhen%20we%20redesigned%20the%20Azure%20CLI%20in%202016%2C%20our%20goal%20was%20to%20create%20a%20simple%2C%20easy%20to%20use%2C%20tool%20for%20managing%20Azure.%26nbsp%3B%20Since%20then%2C%20Azure%20has%20grown%20tremendously%20from%20supporting%20multiple%20clouds%20in%20various%20locations%20across%20the%20globe%2C%20on%2Foff%20premises%20services%2C%20and%20scenario-specific%20technologies%2C%20such%20as%20Azure%20IoT%20and%20AI%2FML%20tools.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWith%20over%202500%20commands%2C%20tens%20of%20thousands%20of%20parameters%2C%20and%20new%20Azure%20features%20being%20developed%20daily%2C%20maintaining%20simplicity%20in%20Azure%20CLI%20is%20a%20challenge.%20In%20this%20post%2C%20we%20want%20to%20introduce%20you%20to%20three%20of%20our%20AI-powered%20features%20we%E2%80%99ve%20developed%20to%20ensure%20the%20Azure%20CLI%20remains%20easy%20to%20use%2C%20consistent%2C%20and%20%E2%80%9Cevergreen%E2%80%9D.%26nbsp%3B%20These%20features%20include%3A%20generating%20up-to-date%20examples%2C%20enabling%20natural%20language%20search%20in%20command%20line%2C%20and%20assisting%20with%20failure%20recovery.%20We%20will%20share%20with%20you%20our%20learnings%20and%20journey%20below.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-580889995%22%20id%3D%22toc-hId-580889999%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--1226564468%22%20id%3D%22toc-hId--1226564464%22%3EGenerating%20up-to-date%20examples%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ELearning%20new%20software%20and%20APIs%20requires%20up%20to%20date%20documentation%20with%20multiple%20examples%20covering%20the%20main%20common%20scenarios.%20However%2C%20the%20fast%20pace%20of%20modern%20software%20causes%20documentation%2C%20especially%20examples%2C%20to%20quickly%20become%20stale.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%E2%80%99ve%20addressed%20the%20problem%20of%20incomplete%20and%20stale%20documentation%20by%20developing%20an%20AI-powered%20platform%20that%20automatically%20generates%20and%20updates%20examples%20for%20our%20command%20line%20tools%20(Azure%20CLI%20and%20Azure%20PowerShell)%20ensuring%3C%2FP%3E%0A%3CUL%3E%0A%3CLI%3E%3CSTRONG%3EUp-to-date%20examples%3C%2FSTRONG%3E%3A%20generate%20new%20examples%20with%20each%20new%20Azure%20CLI%20(and%20Azure%20PowerShell)%20release%2C%20ensuring%20the%20documentation%20is%20always%20up-to-date.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3ERepresentative%20of%20actual%20usage%3C%2FSTRONG%3E%3A%20Unlike%20bare-bones%20examples%20usually%20found%20in%20documentation%20that%20only%20cover%20basic%20scenarios%2C%20our%20examples%20are%20based%20on%20actual%20usage%20patterns%20and%20therefore%20represent%20how%20current%20users%20use%20the%20software%20in%20practice.%3C%2FLI%3E%0A%3CLI%3E%3CSTRONG%3EInformed%20by%20our%20educational%20content%3C%2FSTRONG%3E%3A%20Our%20platform%20ingests%20over%2014%2C000%20pages%20of%20blogs%2C%20tutorials%2C%20and%20samples%20to%20ensure%20consistency%20(naming%2C%20sample%20values%2C%20etc.)%20across%20our%20learning%20resources.%26nbsp%3B%3C%2FLI%3E%0A%3C%2FUL%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22cli-help-3.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F228001i759661A3E041CD9E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22cli-help-3.png%22%20alt%3D%22Figure%201.%20Just%20like%20regular%20examples%2C%20our%20auto-generated%20examples%20are%20accessible%20through%20the%20command%20line%20by%20typing%20--help%2F-h%20in%20front%20of%20the%20command%20name.%20In%20this%20Figure%2C%20the%20user%20has%20called%20help%20on%20%E2%80%98az%20keyvault%20update%E2%80%99.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%201.%20Just%20like%20regular%20examples%2C%20our%20auto-generated%20examples%20are%20accessible%20through%20the%20command%20line%20by%20typing%20--help%2F-h%20in%20front%20of%20the%20command%20name.%20In%20this%20Figure%2C%20the%20user%20has%20called%20help%20on%20%E2%80%98az%20keyvault%20update%E2%80%99.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOur%20examples%20are%20accessible%20through%20the%20command%20line%20help%20by%20typing%20the%20command%20name%20followed%20by%20%E2%80%9C--help%E2%80%9D%20or%20%E2%80%9C-h%E2%80%9D%20in%20the%20command%20line%20(Figure%201).%20Additionally%2C%20examples%20are%20published%20to%20our%20online%20reference%20docs%20(Figure%202).%26nbsp%3B%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%22Screen%20Shot%202020-10-20%20at%206.58.27%20AM.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F227992i02324661EE019C59%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22Screen%20Shot%202020-10-20%20at%206.58.27%20AM.png%22%20alt%3D%22Figure%202.%20Screenshot%20of%20help%20content%20and%20examples%20as%20shown%20in%20reference%20docs%20on%20the%20web.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%202.%20Screenshot%20of%20help%20content%20and%20examples%20as%20shown%20in%20reference%20docs%20on%20the%20web.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20measure%20the%20effectiveness%20of%20our%20pipeline%2C%20we%20examined%20the%20coverage%20and%20quality%20of%20our%20generated%20examples.%20We%20observed%20the%20examples%20written%20by%20software%20owners%20(human%20generated%20examples)%20cover%2055%25%20of%20the%20functionality%20and%20features%20supported%20by%20Azure%20CLI%2C%20while%20our%20AI-generated%20examples%20cover%20100%25%20of%20used%20features%20and%20functionality.%20This%20means%20that%20algorithmically%20we%20can%20achieve%20a%20scale%20that%20cannot%20be%20achieved%20through%20manual%20writing%20of%20examples.%20Not%20only%20do%20AI-generated%20examples%20cover%20more%20commands%2C%20but%20they%20also%20cover%20more%20service%20functionality.%20For%20example%2C%20while%20human-generated%20examples%20on%20average%20only%20cover%2020%25%20of%20command%20parameters%2C%20AI-generated%20ones%20cover%2032%25.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1260948365%22%20id%3D%22toc-hId-1260948369%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId--546506098%22%20id%3D%22toc-hId--546506094%22%3EEnabling%20natural%20language%20search%20in%20command%20line%26nbsp%3B%26nbsp%3B%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFinding%20the%20right%20command%20can%20be%20difficult%2C%20especially%20with%20multiple%20Azure%20offerings%20for%20popular%20concepts%20or%20scenarios.%20The%20Azure%20CLI%20originally%20shipped%20with%20an%20%60az%20find%60%20command%20powered%20by%20plain%20text%20search%2C%20allowing%20users%20to%20search%20through%20the%20100s%20of%20commands%20for%20their%20scenario.%20However%2C%20the%20plain%20text%20search%20did%20not%20provide%20any%20recommendations%20or%20context%20on%20how%20to%20pick%20the%20best%20service.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22cli-help-4.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F228058i7164B3C727D854E5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22cli-help-4.png%22%20alt%3D%22Figure%203.%20Our%20natural%20language%20search%2C%20finds%20the%20most%20relevant%20examples%20in%20our%20knowledgebase.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%203.%20Our%20natural%20language%20search%2C%20finds%20the%20most%20relevant%20examples%20in%20our%20knowledgebase.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20early%202019%2C%20we%20released%20an%20AI%20based%20version%20of%20%E2%80%98az%20find%E2%80%99%2C%20augmented%20with%20natural%20language%20search%20features%20powered%20by%20the%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fsearch%2F%3F%26amp%3Bef_id%3DCj0KCQjw6uT4BRD5ARIsADwJQ19MZBYCkJQ0xUgfR_IVPMUL4r3q3p0InYeAdUyj9IIgXQP7Dubr-YkaAolSEALw_wcB%3AG%3As%26amp%3BOCID%3DAID2100131_SEM_Cj0KCQjw6uT4BRD5ARIsADwJQ19MZBYCkJQ0xUgfR_IVPMUL4r3q3p0InYeAdUyj9IIgXQP7Dubr-YkaAolSEALw_wcB%3AG%3As%26amp%3Bgclid%3DCj0KCQjw6uT4BRD5ARIsADwJQ19MZBYCkJQ0xUgfR_IVPMUL4r3q3p0InYeAdUyj9IIgXQP7Dubr-YkaAolSEALw_wcB%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Search%20Service%3C%2FA%3E%20(Figure%203).%20In%20addition%2C%20the%20new%20%E2%80%98az%20find%E2%80%99%20also%20supplies%20command%20and%20command%20group%20level%20examples%20allowing%20users%20to%20easily%20find%20the%20most%20popular%20features%20and%20services%20(Figure%204).%20While%20our%20in-tool%20AI-powered%20examples%20are%20updated%20with%20each%20release%2C%20the%20%E2%80%99az%20find%E2%80%99%20command%20supplies%20the%20most%20up-to-date%20recommendations.%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20image-alt%3D%22cli-help-5.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F228021iD9C02554D00040F5%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22cli-help-5.png%22%20alt%3D%22Figure%204.%20For%20each%20command%20group%2C%20the%20most%20common%20commands%20used%20within%20that%20command%20group%20are%20shown.%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EFigure%204.%20For%20each%20command%20group%2C%20the%20most%20common%20commands%20used%20within%20that%20command%20group%20are%20shown.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId-1941006735%22%20id%3D%22toc-hId-1941006739%22%3EAssisting%20in%20failure%20recovery%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETaking%20the%20right%20action%20to%20recover%20from%20a%20failure%20can%20be%20challenging%20and%20exacerbated%20by%20an%20ever-changing%20platform%20where%20new%20functionalities%20and%20features%20are%20added%20frequently.%20Our%20cloud%20developers%20and%20in%20particular%20novice%20developers%2C%20may%20struggle%20with%20finding%20the%20right%20commands%2C%20parameters%2C%20or%20values%20and%20further%20struggle%20with%20cryptic%20error%20messages.%20Guiding%20developers%20through%20examples%20can%20help%20alleviate%20some%20of%20their%20frustrations.%20With%20the%20goal%20of%20helping%20such%20users%2C%20we%20present%20a%20command%20line%20failure%20recovery%20recommender%20system%20for%20Azure%20CLI.%20Our%20failure%20recovery%20system%20is%20an%20AI-based%20system%20that%20learns%20from%20other%20users%E2%80%99%20past%20errors%20and%20creates%20recovery%20patterns%20from%20these%20errors.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId--1663399087%22%20id%3D%22toc-hId--1663399083%22%3EAn%20Example%3C%2FH2%3E%0A%3CP%3ELet%E2%80%99s%20consider%20a%20new%20Azure%20developer%20who%20has%20created%20a%20storage%20account%20before%20and%20now%20is%20using%20Azure%20CLI%20to%20quickly%20create%20another%20account.%20The%20user%20types%20the%20following%20command.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22cli-az-create-before-2.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F221473i6CC191D4527A78C9%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22cli-az-create-before-2.png%22%20alt%3D%22cli-az-create-before-2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3EThe%20previous%20Azure%20CLI%20versions%20would%20have%20shown%20the%20user%20an%20error%20saying%20%E2%80%98%3CEM%3Ecreate%E2%80%99%20is%20not%20in%3C%2FEM%3E%20%3CEM%3E%E2%80%98az%20storage%E2%80%99%3C%2FEM%3E%20%3CEM%3Ecommand%20group%3C%2FEM%3E%20and%20referenced%20in%20editor%20help%20or%20generic%20online%20docs%20for%20help.%20However%2C%20with%20our%20failure%20recovery%20recommender%20system%2C%20the%20new%20Azure%20CLI%20will%20recommend%20an%20example%20command%20that%20the%20user%20is%20most%20likely%20to%20run.%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22cli-az-create-2.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F221476i0365E7776DAE5CA8%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%22cli-az-create-2.png%22%20alt%3D%22cli-az-create-2.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-824113746%22%20id%3D%22toc-hId-824113750%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--983340717%22%20id%3D%22toc-hId--983340713%22%3EHow%20does%20it%20work%3F%3C%2FH2%3E%0A%3CP%3EOur%20failure%20recovery%20system%20uses%20a%20conditional%20probability%20model.%20This%20model%20is%20built%20on%20the%20assumption%20that%20scripts%20accomplish%20tasks%20and%20specific%20tasks%20require%20specific%20commands%20in%20a%20certain%20order.%20Within%20each%20script%2C%20if%20a%20command%20fails%20there%20should%20be%20common%20patterns%20on%20how%20the%20next%20successful%20command%20remedies%20that%20failure.%20Data%20analysis%20demonstrates%20that%20given%20one%20or%20more%20commands%20in%20a%20script%20significantly%20narrows%20the%20probability%20of%20what%20command(s)%20follow%20these%20in%20that%20script.%20For%20instance%2C%20the%20chance%20of%20a%20user%20running%20%E2%80%9Caz%20storage%20account%20create%E2%80%9D%20is%200.01%25%3B%20when%20proceeded%20by%20%E2%80%98az%20storage%20create%E2%80%99%20which%20is%20a%20failure%20the%20chance%20increases%20to%2049%25.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1504172116%22%20id%3D%22toc-hId-1504172120%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22toc-hId--303282347%22%20id%3D%22toc-hId--303282343%22%3EHow%20do%20we%20serve%20the%20recommendations%3F%3C%2FH2%3E%0A%3CP%3EThe%20failure%20recommendation%20service%20is%20hosted%20by%20%3CA%20href%3D%22https%3A%2F%2Fazure.microsoft.com%2Fen-us%2Fservices%2Fapp-service%2F%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20App%20Service%3C%2FA%3E.%20Scalability%20and%20performance%20are%20critical%20for%20the%20service%20so%20that%20we%20can%20respond%20to%20requests%20quickly%20in%20the%20order%20of%20milliseconds.%20When%20the%20system%20is%20under%20heavy%20load%2C%20we%20leverage%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fazure-monitor%2Fplatform%2Fautoscale-get-started%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eautoscaling%20capabilities%20in%20Azure%3C%2FA%3E%20to%20quickly%20scale%20up%20and%20keep%20the%20service%20performant.%20The%20service%20is%20deployed%20into%20different%20regions%20worldwide%2C%20which%20is%20aligned%20with%20Azure%20CLI%20users%20distribution%20to%20make%20sure%20every%20user%E2%80%99s%20request%20can%20be%20served%20from%20a%20region%20within%20the%20shortest%20amount%20of%20time.%3C%2FP%3E%0A%3CH1%20id%3D%22toc-hId--566049790%22%20id%3D%22toc-hId--566049786%22%3E%26nbsp%3B%3C%2FH1%3E%0A%3CH1%20id%3D%22toc-hId-1921463043%22%20id%3D%22toc-hId-1921463047%22%3EHelp%20us%20improve%20with%20your%20feedback%3C%2FH1%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHelp%20us%20make%20the%20tools%20that%20you%20love%20and%20use%20every%20day%20even%20better.%20You%20can%20provide%20feedback%20by%20creating%20an%20issue%20in%20%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2FAzure%2Fazure-cli%2Fissues%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20CLI%20Github%20page%3C%2FA%3E.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-1701251%22%20slang%3D%22en-US%22%3E%3CP%3EWith%20over%202500%20commands%2C%20tens%20of%20thousands%20of%20parameters%2C%20and%20new%20Azure%20features%20being%20developed%20daily%2C%20maintaining%20simplicity%20is%20a%20challenge.%20In%20this%20post%2C%20we%20want%20to%20introduce%20you%20to%20three%20of%20our%20AI-powered%20features%20we%E2%80%99ve%20developed%20to%20ensure%20the%20Azure%20CLI%20remains%20easy%20to%20use%2C%20consistent%2C%20and%20%E2%80%9Cevergreen%E2%80%9D.%26nbsp%3B%20These%20features%20include%3A%20generating%20up-to-date%20examples%2C%20enabling%20natural%20language%20search%20in%20command%20line%2C%20and%20assisting%20with%20failure%20recovery.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1701251%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzureCLI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Microsoft

When we redesigned the Azure CLI in 2016, our goal was to create a simple, easy to use, tool for managing Azure.  Since then, Azure has grown tremendously from supporting multiple clouds in various locations across the globe, on/off premises services, and scenario-specific technologies, such as Azure IoT and AI/ML tools. 

 

With over 2500 commands, tens of thousands of parameters, and new Azure features being developed daily, maintaining simplicity in Azure CLI is a challenge. In this post, we want to introduce you to three of our AI-powered features we’ve developed to ensure the Azure CLI remains easy to use, consistent, and “evergreen”.  These features include: generating up-to-date examples, enabling natural language search in command line, and assisting with failure recovery. We will share with you our learnings and journey below.

 

Generating up-to-date examples

 

Learning new software and APIs requires up to date documentation with multiple examples covering the main common scenarios. However, the fast pace of modern software causes documentation, especially examples, to quickly become stale.

 

We’ve addressed the problem of incomplete and stale documentation by developing an AI-powered platform that automatically generates and updates examples for our command line tools (Azure CLI and Azure PowerShell) ensuring

  • Up-to-date examples: generate new examples with each new Azure CLI (and Azure PowerShell) release, ensuring the documentation is always up-to-date.
  • Representative of actual usage: Unlike bare-bones examples usually found in documentation that only cover basic scenarios, our examples are based on actual usage patterns and therefore represent how current users use the software in practice.
  • Informed by our educational content: Our platform ingests over 14,000 pages of blogs, tutorials, and samples to ensure consistency (naming, sample values, etc.) across our learning resources. 

Figure 1. Just like regular examples, our auto-generated examples are accessible through the command line by typing --help/-h in front of the command name. In this Figure, the user has called help on ‘az keyvault update’.Figure 1. Just like regular examples, our auto-generated examples are accessible through the command line by typing --help/-h in front of the command name. In this Figure, the user has called help on ‘az keyvault update’.

 

Our examples are accessible through the command line help by typing the command name followed by “--help” or “-h” in the command line (Figure 1). Additionally, examples are published to our online reference docs (Figure 2). 

 

Figure 2. Screenshot of help content and examples as shown in reference docs on the web.Figure 2. Screenshot of help content and examples as shown in reference docs on the web.

 

To measure the effectiveness of our pipeline, we examined the coverage and quality of our generated examples. We observed the examples written by software owners (human generated examples) cover 55% of the functionality and features supported by Azure CLI, while our AI-generated examples cover 100% of used features and functionality. This means that algorithmically we can achieve a scale that cannot be achieved through manual writing of examples. Not only do AI-generated examples cover more commands, but they also cover more service functionality. For example, while human-generated examples on average only cover 20% of command parameters, AI-generated ones cover 32%.

 

Enabling natural language search in command line  

 

Finding the right command can be difficult, especially with multiple Azure offerings for popular concepts or scenarios. The Azure CLI originally shipped with an `az find` command powered by plain text search, allowing users to search through the 100s of commands for their scenario. However, the plain text search did not provide any recommendations or context on how to pick the best service. 

Figure 3. Our natural language search, finds the most relevant examples in our knowledgebase.Figure 3. Our natural language search, finds the most relevant examples in our knowledgebase.

 

In early 2019, we released an AI based version of ‘az find’, augmented with natural language search features powered by the Azure Search Service (Figure 3). In addition, the new ‘az find’ also supplies command and command group level examples allowing users to easily find the most popular features and services (Figure 4). While our in-tool AI-powered examples are updated with each release, the ’az find’ command supplies the most up-to-date recommendations. 

Figure 4. For each command group, the most common commands used within that command group are shown.Figure 4. For each command group, the most common commands used within that command group are shown.

 

Assisting in failure recovery

 

Taking the right action to recover from a failure can be challenging and exacerbated by an ever-changing platform where new functionalities and features are added frequently. Our cloud developers and in particular novice developers, may struggle with finding the right commands, parameters, or values and further struggle with cryptic error messages. Guiding developers through examples can help alleviate some of their frustrations. With the goal of helping such users, we present a command line failure recovery recommender system for Azure CLI. Our failure recovery system is an AI-based system that learns from other users’ past errors and creates recovery patterns from these errors.

 

An Example

Let’s consider a new Azure developer who has created a storage account before and now is using Azure CLI to quickly create another account. The user types the following command.

cli-az-create-before-2.png

The previous Azure CLI versions would have shown the user an error saying ‘create’ is not in ‘az storage’ command group and referenced in editor help or generic online docs for help. However, with our failure recovery recommender system, the new Azure CLI will recommend an example command that the user is most likely to run.

cli-az-create-2.png

 

How does it work?

Our failure recovery system uses a conditional probability model. This model is built on the assumption that scripts accomplish tasks and specific tasks require specific commands in a certain order. Within each script, if a command fails there should be common patterns on how the next successful command remedies that failure. Data analysis demonstrates that given one or more commands in a script significantly narrows the probability of what command(s) follow these in that script. For instance, the chance of a user running “az storage account create” is 0.01%; when proceeded by ‘az storage create’ which is a failure the chance increases to 49%.

 

How do we serve the recommendations?

The failure recommendation service is hosted by Azure App Service. Scalability and performance are critical for the service so that we can respond to requests quickly in the order of milliseconds. When the system is under heavy load, we leverage the autoscaling capabilities in Azure to quickly scale up and keep the service performant. The service is deployed into different regions worldwide, which is aligned with Azure CLI users distribution to make sure every user’s request can be served from a region within the shortest amount of time.

 

Help us improve with your feedback

 

Help us make the tools that you love and use every day even better. You can provide feedback by creating an issue in Azure CLI Github page.