Slide 1

Slide 1 text

Azure CLI Talk For CloudSkills Community David Cobb [email protected]

Slide 2

Slide 2 text

Intro - Consultant & Technical Instructor - Career path: helpdesk, web developer, dba, system administrator, cloud engineer - Microsoft Certified Trainer since 2002, was focused on SQL, now focused on Azure. Certifications for Microsoft SQL, Azure & two for AWS - Generalist. My goal is baseline knowledge of most of Azure, with deeper study in a few areas of interest (SQL/Data/ML/AI).

Slide 3

Slide 3 text

Goals for this talk Getting started with of Azure CLI (Command Line Interface, aka AZCli ) as part of your Azure toolbox. Share tools and techniques in the shell with Azure CLI Explore Azure CLI commands, beginning with the fundamentals useful for AZ-104 (Storage, VMs, Networking) Discover interesting preview Azure CLI commands and extensions Challenge you to learn Azure CLI by coding and sharing with the CS community via GitHub

Slide 4

Slide 4 text

Installing & Running AZCLI Azure CLI is written in Python, so it's cross platform, runs in Windows, Linux, MacOS Is open source under MIT License Has many ways to install (docs) Works* on your choice of shell: bash, zsh, pwsh, etc... David's shell of choice to run AZCLI is PowerShell 7 (pwsh) * * Aspects of Azure CLI like --query are not perfectly cross platform yet..

Slide 5

Slide 5 text

Shell Considerations What's your shell? Practice makes (better). It's a time investment to become proficient in a shell, this pays off in increasing effectiveness, especially in the cloud. See Tips for using Azure CLI effectively for help with common challenges that arise with shell scripting using this tool. We will use different shells that each have their strengths, but the focus of this talk is not the shell but Azure CLI.

Slide 6

Slide 6 text

Using VSCode? You should be! Check out the 'Azure CLI Tools' extension code --install-extension ms-vscode.azurecli Works with the shell of your choice

Slide 7

Slide 7 text

Azure CLI Basics Start with Azure API Basic Syntax First Commands Get Interactive Dealing with JSON

Slide 8

Slide 8 text

Azure's API As the Underlying control plane for all of Azure, the API has a HUGE, RAPIDLY EVOLVING scope Azure API docs Azure API releases on github Azure CLI is also updated frequently AZCLI release notes AZCLI issues tracker Compare to Azure PowerShell's update frequency Azure PowerShell release notes Azure PowerShell issues tracker

Slide 9

Slide 9 text

DAVE'S STANDARD 'CLOUD BASED BLEEDING EDGE TOOLS' WORD OF CAUTION Using many tools in development or preview, some of these demos may not work! We can learn a lot troubleshooting things that break! Even so, be wary of dragons (or bugs).

Slide 10

Slide 10 text

Demo Azure API Use the Azure Resource Explorer to work against Azure API after authenticating to your Azure account. But why use a web page when you can use Lawrence Gripper's AzBrowse? Add az browse command to azcli using Noel Bundick's custom azcli extension az extension add --source https://github.com/noelbundick/azure-cli-extension-noelbundick/releases/download/v0.0.17/noelbundick-0.0.17-py3-none-any.whl

Slide 11

Slide 11 text

Azure CLI Basic Syntax & First Commands Arguments syntax Start with az -h All params start with two hyphens (--help),most common arguments have a one hyphen short format (-h) After az login , start with az group -h to work with your resource groups and get familiar with Azure CLI syntax You can save work later by setting some smart defaults with az configure

Slide 12

Slide 12 text

Global Arguments work for most commands --debug : Increase logging verbosity to show all debug logs. --help -h : Show this help message and exit. --only-show-errors : Only show errors, suppressing warnings. --output -o : Output format. Allowed values: json, jsonc, none, table, tsv, yaml, yamlc. Default: jsonc. --query : JMESPath query string. See http://jmespath.org/ for more information and examples. --subscription : Name or ID of subscription. You can configure the default subscription using `az account set -s NAME_OR_ID`. --verbose : Increase logging verbosity. Use --debug for full debug logs.

Slide 13

Slide 13 text

Get Interactive az interactive explore commands with intellisense embedded documentation examples with step by step tutorials

Slide 14

Slide 14 text

Dealing with JSON --query & JMESPath jmespath-terminal / jpterm Why not PowerShell & ConvertFrom-JSON?

Slide 15

Slide 15 text

Demo AZCLI, JSON & PowerShell

Slide 16

Slide 16 text

Discovering AZCLI Commands and Extensions

Slide 17

Slide 17 text

Azure CLI Open Source Projects in GitHub Azure CLI Azure CLI Extensions Azure Commands under development Microsoft Azure CLI Dev Tools (azdev)

Slide 18

Slide 18 text

Development Process of Azure CLI Commands -----> Extension (Development) ------------> Extension (Preview) -----------------> Extension (Released) -----------------------> CLI Command (Preview) ----------------------------> CLI Command (Released) Example, az keyvault command was previously an extension in preview

Slide 19

Slide 19 text

Explore some Azure CLI commands and extensions

Slide 20

Slide 20 text

Your Turn to Explore Azure Cli Code-Walk Challenge!

Slide 21

Slide 21 text

Q & A

Slide 22

Slide 22 text

No content