Wednesday, June 21, 2023

Azure Cloud shell commands cheetsheet

 Certainly! Here's a cheat sheet of commonly used Azure Cloud Shell commands:

Azure Account

  • az login: Authenticate and log in to your Azure account.
  • az account show: Show the details of the currently logged-in Azure account.
  • az account list: List all Azure subscriptions associated with your account.
  • az account set --subscription <subscription_id>: Set the active Azure subscription for the current session.

Resource Groups

  • az group create --name <group_name> --location <location>: Create a new resource group.
  • az group list: List all resource groups.
  • az group show --name <group_name>: Show details of a specific resource group.
  • az group delete --name <group_name>: Delete a resource group.

Virtual Machines

  • az vm create --resource-group <group_name> --name <vm_name> --image <image_name> --admin-username <username> --admin-password <password>: Create a new virtual machine.
  • az vm start --resource-group <group_name> --name <vm_name>: Start a virtual machine.
  • az vm stop --resource-group <group_name> --name <vm_name>: Stop a virtual machine.
  • az vm show --resource-group <group_name> --name <vm_name>: Show details of a virtual machine.

Azure Storage

  • az storage account create --name <account_name> --resource-group <group_name> --location <location> --sku Standard_LRS: Create a new Azure Storage account.
  • az storage account list: List all storage accounts.
  • az storage container create --name <container_name> --account-name <account_name> --account-key <account_key>: Create a new container in an Azure Storage account.
  • az storage blob upload --account-name <account_name> --account-key <account_key> --container-name <container_name> --type block --name <blob_name> --path <file_path>: Upload a file as a blob to an Azure Storage container.

Azure Web Apps

  • az webapp create --resource-group <group_name> --name <app_name> --plan <plan_name> --runtime <runtime>: Create a new Azure Web App.
  • az webapp list: List all web apps.
  • az webapp show --resource-group <group_name> --name <app_name>: Show details of a web app.
  • az webapp delete --resource-group <group_name> --name <app_name>: Delete a web app.

Remember, this is just a selection of commands. The Azure CLI offers many more commands to manage a wide range of Azure services. You can explore further commands and their options in the Azure CLI documentation: https://docs.microsoft.com/cli/azure/

No comments:

Azure Cloud shell commands cheetsheet

  Certainly! Here's a cheat sheet of commonly used Azure Cloud Shell commands: Azure Account az login : Authenticate and log in to your ...