Home
%3CLINGO-SUB%20id%3D%22lingo-sub-360147%22%20slang%3D%22en-US%22%3EHow%20to%20query%20Azure%20resources%20using%20the%20Azure%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-360147%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3ETL%2FDR%3C%2FSTRONG%3E%3A%20The%20Azure%20CLI%20can%20be%20used%20to%20query%20data%20from%20Azure.%20For%20more%20information%20on%20how%20to%20use%20the%20Azure%20CLI%20query%20functionality%2C%20see%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fquery-azure-cli%3FWT.mc_id%3DITOpsTalk-blog-nepeters%26amp%3Bview%3Dazure-cli-latest%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20CLI%20Query%20documentation%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThe%20Azure%20CLI%20can%20be%20used%20to%20not%20only%20create%2C%20configure%2C%20and%20delete%20resources%20from%20Azure%20but%20to%20also%20query%20data%20from%20Azure.%20To%20do%20so%2C%20the%20Azure%20CLI%20uses%20the%3CCODE%3E--query%3C%2FCODE%3E%20argument%20to%20run%20a%20%3CA%20href%3D%22http%3A%2F%2Fjmespath.org%2Ftutorial.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJMESPath%3C%2FA%3E%20query%20against%20your%20Azure%20subscriptions.%20Querying%20Azure%20for%20resource%20properties%20can%20be%20quite%20helpful%20when%20writing%20scripts%20using%20the%20Azure%20CLI.%20For%20instance%2C%20you%20may%20want%20to%20get%20the%20IP%20address%20of%20an%20Azure%20Virtual%20Machine%20or%20Container%20Instance%20in%20order%20to%20perform%20some%20action%20on%20that%20resource.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20article%20includes%20a%20quick%20exercise%20that%20demonstrates%20several%20concepts%20with%20a%20final%20goal%20being%20to%20query%20a%20single%20resource%20property%20and%20storing%20the%20value%20of%20that%20property%20in%20a%20variable.%20This%20is%20demonstrated%20using%20Azure%20Container%20Instances%20(ACI).%20You%20do%20not%20need%20to%20have%20experience%20with%20ACI%20to%20complete%20the%20steps%20in%20this%26nbsp%3B%3CSPAN%3Earticle%2C%3C%2FSPAN%3E%26nbsp%3Bthe%20concepts%20transfer%20to%20any%20Azure%20resource.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20quick%20access%20to%20the%20Azure%20CLI%20consider%20using%20the%20%3CA%20href%3D%22https%3A%2F%2Fshell.azure.com%2F%3FWT.mc_id%3DITOpsTalk-blog-nepeters%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EAzure%20Cloud%20Shell%3C%2FA%3E.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-1678752519%22%20id%3D%22toc-hId-1704849435%22%20id%3D%22toc-hId-1704849435%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22createthreecontainerinstances%22%20id%3D%22toc-hId--873404442%22%20id%3D%22toc-hId--847307526%22%20id%3D%22toc-hId--847307526%22%3ECreate%20three%20Container%20Instances%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20digging%20into%20query%20syntax%20and%20operations%2C%20create%20a%20resource%20group%20using%20the%20%3CA%3Eaz%20group%20create%3C%2FA%3E%20command%20and%20three%20container%20instances%20using%20the%20%3CA%3Eaz%20container%20create%3C%2FA%3E%20command.%20The%20following%20bash%20script%20can%20be%20used%20to%20complete%20this.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%23%20Create%20Resource%20Group%0Aaz%20group%20create%20--name%20myResourceGroup%20--location%20eastus%0A%0A%23%20Create%20three%20container%20instances%0Afor%20((i%3D0%3B%20i%26lt%3B3%3B%20%2B%2Bi))%3B%20do%20az%20container%20create%20--resource-group%20myResourceGroup%20--name%20mycontainer%24i%20--image%20microsoft%2Faci-helloworld%20--ip-address%20public%3B%20done%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH2%20id%3D%22toc-hId-869405893%22%20id%3D%22toc-hId-895502809%22%20id%3D%22toc-hId-895502809%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22outputformat%22%20id%3D%22toc-hId--1682751068%22%20id%3D%22toc-hId--1656654152%22%20id%3D%22toc-hId--1656654152%22%3EOutput%20format%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EBefore%20talking%20about%20the%20query%20command%2C%20lets%20discuss%20output%20format.%20By%20default%2C%20when%20any%20command%20is%20run%20using%20the%20Azure%20CLI%2C%20the%20output%20is%20returned%20JSON%20formatted.%20For%20example%2C%20run%20the%20%3CA%3Eaz%20container%20list%3C%2FA%3E%20command.%20You%20should%20see%20that%20a%20JSON%20document%20is%20returned%20with%20the%20details%20of%20all%20container%20instances%20in%20your%20subscription.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWhile%20the%20JSON%20output%20is%20verbose%2C%20which%20is%20great%2C%20we%20may%20want%20to%20format%20the%20output%20a%20little%20more%20elegantly.%20We%20can%20do%20so%20by%20changing%20the%20output%20format.%20This%20article%20will%20focus%20on%20%3CCODE%3Etable%3C%2FCODE%3E%20and%20%3CCODE%3Etsv%3C%2FCODE%3E%20format.%20For%20a%20complete%20list%20of%20Azure%20CLI%20output%20formats%20and%20a%20explanation%20of%20each%2C%20see%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fformat-output-azure-cli%3FWT.mc_id%3DITOpsTalk-blog-nepeters%26amp%3Bview%3Dazure-cli-latest%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EOutput%20format%20for%20Azure%20CLI%20commands%3C%2FA%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EChange%20the%20output%20type%20using%20the%20%3CCODE%3E--output%3C%2FCODE%3E%20argument.%20In%20the%20following%20example%20the%20output%20type%20of%20%3CCODE%3Etable%3C%2FCODE%3E%20is%20used.%20You%20can%20see%20that%20while%20the%20output%20is%20not%20quite%20as%20verbose%2C%20it%20is%20easier%20to%20parse.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%20--output%20table%0A%0AName%20%20%20%20%20%20%20%20%20%20ResourceGroup%20%20%20%20Status%20%20%20%20%20Image%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20IP%3Aports%20%20%20%20%20%20%20%20%20%20%20Network%20%20%20%20CPU%2FMemory%20%20%20%20%20%20%20OsType%20%20%20%20Location%0A------------%20%20---------------%20%20---------%20%20------------------------%20%20-----------------%20%20---------%20%20---------------%20%20--------%20%20----------%0Amycontainer0%20%20myResourceGroup%20%20Succeeded%20%20microsoft%2Faci-helloworld%20%2020.42.27.240%3A80%20%20%20%20Public%20%20%20%20%201.0%20core%2F1.5%20gb%20%20Linux%20%20%20%20%20eastus%0Amycontainer1%20%20myResourceGroup%20%20Succeeded%20%20microsoft%2Faci-helloworld%20%20104.45.170.149%3A80%20%20Public%20%20%20%20%201.0%20core%2F1.5%20gb%20%20Linux%20%20%20%20%20eastus%0Amycontainer2%20%20myResourceGroup%20%20Succeeded%20%20microsoft%2Faci-helloworld%20%2052.188.216.148%3A80%20%20Public%20%20%20%20%201.0%20core%2F1.5%20gb%20%20Linux%20%20%20%20%20eastus%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20can%20change%20the%20default%20output%20format%20for%20the%20CLI%20with%20the%20%3CA%3Eaz%20configure%3C%2FA%3E%20command.%3C%2FP%3E%0A%3CH2%20id%3D%22toc-hId-60059267%22%20id%3D%22toc-hId-86156183%22%20id%3D%22toc-hId-86156183%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22simplequery%22%20id%3D%22toc-hId-1802869602%22%20id%3D%22toc-hId-1828966518%22%20id%3D%22toc-hId-1828966518%22%3EAzure%20CLI%20query%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20start%2C%20lets%20return%20a%20single%20property%20of%20a%20single%20container%20instance%20using%20the%20%3CA%3Eaz%20container%20show%3C%2FA%3E%20command.%20In%20the%20following%20example%20notice%20that%20the%20%3CCODE%3E--query%3C%2FCODE%3E%20argument%20is%20called%20and%20that%20the%20%3CCODE%3Ename%3C%2FCODE%3E%20property%20is%20specified.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20show%20-n%20mycontainer0%20-g%20myResourceGroup%20--query%20name%20--output%20table%0A%0AResult%0A------------%0Amycontainer0%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20works%20great%20when%20returning%20a%20single%20result.%20If%20however%20we%20want%20to%20pull%20the%20names%20of%20all%20container%20instances%20using%20the%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fcontainer%3FWT.mc_id%3DITOpsTalk-blog-nepeters%26amp%3Bview%3Dazure-cli-latest%23az-container-list%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20az%20container%20list%3C%2FA%3E%20command%2C%20we%20need%20to%20use%20the%20%3CA%20href%3D%22http%3A%2F%2Fjmespath.org%2Fspecification.html%23flatten-operator%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJAMESPath%20flatten%20operator%3C%2FA%3E%26nbsp%3B%20%3CCODE%3E%5B%20%5D%3C%2FCODE%3E.%20In%20this%20example%20note%20that%20the%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fcli%2Fazure%2Fcontainer%3FWT.mc_id%3DITOpsTalk-blog-nepeters%26amp%3Bview%3Dazure-cli-latest%23az-container-list%22%20target%3D%22_self%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Eaz%20container%20list%3C%2FA%3E%20command%20is%20using%20%3CCODE%3E%5B%5D.name%3C%2FCODE%3E%20for%20the%20query%20value%2C%20which%20returns%20the%20names%20of%20all%20container%20instances.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%20--query%20%5B%5D.name%20--output%20table%0A%0AResult%0A------------%0Amycontainer0%0Amycontainer1%0Amycontainer2%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20wanted%20to%20return%20multiple%20properties%2C%20each%20of%20these%20can%20be%20comma%20delimited%20in%20square%20brackets.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%20--query%20%5B%5D.%5Bname%2Clocation%5D%20--output%20table%0A%0AColumn1%20%20%20%20%20%20%20Column2%0A------------%20%20---------%0Amycontainer0%20%20eastus%0Amycontainer1%20%20eastus%0Amycontainer2%20%20eastus%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20customize%20the%20column%20name%20we%20need%20to%20return%20a%20dictionary%20vs.%20an%20array%20using%20a%20%3CA%20href%3D%22http%3A%2F%2Fjmespath.org%2Fspecification.html%23multiselect-hash%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJAMESPath%20multiSelect%20hash%20operator%3C%2FA%3E%3CCODE%3E%7B%20%7D%3C%2FCODE%3E.%20Returning%20a%20dictionary%20allows%20the%20property%20key%20to%20be%20set%20as%20the%20column%20label.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETo%20achieve%20this%2C%20wrap%20the%20property%20selection%20in%20curly%20braces%20and%20name%20each%20property%20such%20as%20%3CCODE%3EKeyValue%3APropertyName%3C%2FCODE%3E.%20In%20the%20following%20example%20the%20key%20values%20are%20%3CCODE%3EName%3C%2FCODE%3E%20and%20%3CCODE%3ELocation%3C%2FCODE%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%20--query%20%22%5B%5D.%7BName%3Aname%2CLocation%3Alocation%7D%22%20--output%20table%0A%0AName%20%20%20%20%20%20%20%20%20%20Location%0A------------%20%20----------%0Amycontainer0%20%20eastus%0Amycontainer1%20%20eastus%0Amycontainer2%20%20eastus%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CH2%20id%3D%22simplequery%22%20id%3D%22toc-hId--749287359%22%20id%3D%22toc-hId--723190443%22%20id%3D%22toc-hId--723190443%22%3EReturn%20value%20by%20index%3C%2FH2%3E%0A%3CDIV%3E%3CBR%20%2F%3E%0A%3CDIV%3E%3CSPAN%3ENow%20let's%20say%20that%20you%20want%20to%20grab%20a%20specific%20object%20from%20an%20array%20by%20its%20index%20in%20that%20array.%20This%20can%20be%20done%20by%20specifying%20the%20index%20number%20in%20the%20square%20brackets.%20This%20can%20be%20helpful%20when%20looping%20through%20an%20array%20and%20performing%20an%20action%20on%20specific%20objects%20in%20that%20array.%20In%20the%20following%20example%2C%20the%20object%20at%20index%20%3C%2FSPAN%3E%3CSPAN%3E%3CCODE%3E2%3C%2FCODE%3E%3C%2FSPAN%3E%3CSPAN%3E%26nbsp%3Bis%20returned.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CPRE%3E%24%20az%20container%20list%20--query%20%5B2%5D.name%20--output%20table%0A%0AResult%0A------------%0Amycontainer2%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%3CSPAN%3EYou%20can%20also%20return%20a%20slice%20of%20indexes.%20In%20this%20example%20object%200%20%3CSTRONG%3Euntil%3C%2FSTRONG%3E%26nbsp%3B2%20are%20returned.%20In%20this%20case%200%20and%201%20are%20returned.%3C%2FSPAN%3E%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CPRE%3E%24%20az%20container%20list%20--query%20%5B0%3A2%5D.name%20--output%20table%0A%0AResult%0A------------%0Amycontainer0%0Amycontainer1%3C%2FPRE%3E%0A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3CDIV%3E%0A%3CH2%20id%3D%22simplequery%22%20id%3D%22toc-hId-993522976%22%20id%3D%22toc-hId-1019619892%22%20id%3D%22toc-hId-1019619892%22%3EFilter%20results%20on%20a%20value%3C%2FH2%3E%0A%3C%2FDIV%3E%0A%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3C%2FDIV%3E%0A%3CP%3EIn%20many%20cases%20we%20want%20to%20filter%20an%20array%20based%20on%20a%20value.%20This%20can%20be%20done%20using%20a%20%3CA%20href%3D%22https%3A%2F%2Fjmespath.readthedocs.io%2Fen%2Flatest%2Fproposals%2Ffilter-expressions.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJMESPath%20filter%20expression%3C%2FA%3E.%20In%20the%20following%20example%20only%20the%20container%20instances%20with%20a%20name%20containing%20%3CCODE%3Emycontainer2%3C%2FCODE%3E%20is%20returned.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%20--query%20%22%5B%3Fcontains(name%2C%20'mycontainer2')%5D%22%20--output%20table%0A%0AName%20%20%20%20%20%20%20%20%20%20Location%20%20%20%20ProvisioningState%20%20%20%20RestartPolicy%20%20%20%20OsType%20%20%20%20ResourceGroup%0A------------%20%20----------%20%20-------------------%20%20---------------%20%20--------%20%20---------------%0Amycontainer2%20%20eastus%20%20%20%20%20%20Succeeded%20%20%20%20%20%20%20%20%20%20%20%20Always%20%20%20%20%20%20%20%20%20%20%20Linux%20%20%20%20%20myResourceGroup%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CH2%20id%3D%22toc-hId--1558633985%22%20id%3D%22toc-hId--1532537069%22%20id%3D%22toc-hId--1532537069%22%3E%26nbsp%3B%3C%2FH2%3E%0A%3CH2%20id%3D%22final%22%20id%3D%22toc-hId-184176350%22%20id%3D%22toc-hId-210273266%22%20id%3D%22toc-hId-210273266%22%3EStore%20single%20property%20in%20a%20variable%3C%2FH2%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20let's%20put%20some%20of%20these%20concepts%20in%20play%20and%20find%20a%20specific%20container%20instances%20IP%20address%20and%20place%20that%20IP%20address%20into%20a%20variable.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWe%20will%20start%20by%20returning%20the%20IP%20address%20of%20a%20container%20instance%20with%20the%20name%20%3CCODE%3Emycontainer2%3C%2FCODE%3E.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%20--query%20%22%5B%3Fcontains(name%2C%20'mycontainer2')%5D.%5BipAddress.ip%5D%22%20--output%20table%0A%0AColumn1%0A--------------%0A52.188.216.148%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EHowever%20we%20only%20want%20the%20IP%20address%20and%20do%20not%20need%20the%20table%20formatting%20nor%20header.%20Instead%20of%20using%20table%20output%2C%20use%20tabbed%20separated%20values%2C%20or%20tsv.%20This%20returns%20only%20the%20IP%20address.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20az%20container%20list%20--query%20%22%5B%3Fcontains(name%2C%20'mycontainer2')%5D.%5BipAddress.ip%5D%22%20--output%20tsv%0A%0A52.188.216.148%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ENow%20update%20the%20command%20to%20place%20the%20results%20into%20a%20variable.%20The%20following%20example%20works%20in%20bash.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3E%24%20ip%3D%24(az%20container%20list%20--query%20%22%5B%3Fcontains(name%2C%20'mycontainer2')%5D.%5BipAddress.ip%5D%22%20--output%20tsv)%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20using%20PowerShell%2C%20the%20command%20would%20look%20similar%20to%20this.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3E%3CCODE%3EPS%20%24ip%20%3D%20%24(az%20container%20list%20--query%20%22%5B%3Fcontains(name%2C%20'mycontainer2')%5D.%5BipAddress.ip%5D%22%20--output%20tsv)%0A%3C%2FCODE%3E%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAt%20this%20point%2C%20if%20we%20were%20writing%20a%20script%20to%20say%20perform%20some%20action%20against%20the%20container%20instance%2C%20we%20could%20reference%20this%20variable%20when%20needing%20the%20IP%20address%20of%20the%20container%20instance.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-360147%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3EThe%20Azure%20CLI%20can%20be%20used%20to%20not%20only%20create%2C%20configure%2C%20and%20delete%20resources%20from%20Azure%20but%20to%20also%20query%20data%20from%20Azure.%20To%20do%20so%2C%20the%20Azure%20CLI%20uses%20the%20%3CCODE%20style%3D%22background-color%3A%20%23f9f2f4%3B%20border-bottom-left-radius%3A%204px%3B%20border-bottom-right-radius%3A%204px%3B%20border-top-left-radius%3A%204px%3B%20border-top-right-radius%3A%204px%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23c7254e%3B%20font-family%3A%20Menlo%2CMonaco%2CConsolas%2C%26amp%3Bquot%3B%20courier%20new%26amp%3Bquot%3B%2Cmonospace%3B%20font-size%3A%2090%25%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%20padding%3A%202px%204px%202px%204px%3B%22%3E--query%3C%2FCODE%3E%20argument%20to%20run%20a%20%3CA%20style%3D%22background-color%3A%20transparent%3B%20box-sizing%3A%20border-box%3B%20color%3A%20%23146cac%3B%20font-family%3A%20%26amp%3Bquot%3B%20segoeui%26amp%3Bquot%3B%2C%26amp%3Bquot%3Blato%26amp%3Bquot%3B%2C%26amp%3Bquot%3Bhelvetica%20neue%26amp%3Bquot%3B%2Chelvetica%2Carial%2Csans-serif%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20underline%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%20href%3D%22http%3A%2F%2Fjmespath.org%2Ftutorial.html%22%20target%3D%22_self%22%20rel%3D%22nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EJMESPath%3C%2FA%3E%20query%20against%20your%20Azure%20subscriptions.%20Querying%20Azure%20for%20resource%20properties%20can%20be%20quite%20helpful%20when%20writing%20scripts%20using%20the%20Azure%20CLI.%20For%20instance%2C%20you%20may%20want%20to%20get%20the%20IP%20address%20of%20an%20Azure%20Virtual%20Machine%20or%20Container%20Instance%20in%20order%20to%20perform%20some%20action%20on%20that%20resource.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%20style%3D%22display%3A%20inline%20!important%3B%20float%3A%20none%3B%20background-color%3A%20%23ffffff%3B%20color%3A%20%23333333%3B%20cursor%3A%20text%3B%20font-family%3A%20inherit%3B%20font-size%3A%2016px%3B%20font-style%3A%20normal%3B%20font-variant%3A%20normal%3B%20font-weight%3A%20300%3B%20letter-spacing%3A%20normal%3B%20line-height%3A%201.7142%3B%20orphans%3A%202%3B%20text-align%3A%20left%3B%20text-decoration%3A%20none%3B%20text-indent%3A%200px%3B%20text-transform%3A%20none%3B%20-webkit-text-stroke-width%3A%200px%3B%20white-space%3A%20normal%3B%20word-spacing%3A%200px%3B%22%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-center%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86026i8BDCCAB882562558%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20alt%3D%22Azure_CLI_101.png%22%20title%3D%22Azure_CLI_101.png%22%20%2F%3E%3CSPAN%20class%3D%22lia-inline-image-caption%22%20onclick%3D%22event.preventDefault()%3B%22%3EAzure%20CLI%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-360147%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAzure%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ENeil%20Peterson%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-393361%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20Azure%20resources%20using%20the%20Azure%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-393361%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Neil%2C%3C%2FP%3E%0A%3CP%3EI%20have%20few%20sample%20queries%20here%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fgithub.com%2Ftyconsulting%2FExpertsLiveUSA2019%2Fblob%2Fmaster%2FresourceGraph%2FDemoQuery.ps1%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fgithub.com%2Ftyconsulting%2FExpertsLiveUSA2019%2Fblob%2Fmaster%2FresourceGraph%2FDemoQuery.ps1%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EResource%20Graph%20uses%20aliases%20just%20like%20Azure%20Policy%20definition.%20so%20as%20long%20as%20there%20is%20an%20alias%20referencing%20the%20resource%20type%2C%20you%20can%20query%20it.%20you%20can%20retrieve%20the%20list%20of%20aliases%20using%20REST%20API%2C%20PowerShell%20or%20Azure%20CLI%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fgovernance%2Fpolicy%2Fconcepts%2Fdefinition-structure%23aliases%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fgovernance%2Fpolicy%2Fconcepts%2Fdefinition-structure%23aliases%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3Echeers%2C%3C%2FP%3E%0A%3CP%3ETao%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-393157%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20Azure%20resources%20using%20the%20Azure%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-393157%22%20slang%3D%22en-US%22%3E%3CP%3EThanks%2C%20Tao%20-%20for%20sure%20there%20are%20multiple%20ways%20to%20query%20resources.%20I%20have%20not%20used%20Resource%20Graph%20myself%20but%20know%20that%20it%20is%20very%20powerful%20and%20plan%20on%20taking%20some%20time%20to%20dig%20in.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EDo%20you%20have%20an%20example%20where%20Resource%20Graph%20is%20used%20inside%20of%20script%20for%20populating%20values%3F%20For%20example%2C%20can%20I%20do%20something%20like%20this%20with%20Resource%20Graph%3F%20This%20creates%20a%20container%20instance%2C%20queries%20the%20IP%20address%20of%20that%20resource%20and%20stores%20it%20in%20a%20variable.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3Eip%3D%24(az%20container%20create%20--name%20test555%20--resource-group%20myResourceGroup%20--image%20microsoft%2Faci-helloworld%20--ip-address%20Public%20--query%20ipAddress.ip%20--output%20tsv)%3C%2FPRE%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThanks%20a%20bunch%20for%20the%20comments.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-391398%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20Azure%20resources%20using%20the%20Azure%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-391398%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20Neil%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20think%20there%20is%20a%20better%20way%20when%20querying%20resources%20in%20your%20subscriptions%20-%20using%20Resource%20Graph%2C%20so%20you%20don't%20need%20to%20read%20via%20ARM%20resource%20providers%20and%20potentially%20hit%20the%20throttling%20limit%20in%20a%20large%20environment.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-364227%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20Azure%20resources%20using%20the%20Azure%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-364227%22%20slang%3D%22en-US%22%3E%3CP%3EOleg%2C%20thanks%20for%20the%20question.%20%5B0%3A2%5D%20returns%20two%20values%2C%200%20through%202%2C%20so%200%20and%201.%20So%20%5B1%3A2%5D%20would%20only%20return%20one%20item%2C%20mycontainer1%20in%20the%20case%20of%20these%20examples.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EI%20think%20the%20word%20'through'%20may%20be%20subjective%20here.%20I%20will%20update%20the%20blog%20for%20clarity.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-362564%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20Azure%20resources%20using%20the%20Azure%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-362564%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20a%20question%20about%3C%2FP%3E%3CPRE%3E--query%20%5B0%3A2%5D.name%20%3C%2FPRE%3E%3CP%3E%26nbsp%3BWould%20it%20also%20return%20the%20same%20container0%20and%201%20if%20you%20do%20%5B1%3A2%5D%3F%20Or%20is%20it%20just%20such%20format%20to%20always%20start%20with%200%2C%20but%20it%20returns%20only%202%20values%20if%202%20is%20the%20second%20number%3F%20But%20you%20said%20that%20it%20should%20return%20values%20from%200%20through%202%20and%20this%20would%20mean%200%2C%201%2C%202%20(3%20values%2C%20not%20two).%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-889366%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20query%20Azure%20resources%20using%20the%20Azure%20CLI%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-889366%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%2C%20i%20like%20to%20know%26nbsp%3B%20if%20that%20work%26nbsp%3B%3C%2FP%3E%3CPRE%3EPS%20%24ip%20%3D%20%24(az%20container%20list%20--query%20%22%5B%3Fcontains(name%2C%20'mycontainer2')%5D.%5BipAddress.ip%5D%22%20--output%20tsv)%26nbsp%3B%3C%2FPRE%3E%3CP%3EFor%20the%20command%20%3A%3C%2FP%3E%3CP%3EPS%20%24RepositoryTags%20%3D%20%24(az%20acr%20repository%20show-tags%20--name%20%24AzureRegistryName%20--repository%20%24RepositoryName%20--orderby%20time_desc%20--query%20%22%5B%3Fcontains(%40%2C'prod')%5D%22%20--output%20tsv).%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EBecause%20it's%20presente%20the%20next%20error%20%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDelete%20of%20repository%20STPC%3A%20C%3A%5CUsers%5COscarD%C3%ADaz%5CDesktop%26gt%3B%20%22C%3A%5CProgram%20Files%20(x86)%5CMicrosoft%20SDKs%5CAzure%5CCLI2%5Cwbin%5C%5C..%5Cpython.exe%22%20-IBm%20azure.cli%20acr%20repository%20show-tags%20--name%20testodiaz%20--repository%20recreacionyturismo%2Feventos%2Fcontent%20--query%20%5B%3Fcontains(%40%2C'prod')%5D%20--output%20tsv%3CBR%20%2F%3EChecking%20for%20repository%3A%20recreacionyturismo%2Feventos%2Ffront%3CBR%20%2F%3E%5D%20was%20unexpected%20at%20this%20time.%20in%20azure%20CLI%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Microsoft

