[{"data":1,"prerenderedAt":2841},["Reactive",2],{"navigation":3,"/posts/welcome-azure-cli":204,"/posts/welcome-azure-cli-surround":2813},[4,192,200],{"title":5,"_path":6,"children":7,"icon":191},"Blog","/posts",[8,11,14,17,20,23,26,29,32,35,38,41,44,47,50,53,56,59,62,65,68,71,74,77,80,83,86,89,92,95,98,101,104,107,110,113,116,119,122,125,128,131,134,137,140,143,146,149,152,155,158,161,164,167,170,173,176,179,182,185,188],{"title":9,"_path":10},"Testing your API with REST Client","/posts/testing-your-api-with-rest-client",{"title":12,"_path":13},"HTML templating in Xamarin","/posts/html-templating-in-xamarin",{"title":15,"_path":16},"Goodbye Azure Portal, Welcome Azure CLI","/posts/welcome-azure-cli",{"title":18,"_path":19},"Coming across Gitpod","/posts/gitpod",{"title":21,"_path":22},"Handle token retrieval while querying an API","/posts/delegating-handler",{"title":24,"_path":25},"Clean up your local git branches.","/posts/cleaning-git-branches",{"title":27,"_path":28},"Automate configuration of Teams Tab SSO with PowerShell.","/posts/teams-sso-powershell",{"title":30,"_path":31},"How to do a technology watch? - Part 1","/posts/technology-watch-part1",{"title":33,"_path":34},"How to do a technology watch? - Part 2","/posts/technology-watch-part2",{"title":36,"_path":37},"You almost no longer need Key Vault references for Azure Functions.","/posts/azure-functions-custom-configuration",{"title":39,"_path":40},"How to do a technology watch? - Part 3","/posts/technology-watch-part3",{"title":42,"_path":43},"Forget DevOps, the future is already here!","/posts/devops-future",{"title":45,"_path":46},"Week 9, 2021 - Tips I learned this week","/posts/w09-2021-tips-learned-this-week",{"title":48,"_path":49},"Week 12, 2021 - Tips I learned this week","/posts/w12-2021-tips-learned-this-week",{"title":51,"_path":52},"Week 14, 2021 - Tips I learned this week","/posts/w14-2021-tips-learned-this-week",{"title":54,"_path":55},"Once upon a time in .NET","/posts/once-upon-a-time-in-dotnet",{"title":57,"_path":58},"Install your applications with winget","/posts/winget-import",{"title":60,"_path":61},"Customize your applications when installing them with winget","/posts/winget-override",{"title":63,"_path":64},"Week 22, 2021 - Tips I learned this week","/posts/w22-2021-tips-learned-this-week",{"title":66,"_path":67},"How to connect to an Azure SQL Database from C# using Azure AD","/posts/sqlclient-active-directory-authent",{"title":69,"_path":70},"Producing packages for Windows Package Manager","/posts/wingetcreate",{"title":72,"_path":73},"4 tips about GitHub Actions environment variables and contexts","/posts/github-actions-var-and-context",{"title":75,"_path":76},"AzureWebJobsStorage, the secret you don't need in your Function App.","/posts/azure-functions-without-azurewebjobsstorage",{"title":78,"_path":79},"ASP.NET Core - Lost in configuration","/posts/lost-in-configuration",{"title":81,"_path":82},"Week 39, 2021 - Tips I learned this week","/posts/w39-2021-tips-learned-this-week",{"title":84,"_path":85},"Week 41, 2021 - Tips I learned this week","/posts/w41-2021-tips-learned-this-week",{"title":87,"_path":88},"Migrating and open-sourcing my blog","/posts/migrating-blog",{"title":90,"_path":91},"Week 45, 2021 - Tips I learned this week","/posts/w45-2021-tips-learned-this-week",{"title":93,"_path":94},"Organize your GitHub stars with Astral","/posts/astral",{"title":96,"_path":97},"Pulumi with an Azure Blob Storage backend","/posts/pulumi-azure-backend",{"title":99,"_path":100},"IaC Hot Reload with Pulumi Watch","/posts/pulumi-watch",{"title":102,"_path":103},"Week 2, 2022 - Tips I learned this week","/posts/w02-2022-tips-learned-this-week",{"title":105,"_path":106},"Week 3, 2022 - Tips I learned this week","/posts/w03-2022-tips-learned-this-week",{"title":108,"_path":109},"Week 5, 2022 - Tips I learned this week","/posts/w05-2022-tips-learned-this-week",{"title":111,"_path":112},"How to provision an Azure SQL Database with Active Directory authentication","/posts/sqldatabase-active-directory-authent",{"title":114,"_path":115},"Why will I choose Pulumi over Terraform for my next project?","/posts/pulumi-vs-terraform",{"title":117,"_path":118},"Week 19, 2022 - Tips I learned this week","/posts/w19-2022-tips-learned-this-week",{"title":120,"_path":121},"Week 20, 2022 - Tips I learned this week","/posts/w20-2022-tips-learned-this-week",{"title":123,"_path":124},"Keeping secrets secure when using API Clients","/posts/http-clients-secrets",{"title":126,"_path":127},"What made me want to be a developer?","/posts/be-a-developer",{"title":129,"_path":130},"What can we do when stuck with a programming problem?","/posts/get-unstuck",{"title":132,"_path":133},"How did I automate the setup of my developer Windows laptop?","/posts/automate-developer-machine",{"title":135,"_path":136},"Discussion about API clients","/posts/http-clients",{"title":138,"_path":139},"Week 46, 2022 - Tips I learned this week","/posts/w46-2022-tips-learned-this-week",{"title":141,"_path":142},"When Pulumi met Nuke: a .NET love story","/posts/when-pulumi-met-nuke",{"title":144,"_path":145},"A year of learning and sharing - Dev Retro 2022","/posts/2022-retro",{"title":147,"_path":148},"Perform Dynamic Execution of an npm Package","/posts/pnpm-dlx",{"title":150,"_path":151},"Manage multiple Node.js versions","/posts/pnpm-env",{"title":153,"_path":154},"Introducing the Vue.js CI/CD series","/posts/vuecicd-introduction",{"title":156,"_path":157},"Execute commands using your project dependencies","/posts/pnpm-exec",{"title":159,"_path":160},"Vue.js CI/CD: Continuous Integration","/posts/vuecicd-ci",{"title":162,"_path":163},"Who is using pnpm?","/posts/pnpm-who-is-using",{"title":165,"_path":166},"Create an Azure-Ready GitHub Repository using Pulumi","/posts/azure-ready-github-repository",{"title":168,"_path":169},"Deploying to Azure from Azure DevOps without secrets","/posts/ado-workload-identity-federation",{"title":171,"_path":172},"Effortlessly Configure GitHub Repositories for Azure Deployment via OIDC","/posts/scripting-azure-ready-github-repository",{"title":174,"_path":175},"Playing with the .NET 8 Web API template","/posts/playing-with-dotnet8",{"title":177,"_path":178},"Another year of sharing and learning - Dev Retro 2023","/posts/2023-retro",{"title":180,"_path":181},"Week 4, 2024 - Tips I learned this week","/posts/w04-2024-tips-learned-this-week",{"title":183,"_path":184},"Using dependency injection with Azure .NET SDK","/posts/azure-sdk-di",{"title":186,"_path":187},"Having Fun With IT Event Calendars","/posts/it-event-calendars",{"title":189,"_path":190},"Call your Azure AD B2C protected API with authenticated HTTP requests from your JetBrains IDE","/posts/http-clients-oauth2","i-heroicons-newspaper",{"title":193,"_path":194,"children":195,"icon":199},"Goodies","/goodies",[196],{"title":197,"_path":198},"My Git Cheat Sheet","/goodies/gitcheatsheet","i-heroicons-gift-solid",{"title":201,"_path":202,"icon":203},"About","/about","i-heroicons-user-circle-solid",{"_path":16,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":15,"description":208,"lead":209,"date":210,"image":211,"badge":213,"tags":215,"body":219,"_type":2808,"_id":2809,"_source":2810,"_file":2811,"_extension":2812},"posts",false,"","Let's jum into Azure CLI to manage Azure resources. The article will show the syntax, the main functionalities and some less-known features like Azure CLI interactive mode.","Let's jump into Azure CLI!","2019-04-08T00:00:00.000Z",{"src":212},"/images/green-characters.jpg",{"label":214},"Tooling",[216,217,218],"Azure CLI","Azure","shell",{"type":220,"children":221,"toc":2791},"root",[222,230,281,296,303,334,346,351,356,362,376,381,418,454,466,509,536,556,565,577,583,590,599,627,636,654,660,665,674,980,986,999,1012,1025,2049,2054,2068,2078,2092,2101,2115,2124,2140,2146,2151,2156,2443,2448,2454,2459,2465,2470,2475,2498,2504,2509,2518,2531,2540,2545,2554,2560,2573,2578,2587,2600,2609,2614,2627,2633,2638,2651,2660,2694,2703,2722,2731,2736,2752,2769,2775,2780,2785],{"type":223,"tag":224,"props":225,"children":226},"element","p",{},[227],{"type":228,"value":229},"text","In this article about Azure CLI, we will talk about:",{"type":223,"tag":231,"props":232,"children":233},"ul",{},[234,245,254,263,272],{"type":223,"tag":235,"props":236,"children":237},"li",{},[238],{"type":223,"tag":239,"props":240,"children":242},"a",{"href":241},"#_1-managing-azure-resources",[243],{"type":228,"value":244},"Managing Azure resources",{"type":223,"tag":235,"props":246,"children":247},{},[248],{"type":223,"tag":239,"props":249,"children":251},{"href":250},"#_2-azure-cli-syntax",[252],{"type":228,"value":253},"Azure CLI Syntax",{"type":223,"tag":235,"props":255,"children":256},{},[257],{"type":223,"tag":239,"props":258,"children":260},{"href":259},"#_3-deep-dive-in-azure-cli",[261],{"type":228,"value":262},"Deep dive in Azure CLI",{"type":223,"tag":235,"props":264,"children":265},{},[266],{"type":223,"tag":239,"props":267,"children":269},{"href":268},"#_4-where-to-use-azure-cli",[270],{"type":228,"value":271},"Where to use Azure CLI",{"type":223,"tag":235,"props":273,"children":274},{},[275],{"type":223,"tag":239,"props":276,"children":278},{"href":277},"#_5-azure-cli-interactive-mode",[279],{"type":228,"value":280},"Azure CLI Interactive mode",{"type":223,"tag":224,"props":282,"children":283},{},[284,286,294],{"type":228,"value":285},"Azure CLI can be installed by following the instructions on ",{"type":223,"tag":239,"props":287,"children":291},{"href":288,"rel":289},"https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest",[290],"nofollow",[292],{"type":228,"value":293},"this page",{"type":228,"value":295},".",{"type":223,"tag":297,"props":298,"children":300},"h2",{"id":299},"_1-managing-azure-resources",[301],{"type":228,"value":302},"1 - Managing Azure resources",{"type":223,"tag":224,"props":304,"children":305},{},[306,308,315,317,324,326,332],{"type":228,"value":307},"Azure resources can be managed in different ways but the main ones are the ",{"type":223,"tag":239,"props":309,"children":312},{"href":310,"rel":311},"https://portal.azure.com",[290],[313],{"type":228,"value":314},"Azure Portal",{"type":228,"value":316},", ",{"type":223,"tag":239,"props":318,"children":321},{"href":319,"rel":320},"https://docs.microsoft.com/en-us/powershell/azure/",[290],[322],{"type":228,"value":323},"Azure PowerShell",{"type":228,"value":325},", and ",{"type":223,"tag":239,"props":327,"children":330},{"href":328,"rel":329},"https://docs.microsoft.com/en-us/cli/azure",[290],[331],{"type":228,"value":216},{"type":228,"value":333},". If you are new to Azure or if you are creating resources you are not familiar with, it is always nice to have a GUI to understand what you are doing and Azure Portal is the right way to go.",{"type":223,"tag":224,"props":335,"children":336},{},[337],{"type":223,"tag":338,"props":339,"children":345},"img",{"alt":340,"className":341,"src":344},"Azure portal home",[342,343],"rounded-lg","mx-auto","/posts/images/azurecli_portal_1.png",[],{"type":223,"tag":224,"props":347,"children":348},{},[349],{"type":228,"value":350},"However, handling resources in the portal, moving from pane to pane to always do the same kind of operations can quickly become a little cumbersome. So if you want to be more productive or if you are more of a command line person, you will find in Azure CLI or Azure PowerShell really good alternatives to Azure Portal. Both of them are cross-platform tools (PowerShell Core runs on Windows, macOS, and Linux 😀) and provide the same functionalities to manage Azure resources.",{"type":223,"tag":224,"props":352,"children":353},{},[354],{"type":228,"value":355},"Until recently, when I was not using the Azure Portal I was more prompt to use Azure PowerShell than Azure CLI, probably because I was often finding samples of what I wanted to do written in PowerShell. But in fact, there are lots of commands in Azure PowerShell and even with autocomplete I am not good at remembering them. So I couldn't stop returning to using Azure Portal 😕. And yet, lately, I finally came back to the command line when I started to discover the power of Azure CLI: such a nice and above all easy tool to use and that's what I will try to show you next.",{"type":223,"tag":297,"props":357,"children":359},{"id":358},"_2-azure-cli-syntax",[360],{"type":228,"value":361},"2 - Azure CLI Syntax",{"type":223,"tag":224,"props":363,"children":364},{},[365,367,374],{"type":228,"value":366},"The Azure CLI Syntax is simple to understand. For instance, the command ",{"type":223,"tag":368,"props":369,"children":371},"code",{"className":370},[],[372],{"type":228,"value":373},"az webapp list",{"type":228,"value":375}," will list the WebApps in the subscription you are currently logged in.",{"type":223,"tag":224,"props":377,"children":378},{},[379],{"type":228,"value":380},"An Azure CLI command has the following structure:",{"type":223,"tag":231,"props":382,"children":383},{},[384,397,408],{"type":223,"tag":235,"props":385,"children":386},{},[387,389,395],{"type":228,"value":388},"a ",{"type":223,"tag":390,"props":391,"children":392},"strong",{},[393],{"type":228,"value":394},"command group",{"type":228,"value":396}," that represents an Azure service and which can be the composition of subgroups",{"type":223,"tag":235,"props":398,"children":399},{},[400,401,406],{"type":228,"value":388},{"type":223,"tag":390,"props":402,"children":403},{},[404],{"type":228,"value":405},"command",{"type":228,"value":407}," which is the action you want to do on the group / Azure service",{"type":223,"tag":235,"props":409,"children":410},{},[411,416],{"type":223,"tag":390,"props":412,"children":413},{},[414],{"type":228,"value":415},"arguments",{"type":228,"value":417}," optionally which are a list of parameter names and values",{"type":223,"tag":224,"props":419,"children":420},{},[421,423,429,431,437,439,445,447,452],{"type":228,"value":422},"To sign in to your Azure account in your terminal, you have to execute the Azure CLI command ",{"type":223,"tag":368,"props":424,"children":426},{"className":425},[],[427],{"type":228,"value":428},"az login",{"type":228,"value":430}," where ",{"type":223,"tag":368,"props":432,"children":434},{"className":433},[],[435],{"type":228,"value":436},"az",{"type":228,"value":438}," is the command group and ",{"type":223,"tag":368,"props":440,"children":442},{"className":441},[],[443],{"type":228,"value":444},"login",{"type":228,"value":446}," is the command relative to the group/service ",{"type":223,"tag":368,"props":448,"children":450},{"className":449},[],[451],{"type":228,"value":436},{"type":228,"value":453}," (meaning Azure).",{"type":223,"tag":224,"props":455,"children":456},{},[457,459,464],{"type":228,"value":458},"In our previous example, ",{"type":223,"tag":368,"props":460,"children":462},{"className":461},[],[463],{"type":228,"value":373},{"type":228,"value":465}," :",{"type":223,"tag":231,"props":467,"children":468},{},[469,493,504],{"type":223,"tag":235,"props":470,"children":471},{},[472,478,480,485,487],{"type":223,"tag":368,"props":473,"children":475},{"className":474},[],[476],{"type":228,"value":477},"az webapp",{"type":228,"value":479}," was the command group composed of ",{"type":223,"tag":368,"props":481,"children":483},{"className":482},[],[484],{"type":228,"value":436},{"type":228,"value":486}," and its subgroup ",{"type":223,"tag":368,"props":488,"children":490},{"className":489},[],[491],{"type":228,"value":492},"webapp",{"type":223,"tag":235,"props":494,"children":495},{},[496,502],{"type":223,"tag":368,"props":497,"children":499},{"className":498},[],[500],{"type":228,"value":501},"list",{"type":228,"value":503}," was the command",{"type":223,"tag":235,"props":505,"children":506},{},[507],{"type":228,"value":508},"no arguments here",{"type":223,"tag":224,"props":510,"children":511},{},[512,514,520,522,528,530],{"type":228,"value":513},"We could have added some arguments to this command, like the ",{"type":223,"tag":368,"props":515,"children":517},{"className":516},[],[518],{"type":228,"value":519},"--resource-group",{"type":228,"value":521}," argument (or ",{"type":223,"tag":368,"props":523,"children":525},{"className":524},[],[526],{"type":228,"value":527},"-g",{"type":228,"value":529},") to list only the WebApps in a specific resource group and that would have become ",{"type":223,"tag":368,"props":531,"children":533},{"className":532},[],[534],{"type":228,"value":535},"az webapp list --resource-group 'myResourceGroupName'",{"type":223,"tag":224,"props":537,"children":538},{},[539,541,547,549,554],{"type":228,"value":540},"A few arguments are globally available arguments which means that can be used for every command. This is the case of the ",{"type":223,"tag":368,"props":542,"children":544},{"className":543},[],[545],{"type":228,"value":546},"--help",{"type":228,"value":548}," argument which displays help information about a command. The following example showing the use of the ",{"type":223,"tag":368,"props":550,"children":552},{"className":551},[],[553],{"type":228,"value":546},{"type":228,"value":555}," argument allows us to better understand the structure of an Azure CLI command.",{"type":223,"tag":224,"props":557,"children":558},{},[559],{"type":223,"tag":338,"props":560,"children":564},{"alt":561,"className":562,"src":563},"Azure CLI Help output.",[342,343],"/posts/images/azurecli_console_1.png",[],{"type":223,"tag":224,"props":566,"children":567},{},[568,570,575],{"type":228,"value":569},"Once used to the Azure CLI syntax, it is way more convenient than the Azure Portal and you don't have to search what Azure PowerShell command you need to use. You just have to look for the available subgroups and commands in the Azure service where you want to work (don't forget to use ",{"type":223,"tag":368,"props":571,"children":573},{"className":572},[],[574],{"type":228,"value":546},{"type":228,"value":576},") and you will quickly get the job done.",{"type":223,"tag":297,"props":578,"children":580},{"id":579},"_3-deep-dive-in-azure-cli",[581],{"type":228,"value":582},"3 - Deep dive in Azure CLI",{"type":223,"tag":584,"props":585,"children":587},"h3",{"id":586},"command-output",[588],{"type":228,"value":589},"Command output",{"type":223,"tag":224,"props":591,"children":592},{},[593],{"type":223,"tag":338,"props":594,"children":598},{"alt":595,"className":596,"src":597},"Azure CLI command outputs.",[342,343],"/posts/images/azurecli_console_2.png",[],{"type":223,"tag":224,"props":600,"children":601},{},[602,604,610,612,618,620,626],{"type":228,"value":603},"By default, the output format of Azure CLI commands is JSON but there are other formats you can use by specifying an output argument (",{"type":223,"tag":368,"props":605,"children":607},{"className":606},[],[608],{"type":228,"value":609},"--output",{"type":228,"value":611}," or ",{"type":223,"tag":368,"props":613,"children":615},{"className":614},[],[616],{"type":228,"value":617},"-o",{"type":228,"value":619},") like this: ",{"type":223,"tag":368,"props":621,"children":623},{"className":622},[],[624],{"type":228,"value":625},"az group list -o table",{"type":228,"value":295},{"type":223,"tag":224,"props":628,"children":629},{},[630],{"type":223,"tag":338,"props":631,"children":635},{"alt":632,"className":633,"src":634},"Azure CLI json and table outputs.",[342,343],"/posts/images/azurecli_console_3.png",[],{"type":223,"tag":637,"props":638,"children":640},"callout",{"icon":639},"i-fluent-emoji-flat-gem-stone",[641],{"type":223,"tag":224,"props":642,"children":643},{},[644,646,652],{"type":228,"value":645},"The default output format can be configured using the ",{"type":223,"tag":368,"props":647,"children":649},{"className":648},[],[650],{"type":228,"value":651},"az configure",{"type":228,"value":653}," command. This command also allows you to configure other settings like a default resource group for your commands for instance.",{"type":223,"tag":584,"props":655,"children":657},{"id":656},"using-variables",[658],{"type":228,"value":659},"Using variables",{"type":223,"tag":224,"props":661,"children":662},{},[663],{"type":228,"value":664},"Whether you choose to run your commands in Bash or PowerShell, you can use variables with Azure CLI, only the syntax for creating variables will change depending on the command-line shell you use.",{"type":223,"tag":637,"props":666,"children":668},{"icon":667},"i-heroicons-chat-bubble-left-20-solid",[669],{"type":223,"tag":224,"props":670,"children":671},{},[672],{"type":228,"value":673},"The samples in this article use the PowerShell syntax.",{"type":223,"tag":675,"props":676,"children":680},"pre",{"className":677,"code":678,"language":679,"meta":207,"style":207},"language-powershell shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","$rgName = 'TestingAzureCLI'\n\n# Create a new resource group\naz group create -n $rgName -l westeurope\n\n# Create an App Service plan with the Free tier\naz appservice plan create -n $webAppName -g $rgName --sku FREE\n\n# Show the App Service plan just created \naz appservice plan show -n $webAppName -g $rgName \n\n# Store the result of the show query in a PowerShell variable\n$servicePlan = az appservice plan show -n $webAppName -g $rgName \n","powershell",[681],{"type":223,"tag":368,"props":682,"children":683},{"__ignoreMap":207},[684,723,733,743,779,787,796,849,857,866,908,916,925],{"type":223,"tag":685,"props":686,"children":689},"span",{"class":687,"line":688},"line",1,[690,696,702,707,712,718],{"type":223,"tag":685,"props":691,"children":693},{"style":692},"--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF",[694],{"type":228,"value":695},"$",{"type":223,"tag":685,"props":697,"children":699},{"style":698},"--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8",[700],{"type":228,"value":701},"rgName ",{"type":223,"tag":685,"props":703,"children":704},{"style":692},[705],{"type":228,"value":706},"=",{"type":223,"tag":685,"props":708,"children":709},{"style":692},[710],{"type":228,"value":711}," '",{"type":223,"tag":685,"props":713,"children":715},{"style":714},"--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D",[716],{"type":228,"value":717},"TestingAzureCLI",{"type":223,"tag":685,"props":719,"children":720},{"style":692},[721],{"type":228,"value":722},"'\n",{"type":223,"tag":685,"props":724,"children":726},{"class":687,"line":725},2,[727],{"type":223,"tag":685,"props":728,"children":730},{"emptyLinePlaceholder":729},true,[731],{"type":228,"value":732},"\n",{"type":223,"tag":685,"props":734,"children":736},{"class":687,"line":735},3,[737],{"type":223,"tag":685,"props":738,"children":740},{"style":739},"--shiki-light:#90A4AE;--shiki-default:#546E7A;--shiki-dark:#676E95;--shiki-light-font-style:italic;--shiki-default-font-style:italic;--shiki-dark-font-style:italic",[741],{"type":228,"value":742},"# Create a new resource group\n",{"type":223,"tag":685,"props":744,"children":746},{"class":687,"line":745},4,[747,752,757,762,766,770,774],{"type":223,"tag":685,"props":748,"children":749},{"style":698},[750],{"type":228,"value":751},"az group create ",{"type":223,"tag":685,"props":753,"children":754},{"style":692},[755],{"type":228,"value":756},"-",{"type":223,"tag":685,"props":758,"children":759},{"style":698},[760],{"type":228,"value":761},"n ",{"type":223,"tag":685,"props":763,"children":764},{"style":692},[765],{"type":228,"value":695},{"type":223,"tag":685,"props":767,"children":768},{"style":698},[769],{"type":228,"value":701},{"type":223,"tag":685,"props":771,"children":772},{"style":692},[773],{"type":228,"value":756},{"type":223,"tag":685,"props":775,"children":776},{"style":698},[777],{"type":228,"value":778},"l westeurope\n",{"type":223,"tag":685,"props":780,"children":782},{"class":687,"line":781},5,[783],{"type":223,"tag":685,"props":784,"children":785},{"emptyLinePlaceholder":729},[786],{"type":228,"value":732},{"type":223,"tag":685,"props":788,"children":790},{"class":687,"line":789},6,[791],{"type":223,"tag":685,"props":792,"children":793},{"style":739},[794],{"type":228,"value":795},"# Create an App Service plan with the Free tier\n",{"type":223,"tag":685,"props":797,"children":799},{"class":687,"line":798},7,[800,805,809,813,817,822,826,831,835,839,844],{"type":223,"tag":685,"props":801,"children":802},{"style":698},[803],{"type":228,"value":804},"az appservice plan create ",{"type":223,"tag":685,"props":806,"children":807},{"style":692},[808],{"type":228,"value":756},{"type":223,"tag":685,"props":810,"children":811},{"style":698},[812],{"type":228,"value":761},{"type":223,"tag":685,"props":814,"children":815},{"style":692},[816],{"type":228,"value":695},{"type":223,"tag":685,"props":818,"children":819},{"style":698},[820],{"type":228,"value":821},"webAppName ",{"type":223,"tag":685,"props":823,"children":824},{"style":692},[825],{"type":228,"value":756},{"type":223,"tag":685,"props":827,"children":828},{"style":698},[829],{"type":228,"value":830},"g ",{"type":223,"tag":685,"props":832,"children":833},{"style":692},[834],{"type":228,"value":695},{"type":223,"tag":685,"props":836,"children":837},{"style":698},[838],{"type":228,"value":701},{"type":223,"tag":685,"props":840,"children":841},{"style":692},[842],{"type":228,"value":843},"--",{"type":223,"tag":685,"props":845,"children":846},{"style":698},[847],{"type":228,"value":848},"sku FREE\n",{"type":223,"tag":685,"props":850,"children":852},{"class":687,"line":851},8,[853],{"type":223,"tag":685,"props":854,"children":855},{"emptyLinePlaceholder":729},[856],{"type":228,"value":732},{"type":223,"tag":685,"props":858,"children":860},{"class":687,"line":859},9,[861],{"type":223,"tag":685,"props":862,"children":863},{"style":739},[864],{"type":228,"value":865},"# Show the App Service plan just created \n",{"type":223,"tag":685,"props":867,"children":869},{"class":687,"line":868},10,[870,875,879,883,887,891,895,899,903],{"type":223,"tag":685,"props":871,"children":872},{"style":698},[873],{"type":228,"value":874},"az appservice plan show ",{"type":223,"tag":685,"props":876,"children":877},{"style":692},[878],{"type":228,"value":756},{"type":223,"tag":685,"props":880,"children":881},{"style":698},[882],{"type":228,"value":761},{"type":223,"tag":685,"props":884,"children":885},{"style":692},[886],{"type":228,"value":695},{"type":223,"tag":685,"props":888,"children":889},{"style":698},[890],{"type":228,"value":821},{"type":223,"tag":685,"props":892,"children":893},{"style":692},[894],{"type":228,"value":756},{"type":223,"tag":685,"props":896,"children":897},{"style":698},[898],{"type":228,"value":830},{"type":223,"tag":685,"props":900,"children":901},{"style":692},[902],{"type":228,"value":695},{"type":223,"tag":685,"props":904,"children":905},{"style":698},[906],{"type":228,"value":907},"rgName \n",{"type":223,"tag":685,"props":909,"children":911},{"class":687,"line":910},11,[912],{"type":223,"tag":685,"props":913,"children":914},{"emptyLinePlaceholder":729},[915],{"type":228,"value":732},{"type":223,"tag":685,"props":917,"children":919},{"class":687,"line":918},12,[920],{"type":223,"tag":685,"props":921,"children":922},{"style":739},[923],{"type":228,"value":924},"# Store the result of the show query in a PowerShell variable\n",{"type":223,"tag":685,"props":926,"children":928},{"class":687,"line":927},13,[929,933,938,942,947,951,955,959,963,967,971,975],{"type":223,"tag":685,"props":930,"children":931},{"style":692},[932],{"type":228,"value":695},{"type":223,"tag":685,"props":934,"children":935},{"style":698},[936],{"type":228,"value":937},"servicePlan ",{"type":223,"tag":685,"props":939,"children":940},{"style":692},[941],{"type":228,"value":706},{"type":223,"tag":685,"props":943,"children":944},{"style":698},[945],{"type":228,"value":946}," az appservice plan show ",{"type":223,"tag":685,"props":948,"children":949},{"style":692},[950],{"type":228,"value":756},{"type":223,"tag":685,"props":952,"children":953},{"style":698},[954],{"type":228,"value":761},{"type":223,"tag":685,"props":956,"children":957},{"style":692},[958],{"type":228,"value":695},{"type":223,"tag":685,"props":960,"children":961},{"style":698},[962],{"type":228,"value":821},{"type":223,"tag":685,"props":964,"children":965},{"style":692},[966],{"type":228,"value":756},{"type":223,"tag":685,"props":968,"children":969},{"style":698},[970],{"type":228,"value":830},{"type":223,"tag":685,"props":972,"children":973},{"style":692},[974],{"type":228,"value":695},{"type":223,"tag":685,"props":976,"children":977},{"style":698},[978],{"type":228,"value":979},"rgName\n",{"type":223,"tag":584,"props":981,"children":983},{"id":982},"jmespath",[984],{"type":228,"value":985},"JMESPath",{"type":223,"tag":224,"props":987,"children":988},{},[989,991,997],{"type":228,"value":990},"If you don't know ",{"type":223,"tag":239,"props":992,"children":995},{"href":993,"rel":994},"http://jmespath.org/",[290],[996],{"type":228,"value":985},{"type":228,"value":998},", it is a query language for JSON that allows to extract and transform elements from a JSON document or CLI output in the context of Azure CLI.",{"type":223,"tag":224,"props":1000,"children":1001},{},[1002,1004,1010],{"type":228,"value":1003},"To use JMESPath you have to add in your CLI command the argument ",{"type":223,"tag":368,"props":1005,"children":1007},{"className":1006},[],[1008],{"type":228,"value":1009},"--query",{"type":228,"value":1011}," followed by your JMESPath query.\nLet's see that with some examples.",{"type":223,"tag":224,"props":1013,"children":1014},{},[1015,1017,1023],{"type":228,"value":1016},"The query ",{"type":223,"tag":368,"props":1018,"children":1020},{"className":1019},[],[1021],{"type":228,"value":1022},"az group list",{"type":228,"value":1024}," executed on my subscription returns the following JSON:",{"type":223,"tag":675,"props":1026,"children":1030},{"className":1027,"code":1028,"language":1029,"meta":207,"style":207},"language-json shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","[\n  {\n    \"id\": \"/subscriptions/********-****-****-****-************/resourceGroups/CloudShellRG\",\n    \"location\": \"westeurope\",\n    \"managedBy\": null,\n    \"name\": \"CloudShellRG\",\n    \"properties\": {\n      \"provisioningState\": \"Succeeded\"\n    },\n    \"tags\": {\n      \"Environment\": \"Production\"\n    },\n    \"type\": null\n  },\n  {\n    \"id\": \"/subscriptions/********-****-****-****-************/resourceGroups/MyApp1ResourceGroup\",\n    \"location\": \"canadacentral\",\n    \"managedBy\": null,\n    \"name\": \"MyApp1ResourceGroup\",\n    \"properties\": {\n      \"provisioningState\": \"Succeeded\"\n    },\n    \"tags\": {\n      \"Department\": \"RH\",\n      \"Environment\": \"Dev\"\n    },\n    \"type\": null\n  },\n  {\n    \"id\": \"/subscriptions/********-****-****-****-************/resourceGroups/TestingAzureCLI\",\n    \"location\": \"westeurope\",\n    \"managedBy\": null,\n    \"name\": \"TestingAzureCLI\",\n    \"properties\": {\n      \"provisioningState\": \"Succeeded\"\n    },\n    \"tags\": {\n      \"Department\": \"IT\",\n      \"Environment\": \"Production\"\n    },\n    \"type\": null\n  }\n]\n","json",[1031],{"type":223,"tag":368,"props":1032,"children":1033},{"__ignoreMap":207},[1034,1042,1050,1093,1130,1155,1192,1217,1253,1261,1285,1318,1325,1350,1359,1367,1404,1441,1465,1502,1526,1558,1566,1590,1628,1661,1669,1693,1701,1709,1746,1782,1806,1842,1866,1898,1906,1930,1967,1999,2007,2031,2040],{"type":223,"tag":685,"props":1035,"children":1036},{"class":687,"line":688},[1037],{"type":223,"tag":685,"props":1038,"children":1039},{"style":692},[1040],{"type":228,"value":1041},"[\n",{"type":223,"tag":685,"props":1043,"children":1044},{"class":687,"line":725},[1045],{"type":223,"tag":685,"props":1046,"children":1047},{"style":692},[1048],{"type":228,"value":1049},"  {\n",{"type":223,"tag":685,"props":1051,"children":1052},{"class":687,"line":735},[1053,1058,1064,1069,1074,1079,1084,1088],{"type":223,"tag":685,"props":1054,"children":1055},{"style":692},[1056],{"type":228,"value":1057},"    \"",{"type":223,"tag":685,"props":1059,"children":1061},{"style":1060},"--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA",[1062],{"type":228,"value":1063},"id",{"type":223,"tag":685,"props":1065,"children":1066},{"style":692},[1067],{"type":228,"value":1068},"\"",{"type":223,"tag":685,"props":1070,"children":1071},{"style":692},[1072],{"type":228,"value":1073},":",{"type":223,"tag":685,"props":1075,"children":1076},{"style":692},[1077],{"type":228,"value":1078}," \"",{"type":223,"tag":685,"props":1080,"children":1081},{"style":714},[1082],{"type":228,"value":1083},"/subscriptions/********-****-****-****-************/resourceGroups/CloudShellRG",{"type":223,"tag":685,"props":1085,"children":1086},{"style":692},[1087],{"type":228,"value":1068},{"type":223,"tag":685,"props":1089,"children":1090},{"style":692},[1091],{"type":228,"value":1092},",\n",{"type":223,"tag":685,"props":1094,"children":1095},{"class":687,"line":745},[1096,1100,1105,1109,1113,1117,1122,1126],{"type":223,"tag":685,"props":1097,"children":1098},{"style":692},[1099],{"type":228,"value":1057},{"type":223,"tag":685,"props":1101,"children":1102},{"style":1060},[1103],{"type":228,"value":1104},"location",{"type":223,"tag":685,"props":1106,"children":1107},{"style":692},[1108],{"type":228,"value":1068},{"type":223,"tag":685,"props":1110,"children":1111},{"style":692},[1112],{"type":228,"value":1073},{"type":223,"tag":685,"props":1114,"children":1115},{"style":692},[1116],{"type":228,"value":1078},{"type":223,"tag":685,"props":1118,"children":1119},{"style":714},[1120],{"type":228,"value":1121},"westeurope",{"type":223,"tag":685,"props":1123,"children":1124},{"style":692},[1125],{"type":228,"value":1068},{"type":223,"tag":685,"props":1127,"children":1128},{"style":692},[1129],{"type":228,"value":1092},{"type":223,"tag":685,"props":1131,"children":1132},{"class":687,"line":781},[1133,1137,1142,1146,1150],{"type":223,"tag":685,"props":1134,"children":1135},{"style":692},[1136],{"type":228,"value":1057},{"type":223,"tag":685,"props":1138,"children":1139},{"style":1060},[1140],{"type":228,"value":1141},"managedBy",{"type":223,"tag":685,"props":1143,"children":1144},{"style":692},[1145],{"type":228,"value":1068},{"type":223,"tag":685,"props":1147,"children":1148},{"style":692},[1149],{"type":228,"value":1073},{"type":223,"tag":685,"props":1151,"children":1152},{"style":692},[1153],{"type":228,"value":1154}," null,\n",{"type":223,"tag":685,"props":1156,"children":1157},{"class":687,"line":789},[1158,1162,1167,1171,1175,1179,1184,1188],{"type":223,"tag":685,"props":1159,"children":1160},{"style":692},[1161],{"type":228,"value":1057},{"type":223,"tag":685,"props":1163,"children":1164},{"style":1060},[1165],{"type":228,"value":1166},"name",{"type":223,"tag":685,"props":1168,"children":1169},{"style":692},[1170],{"type":228,"value":1068},{"type":223,"tag":685,"props":1172,"children":1173},{"style":692},[1174],{"type":228,"value":1073},{"type":223,"tag":685,"props":1176,"children":1177},{"style":692},[1178],{"type":228,"value":1078},{"type":223,"tag":685,"props":1180,"children":1181},{"style":714},[1182],{"type":228,"value":1183},"CloudShellRG",{"type":223,"tag":685,"props":1185,"children":1186},{"style":692},[1187],{"type":228,"value":1068},{"type":223,"tag":685,"props":1189,"children":1190},{"style":692},[1191],{"type":228,"value":1092},{"type":223,"tag":685,"props":1193,"children":1194},{"class":687,"line":798},[1195,1199,1204,1208,1212],{"type":223,"tag":685,"props":1196,"children":1197},{"style":692},[1198],{"type":228,"value":1057},{"type":223,"tag":685,"props":1200,"children":1201},{"style":1060},[1202],{"type":228,"value":1203},"properties",{"type":223,"tag":685,"props":1205,"children":1206},{"style":692},[1207],{"type":228,"value":1068},{"type":223,"tag":685,"props":1209,"children":1210},{"style":692},[1211],{"type":228,"value":1073},{"type":223,"tag":685,"props":1213,"children":1214},{"style":692},[1215],{"type":228,"value":1216}," {\n",{"type":223,"tag":685,"props":1218,"children":1219},{"class":687,"line":851},[1220,1225,1231,1235,1239,1243,1248],{"type":223,"tag":685,"props":1221,"children":1222},{"style":692},[1223],{"type":228,"value":1224},"      \"",{"type":223,"tag":685,"props":1226,"children":1228},{"style":1227},"--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B",[1229],{"type":228,"value":1230},"provisioningState",{"type":223,"tag":685,"props":1232,"children":1233},{"style":692},[1234],{"type":228,"value":1068},{"type":223,"tag":685,"props":1236,"children":1237},{"style":692},[1238],{"type":228,"value":1073},{"type":223,"tag":685,"props":1240,"children":1241},{"style":692},[1242],{"type":228,"value":1078},{"type":223,"tag":685,"props":1244,"children":1245},{"style":714},[1246],{"type":228,"value":1247},"Succeeded",{"type":223,"tag":685,"props":1249,"children":1250},{"style":692},[1251],{"type":228,"value":1252},"\"\n",{"type":223,"tag":685,"props":1254,"children":1255},{"class":687,"line":859},[1256],{"type":223,"tag":685,"props":1257,"children":1258},{"style":692},[1259],{"type":228,"value":1260},"    },\n",{"type":223,"tag":685,"props":1262,"children":1263},{"class":687,"line":868},[1264,1268,1273,1277,1281],{"type":223,"tag":685,"props":1265,"children":1266},{"style":692},[1267],{"type":228,"value":1057},{"type":223,"tag":685,"props":1269,"children":1270},{"style":1060},[1271],{"type":228,"value":1272},"tags",{"type":223,"tag":685,"props":1274,"children":1275},{"style":692},[1276],{"type":228,"value":1068},{"type":223,"tag":685,"props":1278,"children":1279},{"style":692},[1280],{"type":228,"value":1073},{"type":223,"tag":685,"props":1282,"children":1283},{"style":692},[1284],{"type":228,"value":1216},{"type":223,"tag":685,"props":1286,"children":1287},{"class":687,"line":910},[1288,1292,1297,1301,1305,1309,1314],{"type":223,"tag":685,"props":1289,"children":1290},{"style":692},[1291],{"type":228,"value":1224},{"type":223,"tag":685,"props":1293,"children":1294},{"style":1227},[1295],{"type":228,"value":1296},"Environment",{"type":223,"tag":685,"props":1298,"children":1299},{"style":692},[1300],{"type":228,"value":1068},{"type":223,"tag":685,"props":1302,"children":1303},{"style":692},[1304],{"type":228,"value":1073},{"type":223,"tag":685,"props":1306,"children":1307},{"style":692},[1308],{"type":228,"value":1078},{"type":223,"tag":685,"props":1310,"children":1311},{"style":714},[1312],{"type":228,"value":1313},"Production",{"type":223,"tag":685,"props":1315,"children":1316},{"style":692},[1317],{"type":228,"value":1252},{"type":223,"tag":685,"props":1319,"children":1320},{"class":687,"line":918},[1321],{"type":223,"tag":685,"props":1322,"children":1323},{"style":692},[1324],{"type":228,"value":1260},{"type":223,"tag":685,"props":1326,"children":1327},{"class":687,"line":927},[1328,1332,1337,1341,1345],{"type":223,"tag":685,"props":1329,"children":1330},{"style":692},[1331],{"type":228,"value":1057},{"type":223,"tag":685,"props":1333,"children":1334},{"style":1060},[1335],{"type":228,"value":1336},"type",{"type":223,"tag":685,"props":1338,"children":1339},{"style":692},[1340],{"type":228,"value":1068},{"type":223,"tag":685,"props":1342,"children":1343},{"style":692},[1344],{"type":228,"value":1073},{"type":223,"tag":685,"props":1346,"children":1347},{"style":692},[1348],{"type":228,"value":1349}," null\n",{"type":223,"tag":685,"props":1351,"children":1353},{"class":687,"line":1352},14,[1354],{"type":223,"tag":685,"props":1355,"children":1356},{"style":692},[1357],{"type":228,"value":1358},"  },\n",{"type":223,"tag":685,"props":1360,"children":1362},{"class":687,"line":1361},15,[1363],{"type":223,"tag":685,"props":1364,"children":1365},{"style":692},[1366],{"type":228,"value":1049},{"type":223,"tag":685,"props":1368,"children":1370},{"class":687,"line":1369},16,[1371,1375,1379,1383,1387,1391,1396,1400],{"type":223,"tag":685,"props":1372,"children":1373},{"style":692},[1374],{"type":228,"value":1057},{"type":223,"tag":685,"props":1376,"children":1377},{"style":1060},[1378],{"type":228,"value":1063},{"type":223,"tag":685,"props":1380,"children":1381},{"style":692},[1382],{"type":228,"value":1068},{"type":223,"tag":685,"props":1384,"children":1385},{"style":692},[1386],{"type":228,"value":1073},{"type":223,"tag":685,"props":1388,"children":1389},{"style":692},[1390],{"type":228,"value":1078},{"type":223,"tag":685,"props":1392,"children":1393},{"style":714},[1394],{"type":228,"value":1395},"/subscriptions/********-****-****-****-************/resourceGroups/MyApp1ResourceGroup",{"type":223,"tag":685,"props":1397,"children":1398},{"style":692},[1399],{"type":228,"value":1068},{"type":223,"tag":685,"props":1401,"children":1402},{"style":692},[1403],{"type":228,"value":1092},{"type":223,"tag":685,"props":1405,"children":1407},{"class":687,"line":1406},17,[1408,1412,1416,1420,1424,1428,1433,1437],{"type":223,"tag":685,"props":1409,"children":1410},{"style":692},[1411],{"type":228,"value":1057},{"type":223,"tag":685,"props":1413,"children":1414},{"style":1060},[1415],{"type":228,"value":1104},{"type":223,"tag":685,"props":1417,"children":1418},{"style":692},[1419],{"type":228,"value":1068},{"type":223,"tag":685,"props":1421,"children":1422},{"style":692},[1423],{"type":228,"value":1073},{"type":223,"tag":685,"props":1425,"children":1426},{"style":692},[1427],{"type":228,"value":1078},{"type":223,"tag":685,"props":1429,"children":1430},{"style":714},[1431],{"type":228,"value":1432},"canadacentral",{"type":223,"tag":685,"props":1434,"children":1435},{"style":692},[1436],{"type":228,"value":1068},{"type":223,"tag":685,"props":1438,"children":1439},{"style":692},[1440],{"type":228,"value":1092},{"type":223,"tag":685,"props":1442,"children":1444},{"class":687,"line":1443},18,[1445,1449,1453,1457,1461],{"type":223,"tag":685,"props":1446,"children":1447},{"style":692},[1448],{"type":228,"value":1057},{"type":223,"tag":685,"props":1450,"children":1451},{"style":1060},[1452],{"type":228,"value":1141},{"type":223,"tag":685,"props":1454,"children":1455},{"style":692},[1456],{"type":228,"value":1068},{"type":223,"tag":685,"props":1458,"children":1459},{"style":692},[1460],{"type":228,"value":1073},{"type":223,"tag":685,"props":1462,"children":1463},{"style":692},[1464],{"type":228,"value":1154},{"type":223,"tag":685,"props":1466,"children":1468},{"class":687,"line":1467},19,[1469,1473,1477,1481,1485,1489,1494,1498],{"type":223,"tag":685,"props":1470,"children":1471},{"style":692},[1472],{"type":228,"value":1057},{"type":223,"tag":685,"props":1474,"children":1475},{"style":1060},[1476],{"type":228,"value":1166},{"type":223,"tag":685,"props":1478,"children":1479},{"style":692},[1480],{"type":228,"value":1068},{"type":223,"tag":685,"props":1482,"children":1483},{"style":692},[1484],{"type":228,"value":1073},{"type":223,"tag":685,"props":1486,"children":1487},{"style":692},[1488],{"type":228,"value":1078},{"type":223,"tag":685,"props":1490,"children":1491},{"style":714},[1492],{"type":228,"value":1493},"MyApp1ResourceGroup",{"type":223,"tag":685,"props":1495,"children":1496},{"style":692},[1497],{"type":228,"value":1068},{"type":223,"tag":685,"props":1499,"children":1500},{"style":692},[1501],{"type":228,"value":1092},{"type":223,"tag":685,"props":1503,"children":1505},{"class":687,"line":1504},20,[1506,1510,1514,1518,1522],{"type":223,"tag":685,"props":1507,"children":1508},{"style":692},[1509],{"type":228,"value":1057},{"type":223,"tag":685,"props":1511,"children":1512},{"style":1060},[1513],{"type":228,"value":1203},{"type":223,"tag":685,"props":1515,"children":1516},{"style":692},[1517],{"type":228,"value":1068},{"type":223,"tag":685,"props":1519,"children":1520},{"style":692},[1521],{"type":228,"value":1073},{"type":223,"tag":685,"props":1523,"children":1524},{"style":692},[1525],{"type":228,"value":1216},{"type":223,"tag":685,"props":1527,"children":1529},{"class":687,"line":1528},21,[1530,1534,1538,1542,1546,1550,1554],{"type":223,"tag":685,"props":1531,"children":1532},{"style":692},[1533],{"type":228,"value":1224},{"type":223,"tag":685,"props":1535,"children":1536},{"style":1227},[1537],{"type":228,"value":1230},{"type":223,"tag":685,"props":1539,"children":1540},{"style":692},[1541],{"type":228,"value":1068},{"type":223,"tag":685,"props":1543,"children":1544},{"style":692},[1545],{"type":228,"value":1073},{"type":223,"tag":685,"props":1547,"children":1548},{"style":692},[1549],{"type":228,"value":1078},{"type":223,"tag":685,"props":1551,"children":1552},{"style":714},[1553],{"type":228,"value":1247},{"type":223,"tag":685,"props":1555,"children":1556},{"style":692},[1557],{"type":228,"value":1252},{"type":223,"tag":685,"props":1559,"children":1561},{"class":687,"line":1560},22,[1562],{"type":223,"tag":685,"props":1563,"children":1564},{"style":692},[1565],{"type":228,"value":1260},{"type":223,"tag":685,"props":1567,"children":1569},{"class":687,"line":1568},23,[1570,1574,1578,1582,1586],{"type":223,"tag":685,"props":1571,"children":1572},{"style":692},[1573],{"type":228,"value":1057},{"type":223,"tag":685,"props":1575,"children":1576},{"style":1060},[1577],{"type":228,"value":1272},{"type":223,"tag":685,"props":1579,"children":1580},{"style":692},[1581],{"type":228,"value":1068},{"type":223,"tag":685,"props":1583,"children":1584},{"style":692},[1585],{"type":228,"value":1073},{"type":223,"tag":685,"props":1587,"children":1588},{"style":692},[1589],{"type":228,"value":1216},{"type":223,"tag":685,"props":1591,"children":1593},{"class":687,"line":1592},24,[1594,1598,1603,1607,1611,1615,1620,1624],{"type":223,"tag":685,"props":1595,"children":1596},{"style":692},[1597],{"type":228,"value":1224},{"type":223,"tag":685,"props":1599,"children":1600},{"style":1227},[1601],{"type":228,"value":1602},"Department",{"type":223,"tag":685,"props":1604,"children":1605},{"style":692},[1606],{"type":228,"value":1068},{"type":223,"tag":685,"props":1608,"children":1609},{"style":692},[1610],{"type":228,"value":1073},{"type":223,"tag":685,"props":1612,"children":1613},{"style":692},[1614],{"type":228,"value":1078},{"type":223,"tag":685,"props":1616,"children":1617},{"style":714},[1618],{"type":228,"value":1619},"RH",{"type":223,"tag":685,"props":1621,"children":1622},{"style":692},[1623],{"type":228,"value":1068},{"type":223,"tag":685,"props":1625,"children":1626},{"style":692},[1627],{"type":228,"value":1092},{"type":223,"tag":685,"props":1629,"children":1631},{"class":687,"line":1630},25,[1632,1636,1640,1644,1648,1652,1657],{"type":223,"tag":685,"props":1633,"children":1634},{"style":692},[1635],{"type":228,"value":1224},{"type":223,"tag":685,"props":1637,"children":1638},{"style":1227},[1639],{"type":228,"value":1296},{"type":223,"tag":685,"props":1641,"children":1642},{"style":692},[1643],{"type":228,"value":1068},{"type":223,"tag":685,"props":1645,"children":1646},{"style":692},[1647],{"type":228,"value":1073},{"type":223,"tag":685,"props":1649,"children":1650},{"style":692},[1651],{"type":228,"value":1078},{"type":223,"tag":685,"props":1653,"children":1654},{"style":714},[1655],{"type":228,"value":1656},"Dev",{"type":223,"tag":685,"props":1658,"children":1659},{"style":692},[1660],{"type":228,"value":1252},{"type":223,"tag":685,"props":1662,"children":1664},{"class":687,"line":1663},26,[1665],{"type":223,"tag":685,"props":1666,"children":1667},{"style":692},[1668],{"type":228,"value":1260},{"type":223,"tag":685,"props":1670,"children":1672},{"class":687,"line":1671},27,[1673,1677,1681,1685,1689],{"type":223,"tag":685,"props":1674,"children":1675},{"style":692},[1676],{"type":228,"value":1057},{"type":223,"tag":685,"props":1678,"children":1679},{"style":1060},[1680],{"type":228,"value":1336},{"type":223,"tag":685,"props":1682,"children":1683},{"style":692},[1684],{"type":228,"value":1068},{"type":223,"tag":685,"props":1686,"children":1687},{"style":692},[1688],{"type":228,"value":1073},{"type":223,"tag":685,"props":1690,"children":1691},{"style":692},[1692],{"type":228,"value":1349},{"type":223,"tag":685,"props":1694,"children":1696},{"class":687,"line":1695},28,[1697],{"type":223,"tag":685,"props":1698,"children":1699},{"style":692},[1700],{"type":228,"value":1358},{"type":223,"tag":685,"props":1702,"children":1704},{"class":687,"line":1703},29,[1705],{"type":223,"tag":685,"props":1706,"children":1707},{"style":692},[1708],{"type":228,"value":1049},{"type":223,"tag":685,"props":1710,"children":1712},{"class":687,"line":1711},30,[1713,1717,1721,1725,1729,1733,1738,1742],{"type":223,"tag":685,"props":1714,"children":1715},{"style":692},[1716],{"type":228,"value":1057},{"type":223,"tag":685,"props":1718,"children":1719},{"style":1060},[1720],{"type":228,"value":1063},{"type":223,"tag":685,"props":1722,"children":1723},{"style":692},[1724],{"type":228,"value":1068},{"type":223,"tag":685,"props":1726,"children":1727},{"style":692},[1728],{"type":228,"value":1073},{"type":223,"tag":685,"props":1730,"children":1731},{"style":692},[1732],{"type":228,"value":1078},{"type":223,"tag":685,"props":1734,"children":1735},{"style":714},[1736],{"type":228,"value":1737},"/subscriptions/********-****-****-****-************/resourceGroups/TestingAzureCLI",{"type":223,"tag":685,"props":1739,"children":1740},{"style":692},[1741],{"type":228,"value":1068},{"type":223,"tag":685,"props":1743,"children":1744},{"style":692},[1745],{"type":228,"value":1092},{"type":223,"tag":685,"props":1747,"children":1749},{"class":687,"line":1748},31,[1750,1754,1758,1762,1766,1770,1774,1778],{"type":223,"tag":685,"props":1751,"children":1752},{"style":692},[1753],{"type":228,"value":1057},{"type":223,"tag":685,"props":1755,"children":1756},{"style":1060},[1757],{"type":228,"value":1104},{"type":223,"tag":685,"props":1759,"children":1760},{"style":692},[1761],{"type":228,"value":1068},{"type":223,"tag":685,"props":1763,"children":1764},{"style":692},[1765],{"type":228,"value":1073},{"type":223,"tag":685,"props":1767,"children":1768},{"style":692},[1769],{"type":228,"value":1078},{"type":223,"tag":685,"props":1771,"children":1772},{"style":714},[1773],{"type":228,"value":1121},{"type":223,"tag":685,"props":1775,"children":1776},{"style":692},[1777],{"type":228,"value":1068},{"type":223,"tag":685,"props":1779,"children":1780},{"style":692},[1781],{"type":228,"value":1092},{"type":223,"tag":685,"props":1783,"children":1785},{"class":687,"line":1784},32,[1786,1790,1794,1798,1802],{"type":223,"tag":685,"props":1787,"children":1788},{"style":692},[1789],{"type":228,"value":1057},{"type":223,"tag":685,"props":1791,"children":1792},{"style":1060},[1793],{"type":228,"value":1141},{"type":223,"tag":685,"props":1795,"children":1796},{"style":692},[1797],{"type":228,"value":1068},{"type":223,"tag":685,"props":1799,"children":1800},{"style":692},[1801],{"type":228,"value":1073},{"type":223,"tag":685,"props":1803,"children":1804},{"style":692},[1805],{"type":228,"value":1154},{"type":223,"tag":685,"props":1807,"children":1809},{"class":687,"line":1808},33,[1810,1814,1818,1822,1826,1830,1834,1838],{"type":223,"tag":685,"props":1811,"children":1812},{"style":692},[1813],{"type":228,"value":1057},{"type":223,"tag":685,"props":1815,"children":1816},{"style":1060},[1817],{"type":228,"value":1166},{"type":223,"tag":685,"props":1819,"children":1820},{"style":692},[1821],{"type":228,"value":1068},{"type":223,"tag":685,"props":1823,"children":1824},{"style":692},[1825],{"type":228,"value":1073},{"type":223,"tag":685,"props":1827,"children":1828},{"style":692},[1829],{"type":228,"value":1078},{"type":223,"tag":685,"props":1831,"children":1832},{"style":714},[1833],{"type":228,"value":717},{"type":223,"tag":685,"props":1835,"children":1836},{"style":692},[1837],{"type":228,"value":1068},{"type":223,"tag":685,"props":1839,"children":1840},{"style":692},[1841],{"type":228,"value":1092},{"type":223,"tag":685,"props":1843,"children":1845},{"class":687,"line":1844},34,[1846,1850,1854,1858,1862],{"type":223,"tag":685,"props":1847,"children":1848},{"style":692},[1849],{"type":228,"value":1057},{"type":223,"tag":685,"props":1851,"children":1852},{"style":1060},[1853],{"type":228,"value":1203},{"type":223,"tag":685,"props":1855,"children":1856},{"style":692},[1857],{"type":228,"value":1068},{"type":223,"tag":685,"props":1859,"children":1860},{"style":692},[1861],{"type":228,"value":1073},{"type":223,"tag":685,"props":1863,"children":1864},{"style":692},[1865],{"type":228,"value":1216},{"type":223,"tag":685,"props":1867,"children":1869},{"class":687,"line":1868},35,[1870,1874,1878,1882,1886,1890,1894],{"type":223,"tag":685,"props":1871,"children":1872},{"style":692},[1873],{"type":228,"value":1224},{"type":223,"tag":685,"props":1875,"children":1876},{"style":1227},[1877],{"type":228,"value":1230},{"type":223,"tag":685,"props":1879,"children":1880},{"style":692},[1881],{"type":228,"value":1068},{"type":223,"tag":685,"props":1883,"children":1884},{"style":692},[1885],{"type":228,"value":1073},{"type":223,"tag":685,"props":1887,"children":1888},{"style":692},[1889],{"type":228,"value":1078},{"type":223,"tag":685,"props":1891,"children":1892},{"style":714},[1893],{"type":228,"value":1247},{"type":223,"tag":685,"props":1895,"children":1896},{"style":692},[1897],{"type":228,"value":1252},{"type":223,"tag":685,"props":1899,"children":1901},{"class":687,"line":1900},36,[1902],{"type":223,"tag":685,"props":1903,"children":1904},{"style":692},[1905],{"type":228,"value":1260},{"type":223,"tag":685,"props":1907,"children":1909},{"class":687,"line":1908},37,[1910,1914,1918,1922,1926],{"type":223,"tag":685,"props":1911,"children":1912},{"style":692},[1913],{"type":228,"value":1057},{"type":223,"tag":685,"props":1915,"children":1916},{"style":1060},[1917],{"type":228,"value":1272},{"type":223,"tag":685,"props":1919,"children":1920},{"style":692},[1921],{"type":228,"value":1068},{"type":223,"tag":685,"props":1923,"children":1924},{"style":692},[1925],{"type":228,"value":1073},{"type":223,"tag":685,"props":1927,"children":1928},{"style":692},[1929],{"type":228,"value":1216},{"type":223,"tag":685,"props":1931,"children":1933},{"class":687,"line":1932},38,[1934,1938,1942,1946,1950,1954,1959,1963],{"type":223,"tag":685,"props":1935,"children":1936},{"style":692},[1937],{"type":228,"value":1224},{"type":223,"tag":685,"props":1939,"children":1940},{"style":1227},[1941],{"type":228,"value":1602},{"type":223,"tag":685,"props":1943,"children":1944},{"style":692},[1945],{"type":228,"value":1068},{"type":223,"tag":685,"props":1947,"children":1948},{"style":692},[1949],{"type":228,"value":1073},{"type":223,"tag":685,"props":1951,"children":1952},{"style":692},[1953],{"type":228,"value":1078},{"type":223,"tag":685,"props":1955,"children":1956},{"style":714},[1957],{"type":228,"value":1958},"IT",{"type":223,"tag":685,"props":1960,"children":1961},{"style":692},[1962],{"type":228,"value":1068},{"type":223,"tag":685,"props":1964,"children":1965},{"style":692},[1966],{"type":228,"value":1092},{"type":223,"tag":685,"props":1968,"children":1970},{"class":687,"line":1969},39,[1971,1975,1979,1983,1987,1991,1995],{"type":223,"tag":685,"props":1972,"children":1973},{"style":692},[1974],{"type":228,"value":1224},{"type":223,"tag":685,"props":1976,"children":1977},{"style":1227},[1978],{"type":228,"value":1296},{"type":223,"tag":685,"props":1980,"children":1981},{"style":692},[1982],{"type":228,"value":1068},{"type":223,"tag":685,"props":1984,"children":1985},{"style":692},[1986],{"type":228,"value":1073},{"type":223,"tag":685,"props":1988,"children":1989},{"style":692},[1990],{"type":228,"value":1078},{"type":223,"tag":685,"props":1992,"children":1993},{"style":714},[1994],{"type":228,"value":1313},{"type":223,"tag":685,"props":1996,"children":1997},{"style":692},[1998],{"type":228,"value":1252},{"type":223,"tag":685,"props":2000,"children":2002},{"class":687,"line":2001},40,[2003],{"type":223,"tag":685,"props":2004,"children":2005},{"style":692},[2006],{"type":228,"value":1260},{"type":223,"tag":685,"props":2008,"children":2010},{"class":687,"line":2009},41,[2011,2015,2019,2023,2027],{"type":223,"tag":685,"props":2012,"children":2013},{"style":692},[2014],{"type":228,"value":1057},{"type":223,"tag":685,"props":2016,"children":2017},{"style":1060},[2018],{"type":228,"value":1336},{"type":223,"tag":685,"props":2020,"children":2021},{"style":692},[2022],{"type":228,"value":1068},{"type":223,"tag":685,"props":2024,"children":2025},{"style":692},[2026],{"type":228,"value":1073},{"type":223,"tag":685,"props":2028,"children":2029},{"style":692},[2030],{"type":228,"value":1349},{"type":223,"tag":685,"props":2032,"children":2034},{"class":687,"line":2033},42,[2035],{"type":223,"tag":685,"props":2036,"children":2037},{"style":692},[2038],{"type":228,"value":2039},"  }\n",{"type":223,"tag":685,"props":2041,"children":2043},{"class":687,"line":2042},43,[2044],{"type":223,"tag":685,"props":2045,"children":2046},{"style":692},[2047],{"type":228,"value":2048},"]\n",{"type":223,"tag":224,"props":2050,"children":2051},{},[2052],{"type":228,"value":2053},"Here are some CLI commands that query more precisely the resource groups:",{"type":223,"tag":231,"props":2055,"children":2056},{},[2057],{"type":223,"tag":235,"props":2058,"children":2059},{},[2060,2062],{"type":228,"value":2061},"Select only the resource groups names with ",{"type":223,"tag":368,"props":2063,"children":2065},{"className":2064},[],[2066],{"type":228,"value":2067},"az group list --query '[].name'",{"type":223,"tag":224,"props":2069,"children":2070},{},[2071],{"type":223,"tag":338,"props":2072,"children":2077},{"alt":2073,"className":2074,"src":2075,"width":2076},"az group command output using JMESPath property selection.",[342,343],"/posts/images/azurecli_jmespath_2.png",1000,[],{"type":223,"tag":231,"props":2079,"children":2080},{},[2081],{"type":223,"tag":235,"props":2082,"children":2083},{},[2084,2086],{"type":228,"value":2085},"Filter on resource groups in West Europe with ",{"type":223,"tag":368,"props":2087,"children":2089},{"className":2088},[],[2090],{"type":228,"value":2091},"az group list --query \"[?location=='westeurope']\"",{"type":223,"tag":224,"props":2093,"children":2094},{},[2095],{"type":223,"tag":338,"props":2096,"children":2100},{"alt":2097,"className":2098,"src":2099,"width":2076},"az group command output using JMESPath property filter.",[342,343],"/posts/images/azurecli_jmespath_1.png",[],{"type":223,"tag":231,"props":2102,"children":2103},{},[2104],{"type":223,"tag":235,"props":2105,"children":2106},{},[2107,2109],{"type":228,"value":2108},"Filter on resource groups with an Environment tag with the value Production, select and rename name and tags properties with ",{"type":223,"tag":368,"props":2110,"children":2112},{"className":2111},[],[2113],{"type":228,"value":2114},"az group list --query \"[?tags.Environment=='Production'].{RGName:name, RGTags:tags}\"",{"type":223,"tag":224,"props":2116,"children":2117},{},[2118],{"type":223,"tag":338,"props":2119,"children":2123},{"alt":2120,"className":2121,"src":2122,"width":2076},"az group command output using JMESPath property filter and selection.",[342,343],"/posts/images/azurecli_jmespath_3.png",[],{"type":223,"tag":637,"props":2125,"children":2126},{"icon":639},[2127],{"type":223,"tag":224,"props":2128,"children":2129},{},[2130,2132,2139],{"type":228,"value":2131},"JMESPath is not an Azure CLI only thing, it is used in different other projects or tools like the ",{"type":223,"tag":239,"props":2133,"children":2136},{"href":2134,"rel":2135},"https://docs.aws.amazon.com/cli/latest/userguide/cli-usage-output.html#controlling-output-filter",[290],[2137],{"type":228,"value":2138},"AWS CLI",{"type":228,"value":295},{"type":223,"tag":584,"props":2141,"children":2143},{"id":2142},"mixing-output-variables-and-jmespath",[2144],{"type":228,"value":2145},"Mixing output, variables, and JMESPath",{"type":223,"tag":224,"props":2147,"children":2148},{},[2149],{"type":228,"value":2150},"Once you have understood how to use variables, commands output, and JMESPath with Azure CLI you can mix everything to manage Azure resources with CLI commands that use results of previous CLI commands, which can make powerful scripts 😀.",{"type":223,"tag":224,"props":2152,"children":2153},{},[2154],{"type":228,"value":2155},"Let's presume that we want to create a Web App for the IT Department in an existing App Service Plan of our subscription located in West Europe.\nWe can do the following:",{"type":223,"tag":675,"props":2157,"children":2159},{"className":677,"code":2158,"language":679,"meta":207,"style":207},"# Retrieve resource group name of IT Department in West Europe\n$itRgName = az group list --query \"[?tags.Department=='IT' && location=='westeurope'].name\" -o tsv\n\n# Retrieve app service plan name in this resource group\n$appServicePlan = az appservice plan list -g $itRgName --query \"[0].name\" -o tsv\n\n# Create a new Web App on this app service plan\naz webapp create -n \"MyNewWebAp\" -g $itRgName --plan $appServicePlan\n\n# List all Web App in this resource group\naz webapp list -g $itRgName --query \"[].name\"\n",[2160],{"type":223,"tag":368,"props":2161,"children":2162},{"__ignoreMap":207},[2163,2171,2224,2231,2239,2305,2312,2320,2383,2390,2398],{"type":223,"tag":685,"props":2164,"children":2165},{"class":687,"line":688},[2166],{"type":223,"tag":685,"props":2167,"children":2168},{"style":739},[2169],{"type":228,"value":2170},"# Retrieve resource group name of IT Department in West Europe\n",{"type":223,"tag":685,"props":2172,"children":2173},{"class":687,"line":725},[2174,2178,2183,2187,2192,2196,2201,2205,2210,2214,2219],{"type":223,"tag":685,"props":2175,"children":2176},{"style":692},[2177],{"type":228,"value":695},{"type":223,"tag":685,"props":2179,"children":2180},{"style":698},[2181],{"type":228,"value":2182},"itRgName ",{"type":223,"tag":685,"props":2184,"children":2185},{"style":692},[2186],{"type":228,"value":706},{"type":223,"tag":685,"props":2188,"children":2189},{"style":698},[2190],{"type":228,"value":2191}," az group list ",{"type":223,"tag":685,"props":2193,"children":2194},{"style":692},[2195],{"type":228,"value":843},{"type":223,"tag":685,"props":2197,"children":2198},{"style":698},[2199],{"type":228,"value":2200},"query ",{"type":223,"tag":685,"props":2202,"children":2203},{"style":692},[2204],{"type":228,"value":1068},{"type":223,"tag":685,"props":2206,"children":2207},{"style":714},[2208],{"type":228,"value":2209},"[?tags.Department=='IT' && location=='westeurope'].name",{"type":223,"tag":685,"props":2211,"children":2212},{"style":692},[2213],{"type":228,"value":1068},{"type":223,"tag":685,"props":2215,"children":2216},{"style":692},[2217],{"type":228,"value":2218}," -",{"type":223,"tag":685,"props":2220,"children":2221},{"style":698},[2222],{"type":228,"value":2223},"o tsv\n",{"type":223,"tag":685,"props":2225,"children":2226},{"class":687,"line":735},[2227],{"type":223,"tag":685,"props":2228,"children":2229},{"emptyLinePlaceholder":729},[2230],{"type":228,"value":732},{"type":223,"tag":685,"props":2232,"children":2233},{"class":687,"line":745},[2234],{"type":223,"tag":685,"props":2235,"children":2236},{"style":739},[2237],{"type":228,"value":2238},"# Retrieve app service plan name in this resource group\n",{"type":223,"tag":685,"props":2240,"children":2241},{"class":687,"line":781},[2242,2246,2251,2255,2260,2264,2268,2272,2276,2280,2284,2288,2293,2297,2301],{"type":223,"tag":685,"props":2243,"children":2244},{"style":692},[2245],{"type":228,"value":695},{"type":223,"tag":685,"props":2247,"children":2248},{"style":698},[2249],{"type":228,"value":2250},"appServicePlan ",{"type":223,"tag":685,"props":2252,"children":2253},{"style":692},[2254],{"type":228,"value":706},{"type":223,"tag":685,"props":2256,"children":2257},{"style":698},[2258],{"type":228,"value":2259}," az appservice plan list ",{"type":223,"tag":685,"props":2261,"children":2262},{"style":692},[2263],{"type":228,"value":756},{"type":223,"tag":685,"props":2265,"children":2266},{"style":698},[2267],{"type":228,"value":830},{"type":223,"tag":685,"props":2269,"children":2270},{"style":692},[2271],{"type":228,"value":695},{"type":223,"tag":685,"props":2273,"children":2274},{"style":698},[2275],{"type":228,"value":2182},{"type":223,"tag":685,"props":2277,"children":2278},{"style":692},[2279],{"type":228,"value":843},{"type":223,"tag":685,"props":2281,"children":2282},{"style":698},[2283],{"type":228,"value":2200},{"type":223,"tag":685,"props":2285,"children":2286},{"style":692},[2287],{"type":228,"value":1068},{"type":223,"tag":685,"props":2289,"children":2290},{"style":714},[2291],{"type":228,"value":2292},"[0].name",{"type":223,"tag":685,"props":2294,"children":2295},{"style":692},[2296],{"type":228,"value":1068},{"type":223,"tag":685,"props":2298,"children":2299},{"style":692},[2300],{"type":228,"value":2218},{"type":223,"tag":685,"props":2302,"children":2303},{"style":698},[2304],{"type":228,"value":2223},{"type":223,"tag":685,"props":2306,"children":2307},{"class":687,"line":789},[2308],{"type":223,"tag":685,"props":2309,"children":2310},{"emptyLinePlaceholder":729},[2311],{"type":228,"value":732},{"type":223,"tag":685,"props":2313,"children":2314},{"class":687,"line":798},[2315],{"type":223,"tag":685,"props":2316,"children":2317},{"style":739},[2318],{"type":228,"value":2319},"# Create a new Web App on this app service plan\n",{"type":223,"tag":685,"props":2321,"children":2322},{"class":687,"line":851},[2323,2328,2332,2336,2340,2345,2349,2353,2357,2361,2365,2369,2374,2378],{"type":223,"tag":685,"props":2324,"children":2325},{"style":698},[2326],{"type":228,"value":2327},"az webapp create ",{"type":223,"tag":685,"props":2329,"children":2330},{"style":692},[2331],{"type":228,"value":756},{"type":223,"tag":685,"props":2333,"children":2334},{"style":698},[2335],{"type":228,"value":761},{"type":223,"tag":685,"props":2337,"children":2338},{"style":692},[2339],{"type":228,"value":1068},{"type":223,"tag":685,"props":2341,"children":2342},{"style":714},[2343],{"type":228,"value":2344},"MyNewWebAp",{"type":223,"tag":685,"props":2346,"children":2347},{"style":692},[2348],{"type":228,"value":1068},{"type":223,"tag":685,"props":2350,"children":2351},{"style":692},[2352],{"type":228,"value":2218},{"type":223,"tag":685,"props":2354,"children":2355},{"style":698},[2356],{"type":228,"value":830},{"type":223,"tag":685,"props":2358,"children":2359},{"style":692},[2360],{"type":228,"value":695},{"type":223,"tag":685,"props":2362,"children":2363},{"style":698},[2364],{"type":228,"value":2182},{"type":223,"tag":685,"props":2366,"children":2367},{"style":692},[2368],{"type":228,"value":843},{"type":223,"tag":685,"props":2370,"children":2371},{"style":698},[2372],{"type":228,"value":2373},"plan ",{"type":223,"tag":685,"props":2375,"children":2376},{"style":692},[2377],{"type":228,"value":695},{"type":223,"tag":685,"props":2379,"children":2380},{"style":698},[2381],{"type":228,"value":2382},"appServicePlan\n",{"type":223,"tag":685,"props":2384,"children":2385},{"class":687,"line":859},[2386],{"type":223,"tag":685,"props":2387,"children":2388},{"emptyLinePlaceholder":729},[2389],{"type":228,"value":732},{"type":223,"tag":685,"props":2391,"children":2392},{"class":687,"line":868},[2393],{"type":223,"tag":685,"props":2394,"children":2395},{"style":739},[2396],{"type":228,"value":2397},"# List all Web App in this resource group\n",{"type":223,"tag":685,"props":2399,"children":2400},{"class":687,"line":910},[2401,2406,2410,2414,2418,2422,2426,2430,2434,2439],{"type":223,"tag":685,"props":2402,"children":2403},{"style":698},[2404],{"type":228,"value":2405},"az webapp list ",{"type":223,"tag":685,"props":2407,"children":2408},{"style":692},[2409],{"type":228,"value":756},{"type":223,"tag":685,"props":2411,"children":2412},{"style":698},[2413],{"type":228,"value":830},{"type":223,"tag":685,"props":2415,"children":2416},{"style":692},[2417],{"type":228,"value":695},{"type":223,"tag":685,"props":2419,"children":2420},{"style":698},[2421],{"type":228,"value":2182},{"type":223,"tag":685,"props":2423,"children":2424},{"style":692},[2425],{"type":228,"value":843},{"type":223,"tag":685,"props":2427,"children":2428},{"style":698},[2429],{"type":228,"value":2200},{"type":223,"tag":685,"props":2431,"children":2432},{"style":692},[2433],{"type":228,"value":1068},{"type":223,"tag":685,"props":2435,"children":2436},{"style":714},[2437],{"type":228,"value":2438},"[].name",{"type":223,"tag":685,"props":2440,"children":2441},{"style":692},[2442],{"type":228,"value":1252},{"type":223,"tag":224,"props":2444,"children":2445},{},[2446],{"type":228,"value":2447},"This is just a quick example but you can easily imagine all the possibilities that Azure CLI offers you.",{"type":223,"tag":297,"props":2449,"children":2451},{"id":2450},"_4-where-to-use-azure-cli",[2452],{"type":228,"value":2453},"4 - Where to use Azure CLI",{"type":223,"tag":224,"props":2455,"children":2456},{},[2457],{"type":228,"value":2458},"All that is great but we haven't talked about where we can use Azure CLI, let's do that now!",{"type":223,"tag":584,"props":2460,"children":2462},{"id":2461},"bash-vs-powershell",[2463],{"type":228,"value":2464},"Bash vs PowerShell",{"type":223,"tag":224,"props":2466,"children":2467},{},[2468],{"type":228,"value":2469},"We briefly mentioned that you can run Azure CLI in Bash or PowerShell, and as a matter of fact you can also run it in Windows Command Prompt.\nAlthough Azure CLI is originally designed to be bash-oriented, it works fine in PowerShell so it's a perfectly valid choice too. What command line shell you choose is up to you!",{"type":223,"tag":224,"props":2471,"children":2472},{},[2473],{"type":228,"value":2474},"And don't think that you will be limited to using one or the other shell depending on the platform you are working on, because both PowerShell and Bash are available whatever your platform (PowerShell Core is cross-platform and Bash is available in Windows through Windows Subsystem for Linux). Therefore I would just suggest you use Azure CLI with the shell you are most familiar with.",{"type":223,"tag":224,"props":2476,"children":2477},{},[2478,2480,2487,2489,2496],{"type":228,"value":2479},"Just a quick note about autocompletion: at this time tab completion is only supported in bash and Microsoft currently does not plan to add support for PowerShell but is open to contributions from the community. That's not a big deal but that's good to know, there is a ",{"type":223,"tag":239,"props":2481,"children":2484},{"href":2482,"rel":2483},"https://github.com/Azure/azure-cli/issues/2324",[290],[2485],{"type":228,"value":2486},"GitHub issue",{"type":228,"value":2488}," on this matter. If you are not using bash and that tab completion is important for you, ",{"type":223,"tag":239,"props":2490,"children":2493},{"href":2491,"rel":2492},"https://docs.microsoft.com/en-us/cli/azure/interactive-azure-cli?view=azure-cli-latest",[290],[2494],{"type":228,"value":2495},"Azure CLI interactive mode",{"type":228,"value":2497}," is what you are looking for (we will talk about it later in the article)!",{"type":223,"tag":584,"props":2499,"children":2501},{"id":2500},"azure-cli-in-visual-studio-code",[2502],{"type":228,"value":2503},"Azure CLI in Visual Studio Code",{"type":223,"tag":224,"props":2505,"children":2506},{},[2507],{"type":228,"value":2508},"As for most of Azure components, there is an extension in vs code for Azure CLI: Azure CLI Tools.",{"type":223,"tag":224,"props":2510,"children":2511},{},[2512],{"type":223,"tag":338,"props":2513,"children":2517},{"alt":2514,"className":2515,"src":2516},"Azure CLI Tools vscode extension.",[342,343],"/posts/images/azurecli_vscode_1.png",[],{"type":223,"tag":224,"props":2519,"children":2520},{},[2521,2523,2529],{"type":228,"value":2522},"With this extension you can create Azure CLI Scrapbooks which are files with an ",{"type":223,"tag":368,"props":2524,"children":2526},{"className":2525},[],[2527],{"type":228,"value":2528},".azcli",{"type":228,"value":2530}," extension where you have IntelliSense on CLI commands you write.",{"type":223,"tag":224,"props":2532,"children":2533},{},[2534],{"type":223,"tag":338,"props":2535,"children":2539},{"alt":2536,"className":2537,"src":2538,"width":2076},"Intellisense with Azure CLI vscode extension.",[342,343],"/posts/images/azurecli_vscode_3.png",[],{"type":223,"tag":224,"props":2541,"children":2542},{},[2543],{"type":228,"value":2544},"It also allows you to run commands in the integrated terminal or run them and show their output in a side-by-side editor as showN in the screenshot below.",{"type":223,"tag":224,"props":2546,"children":2547},{},[2548],{"type":223,"tag":338,"props":2549,"children":2553},{"alt":2550,"className":2551,"src":2552,"width":2076},"Azcli file with integrated integrated terminal.",[342,343],"/posts/images/azurecli_vscode_2.png",[],{"type":223,"tag":584,"props":2555,"children":2557},{"id":2556},"azure-cloud-shell",[2558],{"type":228,"value":2559},"Azure Cloud Shell",{"type":223,"tag":224,"props":2561,"children":2562},{},[2563,2565,2571],{"type":228,"value":2564},"I did not talk about Azure CLI installation but you can find everything you need in ",{"type":223,"tag":239,"props":2566,"children":2568},{"href":288,"rel":2567},[290],[2569],{"type":228,"value":2570},"Microsoft documentation",{"type":228,"value":2572},". Actually, Azure Cloud Shell provides you with a way to use Azure CLI without installing anything.",{"type":223,"tag":224,"props":2574,"children":2575},{},[2576],{"type":228,"value":2577},"If we quote the documentation:",{"type":223,"tag":2579,"props":2580,"children":2581},"blockquote",{},[2582],{"type":223,"tag":224,"props":2583,"children":2584},{},[2585],{"type":228,"value":2586},"Azure Cloud Shell is an interactive, browser-accessible shell for managing Azure resources",{"type":223,"tag":224,"props":2588,"children":2589},{},[2590,2592,2598],{"type":228,"value":2591},"In concrete terms, you open a browser, go to ",{"type":223,"tag":239,"props":2593,"children":2596},{"href":2594,"rel":2595},"https://shell.azure.com",[290],[2597],{"type":228,"value":2594},{"type":228,"value":2599},", log in to your Azure subscription and you have access to a shell (PowerShell or Bash) that can interact with all the resources of your subscription through Azure CLI.",{"type":223,"tag":224,"props":2601,"children":2602},{},[2603],{"type":223,"tag":338,"props":2604,"children":2608},{"alt":2605,"className":2606,"src":2607,"width":2076},"Azure cloud shell in browser.",[342,343],"/posts/images/azurecli_cloudshell_1.png",[],{"type":223,"tag":224,"props":2610,"children":2611},{},[2612],{"type":228,"value":2613},"Cloud Shell in itself is free but requires an Azure file share to be mounted so you will have regular storage costs (which are low).",{"type":223,"tag":224,"props":2615,"children":2616},{},[2617,2619,2626],{"type":228,"value":2618},"Azure Cloud Shell is also available in the Azure Portal or directly in your vs code integrated terminal through the ",{"type":223,"tag":239,"props":2620,"children":2623},{"href":2621,"rel":2622},"https://marketplace.visualstudio.com/items?itemName=ms-vscode.azure-account",[290],[2624],{"type":228,"value":2625},"Azure Account extension",{"type":228,"value":295},{"type":223,"tag":297,"props":2628,"children":2630},{"id":2629},"_5-azure-cli-interactive-mode",[2631],{"type":228,"value":2632},"5 - Azure CLI Interactive mode",{"type":223,"tag":224,"props":2634,"children":2635},{},[2636],{"type":228,"value":2637},"I mentioned Azure CLI interactive mode as a way to have auto-completion. In fact, it is much more than that as it also provides you with command descriptions, examples, completion on resources names, JMESPath on the previous command...",{"type":223,"tag":224,"props":2639,"children":2640},{},[2641,2643,2649],{"type":228,"value":2642},"To enter in interactive mode, you have to type ",{"type":223,"tag":368,"props":2644,"children":2646},{"className":2645},[],[2647],{"type":228,"value":2648},"az interactive",{"type":228,"value":2650}," in your terminal.\nThen you can type your CLI commands with autocompletion, a description of the command you are using, and examples for it. Moreover, while you are typing a command you will see help about the arguments for this command.",{"type":223,"tag":224,"props":2652,"children":2653},{},[2654],{"type":223,"tag":338,"props":2655,"children":2659},{"alt":2656,"className":2657,"src":2658,"width":2076},"Azure CLI interactive mode display.",[342,343],"/posts/images/azurecli_interactive_1.png",[],{"type":223,"tag":224,"props":2661,"children":2662},{},[2663,2665,2670,2672,2677,2679,2685,2687,2692],{"type":228,"value":2664},"One thing to notice is that commands you type are scoped to a command group. By default, it's scoped to ",{"type":223,"tag":368,"props":2666,"children":2668},{"className":2667},[],[2669],{"type":228,"value":436},{"type":228,"value":2671}," group so you don't have to type the ",{"type":223,"tag":368,"props":2673,"children":2675},{"className":2674},[],[2676],{"type":228,"value":436},{"type":228,"value":2678}," keyword before your commands. So by default, it only saves you two characters as you will write ",{"type":223,"tag":368,"props":2680,"children":2682},{"className":2681},[],[2683],{"type":228,"value":2684},"group list",{"type":228,"value":2686}," instead of ",{"type":223,"tag":368,"props":2688,"children":2690},{"className":2689},[],[2691],{"type":228,"value":1022},{"type":228,"value":2693},". But you can set the scope to any subgroup as you can see in the following example.",{"type":223,"tag":224,"props":2695,"children":2696},{},[2697],{"type":223,"tag":338,"props":2698,"children":2702},{"alt":2699,"className":2700,"src":2701},"Scoped commands in Azure CLI interactive mode.",[342,343],"/posts/images/azurecli_interactive_2.png",[],{"type":223,"tag":224,"props":2704,"children":2705},{},[2706,2708,2713,2715,2721],{"type":228,"value":2707},"Another nice thing you can do with the interactive mode is to query the results of your previous command using the JMESPath syntax.\nImagine I just have executed the command ",{"type":223,"tag":368,"props":2709,"children":2711},{"className":2710},[],[2712],{"type":228,"value":2684},{"type":228,"value":2714}," in interactive mode. If I want to select only the names in the results of this command, I can just type ",{"type":223,"tag":368,"props":2716,"children":2718},{"className":2717},[],[2719],{"type":228,"value":2720},"\"?? [*].name\"",{"type":228,"value":295},{"type":223,"tag":224,"props":2723,"children":2724},{},[2725],{"type":223,"tag":338,"props":2726,"children":2730},{"alt":2727,"className":2728,"src":2729},"JMESPath examples to filter Azure CLI interactive output.",[342,343],"/posts/images/azurecli_interactive_3.png",[],{"type":223,"tag":224,"props":2732,"children":2733},{},[2734],{"type":228,"value":2735},"As you can see in the example above, you can even use a JMESPath query on the previous command as an argument for your next command. Here we are listing all resources on the TestingAzureCLI group.",{"type":223,"tag":637,"props":2737,"children":2738},{"icon":639},[2739],{"type":223,"tag":224,"props":2740,"children":2741},{},[2742,2744,2750],{"type":228,"value":2743},"It can sometimes be a little slow to use Azure interactive mode on ",{"type":223,"tag":239,"props":2745,"children":2748},{"href":2746,"rel":2747},"https://shell.azure.com/",[290],[2749],{"type":228,"value":2746},{"type":228,"value":2751},", so if it happens to you I suggest you use the vs code integrated terminal (if you want to use Azure Cloud Shell) or any terminal you want (if you have the Azure CLI installed) instead of the browser.",{"type":223,"tag":637,"props":2753,"children":2754},{"icon":639},[2755],{"type":223,"tag":224,"props":2756,"children":2757},{},[2758,2760,2767],{"type":228,"value":2759},"If you like interactive CLI, you can also have a look at ",{"type":223,"tag":239,"props":2761,"children":2764},{"href":2762,"rel":2763},"https://github.com/lawrencegripper/azbrowse",[290],[2765],{"type":228,"value":2766},"AzBrowse",{"type":228,"value":2768}," which is a nice community project.",{"type":223,"tag":297,"props":2770,"children":2772},{"id":2771},"to-conclude",[2773],{"type":228,"value":2774},"To conclude",{"type":223,"tag":224,"props":2776,"children":2777},{},[2778],{"type":228,"value":2779},"Even if the title of this article suggests saying goodbye to Azure Portal, when you start using Azure CLI you are not going to stop completely using Azure Portal. You will always need a GUI for some tasks or to better visualize things. However, you will probably Azure Portal use less often as you are going to find yourself more productive with Azure CLI and will enjoy being able to script everything ✨.",{"type":223,"tag":224,"props":2781,"children":2782},{},[2783],{"type":228,"value":2784},"There is still much to say about Azure CLI but that's already a long article so the best thing is that you try it by yourself!",{"type":223,"tag":2786,"props":2787,"children":2788},"style",{},[2789],{"type":228,"value":2790},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":207,"searchDepth":725,"depth":725,"links":2792},[2793,2794,2795,2801,2806,2807],{"id":299,"depth":725,"text":302},{"id":358,"depth":725,"text":361},{"id":579,"depth":725,"text":582,"children":2796},[2797,2798,2799,2800],{"id":586,"depth":735,"text":589},{"id":656,"depth":735,"text":659},{"id":982,"depth":735,"text":985},{"id":2142,"depth":735,"text":2145},{"id":2450,"depth":725,"text":2453,"children":2802},[2803,2804,2805],{"id":2461,"depth":735,"text":2464},{"id":2500,"depth":735,"text":2503},{"id":2556,"depth":735,"text":2559},{"id":2629,"depth":725,"text":2632},{"id":2771,"depth":725,"text":2774},"markdown","content:1.posts:3.welcome-azure-cli.md","content","1.posts/3.welcome-azure-cli.md","md",[2814,2827],{"_path":19,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":18,"description":2815,"lead":2816,"date":2817,"image":2818,"tags":2820,"badge":2824,"_type":2808,"_id":2825,"_source":2810,"_file":2826,"_extension":2812},"The other day when I was looking for a way to automate my development environment setup, I came across Gitpod. Not really what I was looking for but I discovered an awesome tool for working on open source projects.","An IDE in the browser","2019-08-12T00:00:00.000Z",{"src":2819},"/images/github-usbkey.jpg",[2821,2822,2823],"GitHub","tooling","vscode",{"label":214},"content:1.posts:4.gitpod.md","1.posts/4.gitpod.md",{"_path":13,"_dir":205,"_draft":206,"_partial":206,"_locale":207,"title":12,"description":2828,"lead":2829,"date":2830,"image":2831,"badge":2833,"tags":2835,"_type":2808,"_id":2839,"_source":2810,"_file":2840,"_extension":2812},"There are often situations where you need to do some HTML templating and having a powerful HTML templating engine like Razor can be really helpful.\nWhat is nice is that you don't need to be in an ASP.NET context to use Razor templates, in fact, you can even use them in a Xamarin Application.","Razor templates, Handlebars.Net ...","2019-03-10T00:00:00.000Z",{"src":2832},"/images/phone_2.jpg",{"label":2834},"Development",[2836,2837,2838],"Razor","Xamarin","Templating","content:1.posts:2.html-templating-in-xamarin.md","1.posts/2.html-templating-in-xamarin.md",1716749612207]