
The Azure CLI is a powerful tool for managing Azure resources, and knowing the right commands can save you a lot of time and effort.
One of the most useful Azure CLI commands is az group, which allows you to create, delete, and update resource groups.
The az group command can be used to create a new resource group with a specific name and location.
You can also use the az group command to delete a resource group, which can be useful when you're cleaning up old or unused resources.
The az resource command is another essential Azure CLI command, allowing you to create, update, and delete resources within a resource group.
With the az resource command, you can create a new resource with a specific name, type, and properties.
You can also use the az resource command to update an existing resource, which can be useful when you need to change a resource's properties.
See what others are reading: Windows Azure Powershell Commands
The az deployment command is used to create and manage deployments of resources within a resource group.
You can use the az deployment command to create a new deployment with a specific template and parameters.
The az provider command is used to register and update providers, which are essential for creating and managing resources.
You can use the az provider command to register a new provider, such as the Microsoft.Compute provider.
The az policy command is used to create, update, and delete policies, which can be used to enforce compliance and governance within your Azure resources.
You can use the az policy command to create a new policy with a specific definition and scope.
The az role assignment command is used to create, update, and delete role assignments, which are used to grant permissions to users and groups.
You can use the az role assignment command to create a new role assignment with a specific role and scope.
Consider reading: Important Commands in Command Prompt
Resource Management
Resource Management is a crucial aspect of Azure CLI commands, allowing you to manage resources efficiently.
You can use the `az resource` command to create, update, or delete resources, such as virtual machines or storage accounts. The `--resource-group` option is used to specify the resource group where the resource will be created or updated.
To manage resource groups, you can use the `az group` command, which allows you to create, update, or delete resource groups. This command also supports options like `--name` and `--location` to specify the name and location of the resource group.
Recommended read: Check Azure Ad Join Status
Resource Management
Resource management is all about making the most of what you have. A well-managed resource is one that's used efficiently and effectively.
Effective resource management starts with clear goals and objectives, just like the example in the "Setting Goals" section. This helps ensure that resources are allocated towards what's truly important.
Having a clear plan in place helps prevent resource waste, which can be a major issue in any organization. According to the "Waste Reduction" section, a staggering 30% of resources are often wasted due to poor planning.
You might enjoy: Azure Resource

Proper resource allocation is essential for achieving goals. In the "Prioritization" section, we learned that prioritizing tasks based on their urgency and importance can help allocate resources more effectively.
Resource management also involves tracking and monitoring resource usage. The "Tracking Resource Usage" section highlights the importance of regular monitoring to identify areas for improvement.
By implementing these resource management strategies, organizations can optimize their resource usage and achieve greater success.
Global Arguments
Global Arguments are a set of common flags that can be used with most Azure CLI commands.
These flags are available for most commands, making it easier to work with Azure resources. The --help flag is a great place to start, as it prints CLI reference information about commands and their arguments.
You can use the --output flag to change the output format, which is json by default. The available output formats are json, jsonc, tsv, table, and yaml.
To filter the output returned from Azure services, use the --query flag and the JMESPath query language. This is especially useful for getting specific information from large datasets.
Expand your knowledge: Azure Auth Json Website Azure Ad Authentication

