Creating administration scripts is a powerful way to optimize your work flow. You can automate common, repetitive tasks, and once a script has been verified, it will run consistently, likely reducing errors.

Suppose you work at a company that uses Azure Virtual Machines (VMs) to test your Customer Relationship Management (CRM) software. The VMs are built from images that include a web front-end, a web service that implements business logic, and a SQL database.

You have been executing multiple rounds of tests on a single VM but noticed that changes in the database and configuration files can cause inconsistent results. In one case, a bug created a phone call record with no corresponding customer in the database. The orphaned record caused subsequent integration tests to fail even after the bug was fixed. You plan to solve this problem by using a fresh VM deployment for each testing cycle. You want to automate the VM creation setup because it will be executed many times per week.

Here, you will see how to manage Azure resources using Azure PowerShell. You will use Azure PowerShell interactively for one-off tasks and write scripts to automate repeated tasks.

Learning objectives

In this module, you will:

  • Decide if Azure PowerShell is the right tool for your Azure administration tasks
  • Install Azure PowerShell on Linux, macOS, and/or Windows
  • Connect to an Azure subscription using Azure PowerShell
  • Create Azure resources using Azure PowerShell


  • Experience with a command-line interface such as PowerShell or Bash
  • Knowledge of basic Azure concepts such as resource groups and Virtual Machines
  • Experience administering Azure resources using the Azure portal