TL/DR: The Azure CLI can be used to query data from Azure. For more information on how to use the Azure CLI query functionality, see the Azure CLI Query documentation.

 

The Azure CLI can be used to not only create, configure, and delete resources from Azure but to also query data from Azure. To do so, the Azure CLI uses the --query argument to run a JMESPath query against your Azure subscriptions. Querying Azure for resource properties can be quite helpful when writing scripts using the Azure CLI. For instance, you may want to get the IP address of an Azure Virtual Machine or Container Instance in order to perform some action on that resource.

 

This article includes a quick exercise that demonstrates several concepts with a final goal being to query a single resource property and storing the value of that property in a variable. This is demonstrated using Azure Container Instances (ACI). You do not need to have experience with ACI to complete the steps in this article, the concepts transfer to any Azure resource.

 

For quick access to the Azure CLI consider using the Azure Cloud Shell.

 

Create three Container Instances

 

Before digging into query syntax and operations, create a resource group using the az group create command and three container instances using the az container create command. The following bash script can be used to complete this.

 

# Create Resource Group
az group create --name myResourceGroup --location eastus

# Create three container instances
for ((i=0; i<3; ++i)); do az container create --resource-group myResourceGroup --name mycontainer$i --image microsoft/aci-helloworld --ip-address public; done

 

