Sign inSign up

toolkitbox/azure-cli

By toolkitbox

Updated 23 days ago

DevOps toolkit - azure-cli client

Image
0

1.2K

toolkitbox/azure-cli repository overview

Azure CLI

GitHub Stars GitHub Issues Docker Pulls

📢 Found an issue or want to request a new tool? Open an issue on GitHub

Command line client for Microsoft Azure.

Quick Start

Docker
# Interactive mode
docker run -it --rm \
  ghcr.io/pabpereza/toolkitbox/azure-cli:latest

# Login interactively
docker run -it --rm \
  -v ~/.azure:/root/.azure \
  ghcr.io/pabpereza/toolkitbox/azure-cli:latest \
  az login

# Run single command with cached credentials
docker run --rm \
  -v ~/.azure:/root/.azure \
  ghcr.io/pabpereza/toolkitbox/azure-cli:latest \
  az account list
Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: azure-cli-client
spec:
  containers:
  - name: azure-cli-client
    image: ghcr.io/pabpereza/toolkitbox/azure-cli:latest
    command: ["sleep", "infinity"]
    env:
    - name: AZURE_CLIENT_ID
      valueFrom:
        secretKeyRef:
          name: azure-credentials
          key: client-id
    - name: AZURE_CLIENT_SECRET
      valueFrom:
        secretKeyRef:
          name: azure-credentials
          key: client-secret
    - name: AZURE_TENANT_ID
      valueFrom:
        secretKeyRef:
          name: azure-credentials
          key: tenant-id

Description

Azure CLI is a cross-platform command-line tool for managing Azure resources. It provides commands for working with Azure services including virtual machines, storage, networking, databases, and more.

Installation

This component installs Azure CLI via pip on Alpine Linux.

Basic Usage

# Login to Azure
az login

# List subscriptions
az account list

# Set default subscription
az account set --subscription "My Subscription"

# List resource groups
az group list

# Create a resource group
az group create --name myResourceGroup --location eastus

# List VMs
az vm list

# Get help
az --help

Common Options

OptionDescription
--subscriptionName or ID of subscription
--resource-group, -gName of resource group
--output, -oOutput format (json, table, tsv, yaml)
--queryJMESPath query string
--verboseIncrease logging verbosity
--debugShow all debug logs

Service Principal Authentication

For non-interactive authentication (CI/CD, scripts):

# Login with service principal
az login --service-principal \
  --username $AZURE_CLIENT_ID \
  --password $AZURE_CLIENT_SECRET \
  --tenant $AZURE_TENANT_ID

Official Documentation

Tag summary

Content type

Image

Digest

sha256:dfbdfec43

Size

136.2 MB

Last updated

23 days ago

docker pull toolkitbox/azure-cli