• Stars
    star
    3,813
  • Rank 11,037 (Top 0.3 %)
  • Language
    Python
  • License
    MIT License
  • Created over 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Azure Command-Line Interface

Microsoft Azure CLI

Python Build Status Slack

A great cloud needs great tools; we're excited to introduce Azure CLI, our next generation multi-platform command line experience for Azure.

Take a test run now from Azure Cloud Shell!

Installation

Please refer to the install guide for detailed install instructions.

A list of common install issues and their resolutions are available at install troubleshooting.

Developer installation (see below)

Usage

$ az [ group ] [ subgroup ] [ command ] {parameters}

Get Started

Please refer to the "get started" guide for in-depth instructions.

For usage and help content, pass in the -h parameter, for example:

$ az storage -h
$ az vm create -h

Highlights

Here are a few features and concepts that can help you get the most out of the Azure CLI.

Azure CLI Highlight Reel

The following examples are showing using the --output table format, you can change your default using the az configure command.

Tab completion

We support tab-completion for groups, commands, and some parameters

# looking up resource group and name
$ az vm show -g [tab][tab]
AccountingGroup   RGOne  WebPropertiesRG

$ az vm show -g WebPropertiesRG -n [tab][tab]
StoreVM  Bizlogic

$ az vm show -g WebPropertiesRG -n Bizlogic

Query

You can use the --query parameter and the JMESPath query syntax to customize your output.

$ az vm list --query "[?provisioningState=='Succeeded'].{ name: name, os: storageProfile.osDisk.osType }"
Name                    Os
----------------------  -------
storevm                 Linux
bizlogic                Linux
demo32111vm             Windows
dcos-master-39DB807E-0  Linux

Exit codes

For scripting purposes, we output certain exit codes for differing scenarios.

Exit Code Scenario
0 Command ran successfully.
1 Generic error; server returned bad status code, CLI validation failed, etc.
2 Parser error; check input to command line.
3 Missing ARM resource; used for existence check from show commands.

Common scenarios and use Azure CLI effectively

Please check Tips for using Azure CLI effectively. It describes some common scenarios:

More samples and snippets

For more usage examples, take a look at our GitHub samples repo or https://docs.microsoft.com/cli/azure/overview.

Write and run commands in Visual Studio Code

With the Azure CLI Tools Visual Studio Code extension, you can create .azcli files and use these features:

  • IntelliSense for commands and their arguments.
  • Snippets for commands, inserting required arguments automatically.
  • Run the current command in the integrated terminal.
  • Run the current command and show its output in a side-by-side editor.
  • Show documentation on mouse hover.
  • Display current subscription and defaults in status bar.
  • To enable IntelliSense for other file types like .ps1 or .sh, see microsoft/vscode-azurecli#48.

Azure CLI Tools in Action

Data Collection

The software may collect information about you and your use of the software and send it to Microsoft. Microsoft may use this information to provide services and improve our products and services. You may turn off the telemetry as described in the repository. There are also some features in the software that may enable you and Microsoft to collect data from users of your applications. If you use these features, you must comply with applicable law, including providing appropriate notices to users of your applications together with a copy of Microsoft's privacy statement. Our privacy statement is located at https://go.microsoft.com/fwlink/?LinkID=824704. You can learn more about data collection and use in the help documentation and our privacy statement. Your use of the software operates as your consent to these practices.

Telemetry Configuration

Telemetry collection is on by default. To opt out, please run az config set core.collect_telemetry=no to turn it off.

Reporting issues and feedback

If you encounter any bugs with the tool please file an issue in the Issues section of our GitHub repo.

To provide feedback from the command line, try the az feedback command.

[Microsoft internal] You may contact the developer team via [email protected].

Developer installation

Docker

We maintain a Docker image preconfigured with the Azure CLI. See our Docker tags for available versions.

$ docker run -u $(id -u):$(id -g) -v ${HOME}:/home/az -e HOME=/home/az --rm -it mcr.microsoft.com/azure-cli:<version>

Edge builds

If you want to get the latest build from the dev branch, you can use our "edge" builds.

You can download the latest builds by following the links below:

Package Link
MSI https://aka.ms/InstallAzureCliWindowsEdge
Homebrew Formula https://aka.ms/InstallAzureCliHomebrewEdge
Ubuntu Bionic Deb https://aka.ms/InstallAzureCliBionicEdge
Ubuntu Focal Deb https://aka.ms/InstallAzureCliFocalEdge
Ubuntu Jammy Deb https://aka.ms/InstallAzureCliJammyEdge
RPM el8 https://aka.ms/InstallAzureCliRpmEl8Edge

