INTRODUCTION TO AZURE CLI 2 0 Mohit Chhabra

INTRODUCTION TO AZURE CLI 2. 0 Mohit Chhabra Senior Software Engineer Harman International Azure. Guy. in

Introduction Installation Account and RGs Outputs & Query Web. App with Github VMs AGENDA

Introduction Architecture for MAC and Linux Users Works Well with GREP, Cut, jq etc Built for ARM Templates Swagger Pipeline

Installation Windows • pip install --user azure-cli Mac. Os • curl -L https: //aka. ms/Install. Azure. Cli | bash Linux • curl -L https: //aka. ms/Install. Azure. Cli | bash • exec -l $SHELL Docker • docker run azuresdk/azure-cli-python: <version>

Account and RGs Account • • az login az account list az account set az account show Resource Group • az group list • Az group Create-n My. Resource. Group -l westus 2 • az group show –name My. Resource. Group

Outputs & Query Output Query • --Output -o • tsv, jsonc, table • Az group list --query “[]. Propertyname” • az vm list --output table --query "[? contains(resource. Group, 'MY')]"

Web. App with Github # Create a resource group. az group create --location westeurope --name my. Resource. Group # Create an App Service plan in `FREE` tier. az appservice plan create --name $webappname --resource-group my. Resource. Group --sku FREE # Create a web app. az appservice web create --name $webappname --resource-group my. Resource. Group --plan $webappname # Deploy code from a public Git. Hub repository. az appservice web source-control config --name mywebapp --resource-group my. Resource. Group --repo-url $gitrepo --branch master # Browse to the web app. az appservice web browse --name $webappname --resource-group my. Resource. Group

VMs List all Image • az vm image list List all VMs • az vm list –output table Create VM • az vm create --image debian --name vmname -g My. Resource. Group -admin-username

THANK YOU @mohit_techy
- Slides: 9