Output format

 

Before talking about the query command, lets discuss output format. By default, when any command is run using the Azure CLI, the output is returned JSON formatted. For example, run the az container list command. You should see that a JSON document is returned with the details of all container instances in your subscription.

 

$ az container list

 

While the JSON output is verbose, which is great, we may want to format the output a little more elegantly. We can do so by changing the output format. This article will focus on table and tsv format. For a complete list of Azure CLI output formats and a explanation of each, see Output format for Azure CLI commands.

 

Change the output type using the --output argument. In the following example the output type of table is used. You can see that while the output is not quite as verbose, it is easier to parse.

 

$ az container list --output table

Name          ResourceGroup    Status     Image                     IP:ports           Network    CPU/Memory       OsType    Location
------------  ---------------  ---------  ------------------------  -----------------  ---------  ---------------  --------  ----------
mycontainer0  myResourceGroup  Succeeded  microsoft/aci-helloworld  20.42.27.240:80    Public     1.0 core/1.5 gb  Linux     eastus
mycontainer1  myResourceGroup  Succeeded  microsoft/aci-helloworld  104.45.170.149:80  Public     1.0 core/1.5 gb  Linux     eastus
mycontainer2  myResourceGroup  Succeeded  microsoft/aci-helloworld  52.188.216.148:80  Public     1.0 core/1.5 gb  Linux     eastus

 