On Windows, you need to uninstall the official version before installing the edge build. (See #25607 (comment))

You can easily install the latest Homebrew edge build with the following command:

# You need to uninstall the stable version with `brew uninstall azure-cli` first
curl --location --silent --output azure-cli.rb https://aka.ms/InstallAzureCliHomebrewEdge
brew install --build-from-source azure-cli.rb

You can install the edge build on Ubuntu Jammy with the following command:

curl --location --silent --output azure-cli_jammy.deb https://aka.ms/InstallAzureCliJammyEdge && dpkg -i azure-cli_jammy.deb

And install the edge build with rpm package on RHEL 8 or CentOS Stream 8:

dnf install -y $(curl --location --silent --output /dev/null --write-out %{url_effective} https://aka.ms/InstallAzureCliRpmEl8Edge)

Here's an example of installing edge builds with pip3 in a virtual environment. The --upgrade-strategy=eager option will install the edge builds of dependencies as well.

$ python3 -m venv env
$ . env/bin/activate
$ pip3 install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --upgrade-strategy=eager

To upgrade your current edge build pass the --upgrade option. The --no-cache-dir option is also recommended since the feed is frequently updated.

$ pip3 install --upgrade --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --no-cache-dir --upgrade-strategy=eager

The edge build is generated for each PR merged to the dev branch as a part of the Azure DevOps Pipelines.

Get builds of arbitrary commit or PR

If you would like to get builds of arbitrary commit or PR, see:

Try new features before release

Developer setup

If you would like to setup a development environment and contribute to the CLI, see:

Configuring Your Machine

Authoring Command Modules

Code Generation

Contribute code

This project has adopted the Microsoft Open Source Code of Conduct.

For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

If you would like to become an active contributor to this project please follow the instructions provided in Microsoft Open Source Guidelines.

More Repositories

1

azure-quickstart-templates

Azure Quickstart Templates
Bicep
13,655
star
2

azure-sdk-for-net

This repository is for active development of the Azure SDK for .NET. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/dotnet/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-net.
4,953
star
3

autorest

OpenAPI (f.k.a Swagger) Specification code generator. Supports C#, PowerShell, Go, Java, Node.js, TypeScript, Python
TypeScript
4,332
star
4

Azure-Sentinel

Cloud-native SIEM for intelligent security analytics for your entire enterprise.
Jupyter Notebook
4,301
star
5

DotNetty

DotNetty project – a port of netty, event-driven asynchronous network application framework
C#
4,011
star
6

azure-powershell

Microsoft Azure PowerShell
4,010
star
7

MachineLearningNotebooks

Python notebooks with ML and deep learning examples with Azure Machine Learning Python SDK | Microsoft
Jupyter Notebook
3,965
star
8

draft-classic

A tool for developers to create cloud-native applications on Kubernetes.
Go
3,922
star
9

azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
Python
3,842
star
10

bicep

Bicep is a declarative language for describing and deploying Azure resources
Bicep
3,128
star
11

azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
2,426
star
12

azure-sdk-for-java

This repository is for active development of the Azure SDK for Java. For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/java/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-java.
Java
2,157
star
13

azure-sdk-for-js

This repository is for active development of the Azure SDK for JavaScript (NodeJS & Browser). For consumers of the SDK we recommend visiting our public developer docs at https://docs.microsoft.com/javascript/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-js.
TypeScript
1,918
star
14

AKS

Azure Kubernetes Service
HTML
1,908
star
15

azure-functions-host

The host/runtime that powers Azure Functions
C#
1,871
star
16

golua

A Lua 5.3 engine implemented in Go
Go
1,850
star
17

Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
TypeScript
1,710
star
18

Enterprise-Scale

The Azure Landing Zones (Enterprise-Scale) architecture provides prescriptive guidance coupled with Azure best practices, and it follows design principles across the critical design areas for organizations to define their Azure architecture
PowerShell
1,603
star
19

Microsoft-Defender-for-Cloud

Welcome to the Microsoft Defender for Cloud community repository
PowerShell
1,592
star
20

azureml-examples

Official community-driven Azure Machine Learning examples, tested with GitHub Actions.
Jupyter Notebook
1,584
star
21

durabletask

Durable Task Framework allows users to write long running persistent workflows in C# using the async/await capabilities.
C#
1,449
star
22

Stormspotter

Azure Red Team tool for graphing Azure and Azure Active Directory objects
Python
1,432
star
23

iotedge

The IoT Edge OSS project
C#
1,421
star
24

azure-policy

Repository for Azure Resource Policy built-in definitions and samples
Open Policy Agent
1,410
star
25

azure-sdk-for-go

This repository is for active development of the Azure SDK for Go. For consumers of the SDK we recommend visiting our public developer docs at:
Go
1,409
star
26

aztfexport

A tool to bring existing Azure resources under Terraform's management
Go
1,335
star
27

azure-sdk-for-node

Azure SDK for Node.js - Documentation
JavaScript
1,187
star
28

azure-functions-core-tools

Command line tools for Azure Functions
C#
1,128
star
29

review-checklists

This repo contains code and examples to operationalize Azure review checklists.
Python
1,118
star
30

Azure-Functions

PowerShell
1,094
star
31

acs-engine

WE HAVE MOVED: Please join us at Azure/aks-engine!
Go
1,034
star
32

aks-engine

AKS Engine: legacy tool for Kubernetes on Azure (see status)
Go
1,027
star
33

coco-framework

The Confidential Consortium Blockchain Framework is an open-source system that enables high-scale, confidential blockchain networks that meet all key enterprise requirements—providing a means to accelerate production enterprise adoption of blockchain technology.
834
star
34

azure-iot-sdks

SDKs for a variety of languages and platforms that help connect devices to Microsoft Azure IoT services
821
star
35

azure-sql-database-samples

Azure SQL Database Samples and Reference Implementation Repository
Python
781
star
36

terraform-azurerm-caf-enterprise-scale

Azure landing zones Terraform module
HCL
750
star
37

caf-terraform-landingzones

Azure Terraform SRE framework
HCL
741
star
38

Azure-Network-Security

Resources for improving Customer Experience with Azure Network Security
Python
732
star
39

azure-webjobs-sdk

Azure WebJobs SDK
C#
712
star
40

ResourceModules

This repository includes a CI platform for and collection of mature and curated Bicep modules. The platform supports both ARM and Bicep and can be leveraged using GitHub actions as well as Azure DevOps pipelines.
Bicep
710
star
41

data-api-builder

Data API builder provides modern REST and GraphQL endpoints to your Azure Databases and on-prem stores.
C#
705
star
42

AzurePublicDataset

Microsoft Azure Traces
Jupyter Notebook
705
star
43

azure-functions-durable-extension

Durable Task Framework extension for Azure Functions
C#
700
star
44

ALZ-Bicep

This repository contains the Azure Landing Zones (ALZ) Bicep modules that help deliver and deploy the Azure Landing Zone conceptual architecture in a modular approach. https://aka.ms/alz/docs
Bicep
694
star
45

azure-api-management-devops-resource-kit

Azure API Management DevOps Resource Kit
C#
681
star
46

azure-service-operator

Azure Service Operator allows you to create Azure resources using kubectl
Go
668
star
47

CCOInsights

Welcome to the Continuous Cloud Optimization Power BI Dashboard GitHub Project. In this repository you will find all the guidance and files needed to deploy the Dashboard in your environment to take benefit of a single pane of glass to get insights about your Azure resources and services.
Mathematica
668
star
48

SimuLand

Understand adversary tradecraft and improve detection strategies
PowerShell
664
star
49

GPT-RAG

Sharing the learning along the way we been gathering to enable Azure OpenAI at enterprise scale in a secure manner. GPT-RAG core is a Retrieval-Augmented Generation pattern running in Azure, using Azure Cognitive Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
Bicep
664
star
50

application-gateway-kubernetes-ingress

This is an ingress controller that can be run on Azure Kubernetes Service (AKS) to allow an Azure Application Gateway to act as the ingress for an AKS cluster.
Go
663
star
51

azure-xplat-cli

For ARM-based service please go to CLI 2.0.
JavaScript
651
star
52

azure-search-vector-samples

A repository of code samples for Vector search capabilities in Azure AI Search.
Jupyter Notebook
646
star
53

DeepLearningForTimeSeriesForecasting

A tutorial demonstrating how to implement deep learning models for time series forecasting
Jupyter Notebook
644
star
54

azure-cosmos-dotnet-v3

.NET SDK for Azure Cosmos DB for the core SQL API
C#
637
star
55

azure-sdk-for-rust

This repository is for active development of the *unofficial* Azure SDK for Rust. This repository is *not* supported by the Azure SDK team.
Rust
636
star
56

node-sqlserver

C++
625
star
57

azure-storage-fuse

A virtual file system adapter for Azure Blob storage
Go
613
star
58

terraform

Source code for the Azure Marketplace Terraform development VM package.
HCL
605
star
59

azure-devops-cli-extension

Azure DevOps Extension for Azure CLI
Python
603
star
60

azure-resource-manager-schemas

Schemas used to author and validate Resource Manager Templates. These schemas power the intellisense and syntax completion in our ARM Tools VSCode extension, as well as the Export Template API
TypeScript
602
star
61

counterfit

a CLI that provides a generic automation layer for assessing the security of ML models
Python
599
star
62

azure-storage-azcopy

The new Azure Storage data transfer utility - AzCopy v10
Go
582
star
63

azure-cosmos-dotnet-v2

Contains samples and utilities relating to the Azure Cosmos DB .NET SDK
577
star
64

azure-iot-sdk-c

A C99 SDK for connecting devices to Microsoft Azure IoT services
C
572
star
65

azure-service-bus

☁️ Azure Service Bus service issue tracking and samples
571
star
66

aad-pod-identity

[DEPRECATED] Assign Azure Active Directory Identities to Kubernetes applications.
Go
570
star
67

Community-Policy

This repo is for Microsoft Azure customers and Microsoft teams to collaborate in making custom policies.
Open Policy Agent
565
star
68

AzureStack-QuickStart-Templates

Quick start ARM templates that deploy on Microsoft Azure Stack
PowerShell
540
star
69

iot-edge-v1

Azure IoT Edge
C
525
star
70

WALinuxAgent

Microsoft Azure Linux Guest Agent
Python
520
star
71

Azure-Sentinel-Notebooks

Interactive Azure Sentinel Notebooks provides security insights and actions to investigate anomalies and hunt for malicious behaviors.
Jupyter Notebook
518
star
72

Industrial-IoT

Azure Industrial IoT Platform
C#
510
star
73

Mission-Critical

This repository provides a design methodology and approach to building highly-reliable applications on Microsoft Azure for mission-critical workloads.
510
star
74

static-web-apps-cli

Azure Static Web Apps CLI ✨
TypeScript
509
star
75

azure-docs-powershell-samples

Azure Powershell code samples, often used in docs.microsoft.com/Azure developer documentation
PowerShell
499
star
76

azure-storage-node

Microsoft Azure Storage SDK for Node.js
JavaScript
495
star
77

Azure-TDSP-ProjectTemplate

TDSP: Data science project template repository with standardized directory structure and document templates to support efficient project execution and collaboration.
R
483
star
78

draft

A day 0 tool for getting your app on k8s fast
Go
475
star
79

azure-openai-samples

Azure OpenAI Samples is a collection of code samples illustrating how to use Azure Open AI in creating AI solution for various use cases across industries. This repository is mained by a community of volunters. We welcomed your contributions.
Jupyter Notebook
475
star
80

api-management-developer-portal

Developer portal provided by the Azure API Management service.
TypeScript
472
star
81

azure-mobile-services

Mobile Services is deprecated - Use Mobile Apps instead
HTML
472
star
82

MS-AMP

Microsoft Automatic Mixed Precision Library
Python
456
star
83

azure-sdk

This is the Azure SDK parent repository and mostly contains documentation around guidelines and policies as well as the releases for the various languages supported by the Azure SDK.
PowerShell
454
star
84

kubelogin

A Kubernetes credential (exec) plugin implementing azure authentication
Go
453
star
85

mlops-v2

Azure MLOps (v2) solution accelerators. Enterprise ready templates to deploy your machine learning models on the Azure Platform.
Shell
451
star
86

azure-devtestlab

Azure DevTestLab artifacts, scripts and samples
PowerShell
449
star
87

azure-devops-utils

Azure DevOps Utilities
Shell
447
star
88

app-service-announcements

Subscribe to this repo to be notified about major changes in App Service
446
star
89

azure-storage-net

Microsoft Azure Storage Libraries for .NET
C#
445
star
90

Azure-DataFactory

C#
444
star
91

azqr

Azure Quick Review
Go
443
star
92

azure-iot-sdk-csharp

A C# SDK for connecting devices to Microsoft Azure IoT services
C#
435
star
93

RDS-Templates

ARM Templates for Remote Desktop Services deployments
PowerShell
427
star
94

AzureDatabricksBestPractices

Version 1 of Technical Best Practices of Azure Databricks based on real world Customer and Technical SME inputs
427
star
95

actions-workflow-samples

Help developers to easily get started with GitHub Action workflows to deploy to Azure
Pug
426
star
96

arm-ttk

Azure Resource Manager Template Toolkit
PowerShell
423
star
97

actions

Author and use Azure Actions to automate your GitHub workflows
HTML
422
star
98

AI-in-a-Box

Jupyter Notebook
421
star
99

opendigitaltwins-dtdl

IoT Plug And Play
417
star
100

container-service-for-azure-china

Container Service for Azure China
Shell
415
star