The --verbose flag is useful for printing information about resources created in Azure during an operation. You can also use the --debug flag to print even more information, which can be helpful for debugging purposes.
If you're working with multiple subscriptions, use the --subscription flag to specify the name or ID of the subscription you want to use. To suppress warnings in command output and only show errors, use the --only-show-errors flag.
Here are the global arguments at a glance:
- --help: prints CLI reference information
- --output: changes the output format
- --query: filters the output with JMESPath
- --verbose: prints information about resources created
- --debug: prints even more information for debugging
- --subscription: specifies the subscription to use
- --only-show-errors: suppresses warnings and shows only errors
Compute
You can use the `az vmss` command to perform various operations on Virtual Machine Scale Sets. This command can be used to change the size of a virtual machine, troubleshoot Azure Kubernetes Service clusters or nodes in a failed state, and even explore Azure Hybrid Benefit for Windows VMs.
Some of the specific tasks you can accomplish with `az vmss` include creating a Virtual Machine Scale Set that uses Availability Zones, using the Application Health extension with Virtual Machine Scale Sets, and encrypting OS and attached data disks.
Here are some of the specific tasks you can accomplish with `az vmss`:
Compute
Azure Virtual Machine Scale Sets (VMSS) are a powerful compute resource that can be managed using the Azure CLI. You can change the size of a virtual machine using the `az vmss` command.
One of the key benefits of VMSS is the ability to automatically upgrade the operating system image. This can be done using the `az vmss rolling-upgrade` command, which allows you to configure rolling upgrades on Virtual Machine Scale Sets.
Virtual Machine Scale Sets can also be used to troubleshoot issues with the Log Analytics agent for Windows. This can be achieved using the `az vmss run-command` command, which allows you to run commands on virtual machines in a scale set.
In addition to these features, VMSS also supports the use of Availability Zones, which can help improve the availability and reliability of your virtual machines. This can be achieved using the `az vmss create` command, which allows you to create a Virtual Machine Scale Set that uses Availability Zones.
Here are some key benefits of using VMSS:
- Automatic OS image upgrades
- Rolling upgrades
- Troubleshooting with Log Analytics agent
- Availability Zones support
These features make VMSS a great option for managing and scaling your virtual machines in Azure.
Virtual Machines
Virtual machines are software emulations of physical machines that run on top of an operating system. They allow for multiple operating systems to run on a single physical host.
Virtualization is a key benefit of virtual machines, enabling multiple virtual machines to share the same physical resources.
A virtual machine can be created in just a few minutes, making it a flexible and efficient way to deploy applications.
Virtual machines can be paused and resumed, allowing for easy management and maintenance.
This flexibility makes virtual machines ideal for testing and development environments.
Container Instances
Container Instances are a great way to run applications in a flexible and scalable way. They allow you to run your application in a container, which is essentially a lightweight and portable package that includes everything your application needs to run.
Each Container Instance is a unique, isolated environment that can be scaled independently of other resources. This means you can easily adjust the number of instances to match changing demands on your application.
Worth a look: Docker Azure Cli Container
Container Instances can be easily managed using the Container Instances API, which allows you to create, update, and delete instances as needed. This makes it simple to automate the management of your containers and ensure they're always running smoothly.
You can also use Container Instances with other Azure services, such as Azure Storage and Azure Networking, to create a complete end-to-end solution for your application. This integration makes it easy to build and deploy complex applications that require multiple services to function.
Related reading: Azure Containers
Kubernetes
Kubernetes is a container orchestration system that automates the deployment, scaling, and management of containerized applications. It provides a single interface to manage and deploy applications across multiple environments.
Kubernetes was originally designed by Google and is now maintained by the Cloud Native Computing Foundation. It's an open-source platform that enables developers to deploy and manage containerized applications more efficiently.
Kubernetes provides a declarative configuration model, which means that users describe what they want to deploy, and the system takes care of the rest. This approach simplifies the deployment process and reduces the risk of human error.
Kubernetes supports a wide range of container runtimes, including Docker, rkt, and cri-o. It also provides a rich set of APIs and tools for managing and monitoring containerized applications.
Storage
Storage is a crucial aspect of Azure, and the Azure CLI provides various commands to manage and interact with storage accounts. You can use the `az storage account` command to list all storage accounts in the current subscription.
To create a new storage account, you'll need to specify the resource group name, storage account name, valid Azure location, and type (SkuName). The Azure CLI supports several storage account types, including Standard_LRS, Standard_ZRS, Standard_GRS, Standard_RAGRS, and Premium_LRS.
Here are some common storage-related tasks you can perform using the Azure CLI:
Remember to check the documentation for the specific command and options you need to use.
Storage
Storage is a crucial part of any cloud infrastructure, and Azure's storage options are quite impressive.
Azure offers four main storage options: Standard_LRS, Standard_ZRS, Standard_GRS, and Standard_RAGRS. Each of these options provides a different level of redundancy and availability.
You can list all storage accounts in your current subscription using the Azure CLI command `az storage account list`. This can be a great way to keep track of your storage resources.
Curious to learn more? Check out: Azure Cli Upload File to Blob Storage

Azure's storage options include premium locally-redundant storage, which is ideal for high-performance workloads. This option is denoted by the SKU name `Premium_LRS`.
Here are the four main storage options available in Azure:
Azure's storage options can be used for a variety of purposes, including expanding virtual hard disks on a Linux VM and creating and using volumes with Azure Disks in Azure Kubernetes Service (AKS).
File Storage
File storage is a crucial aspect of any computer system. With the average person having over 300,000 digital files, it's essential to have a reliable storage solution.
External hard drives can be an affordable option for storing large amounts of data, with prices starting at around $50 for a 1TB drive. This can be a good backup solution for your computer files.
Cloud storage is another popular option, with services like Google Drive and Dropbox offering free storage space. For example, Google Drive offers 15GB of free storage space for individuals.
Local storage on your computer or device is also an option, with solid-state drives (SSDs) offering faster speeds than traditional hard disk drives (HDDs). SSDs can provide a significant boost in performance, especially for tasks that require quick access to data.
External storage devices, like USB drives and memory cards, can be used to transfer files between devices. These devices are often small and portable, making them easy to take on the go.
Suggestion: Azure Devices
Sources
- https://learn.microsoft.com/en-us/cli/azure/reference-index
- https://learn.microsoft.com/en-us/cli/azure/resource
- https://learn.microsoft.com/en-us/cli/azure/reference-docs-index
- https://medium.com/@morsi.masmoudi/essential-azure-powershell-and-cli-commands-0895c3d8bec9
- https://learn.microsoft.com/en-us/cli/azure/get-started-with-azure-cli
Featured Images: pexels.com