You can change the default output format for the CLI with the az configure command.

 

Azure CLI query

 

To start, lets return a single property of a single container instance using the az container show command. In the following example notice that the --query argument is called and that the name property is specified.

 

$ az container show -n mycontainer0 -g myResourceGroup --query name --output table

Result
------------
mycontainer0

 

This works great when returning a single result. If however we want to pull the names of all container instances using the az container list command, we need to use the JAMESPath flatten operator  [ ]. In this example note that the az container list command is using [].name for the query value, which returns the names of all container instances.

 

$ az container list --query [].name --output table

Result
------------
mycontainer0
mycontainer1
mycontainer2

 

If you wanted to return multiple properties, each of these can be comma delimited in square brackets.

 

$ az container list --query [].[name,location] --output table

Column1       Column2
------------  ---------
mycontainer0  eastus
mycontainer1  eastus
mycontainer2  eastus

 

To customize the column name we need to return a dictionary vs. an array using a JAMESPath multiSelect hash operator{ }. Returning a dictionary allows the property key to be set as the column label.

 

To achieve this, wrap the property selection in curly braces and name each property such as KeyValue:PropertyName. In the following example the key values are Name and Location.

 

$ az container list --query "[].{Name:name,Location:location}" --output table

Name          Location
------------  ----------
mycontainer0  eastus
mycontainer1  eastus
mycontainer2  eastus

 

Return value by index


Now let's say that you want to grab a specific object from an array by its index in that array. This can be done by specifying the index number in the square brackets. This can be helpful when looping through an array and performing an action on specific objects in that array. In the following example, the object at index 2 is returned.
 
$ az container list --query [2].name --output table

Result
------------
mycontainer2
 
You can also return a slice of indexes. In this example object 0 until 2 are returned. In this case 0 and 1 are returned.
 
$ az container list --query [0:2].name --output table

Result
------------
mycontainer0
mycontainer1
 

Filter results on a value

 

In many cases we want to filter an array based on a value. This can be done using a JMESPath filter expression. In the following example only the container instances with a name containing mycontainer2 is returned.

 

$ az container list --query "[?contains(name, 'mycontainer2')]" --output table

Name          Location    ProvisioningState    RestartPolicy    OsType    ResourceGroup
------------  ----------  -------------------  ---------------  --------  ---------------
mycontainer2  eastus      Succeeded            Always           Linux     myResourceGroup

 

Store single property in a variable

 

Now let's put some of these concepts in play and find a specific container instances IP address and place that IP address into a variable.

 

We will start by returning the IP address of a container instance with the name mycontainer2.

 

$ az container list --query "[?contains(name, 'mycontainer2')].[ipAddress.ip]" --output table

Column1
--------------
52.188.216.148

 

However we only want the IP address and do not need the table formatting nor header. Instead of using table output, use tabbed separated values, or tsv. This returns only the IP address.

 

$ az container list --query "[?contains(name, 'mycontainer2')].[ipAddress.ip]" --output tsv

52.188.216.148

 

Now update the command to place the results into a variable. The following example works in bash.

 

$ ip=$(az container list --query "[?contains(name, 'mycontainer2')].[ipAddress.ip]" --output tsv)

 

If using PowerShell, the command would look similar to this.

 

PS $ip = $(az container list --query "[?contains(name, 'mycontainer2')].[ipAddress.ip]" --output tsv)

 

At this point, if we were writing a script to say perform some action against the container instance, we could reference this variable when needing the IP address of the container instance.

6 Comments
Super Contributor

I have a question about

--query [0:2].name 

 Would it also return the same container0 and 1 if you do [1:2]? Or is it just such format to always start with 0, but it returns only 2 values if 2 is the second number? But you said that it should return values from 0 through 2 and this would mean 0, 1, 2 (3 values, not two).

Microsoft

Oleg, thanks for the question. [0:2] returns two values, 0 through 2, so 0 and 1. So [1:2] would only return one item, mycontainer1 in the case of these examples.

 

I think the word 'through' may be subjective here. I will update the blog for clarity.

Hi Neil,

 

I think there is a better way when querying resources in your subscriptions - using Resource Graph, so you don't need to read via ARM resource providers and potentially hit the throttling limit in a large environment.

Microsoft

Thanks, Tao - for sure there are multiple ways to query resources. I have not used Resource Graph myself but know that it is very powerful and plan on taking some time to dig in.

 

Do you have an example where Resource Graph is used inside of script for populating values? For example, can I do something like this with Resource Graph? This creates a container instance, queries the IP address of that resource and stores it in a variable.

 

ip=$(az container create --name test555 --resource-group myResourceGroup --image microsoft/aci-helloworld --ip-address Public --query ipAddress.ip --output tsv)

 

Thanks a bunch for the comments.

Hi Neil,

I have few sample queries here: https://github.com/tyconsulting/ExpertsLiveUSA2019/blob/master/resourceGraph/DemoQuery.ps1

 

Resource Graph uses aliases just like Azure Policy definition. so as long as there is an alias referencing the resource type, you can query it. you can retrieve the list of aliases using REST API, PowerShell or Azure CLI: https://docs.microsoft.com/en-us/azure/governance/policy/concepts/definition-structure#aliases

 

cheers,

Tao

Occasional Visitor

Hi , i like to know  if that work 

PS $ip = $(az container list --query "[?contains(name, 'mycontainer2')].[ipAddress.ip]" --output tsv) 

For the command :

PS $RepositoryTags = $(az acr repository show-tags --name $AzureRegistryName --repository $RepositoryName --orderby time_desc --query "[?contains(@,'prod')]" --output tsv).

 

Because it's presente the next error :

 

Delete of repository STPC: C:\Users\OscarDíaz\Desktop> "C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\wbin\\..\python.exe" -IBm azure.cli acr repository show-tags --name testodiaz --repository recreacionyturismo/eventos/content --query [?contains(@,'prod')] --output tsv
Checking for repository: recreacionyturismo/eventos/front
] was unexpected at this time. in azure CLI