Summary

Completed

In this module, we wrote a script to automate creating multiple VMs. Even though the script was relatively short, you can see the potential power when you combine loops, variables, and functions from PowerShell with cmdlets from Azure PowerShell.

Azure PowerShell is a good automation choice for admins with PowerShell experience. The combination of clean syntax and a powerful scripting language also makes it worth considering even if you're new to PowerShell. This level of automation for time-consuming and error-prone tasks should help you reduce administrative time and increase quality.

Clean up

The sandbox automatically cleans up your resources when you're finished with this module.

When you're working in your own subscription, it's a good idea at the end of a project to identify whether you still need the resources you created. Resources that you leave running can cost you money. You can delete resources individually or delete the resource group to delete the entire set of resources.

When you're running in your own subscription, you can use the following PowerShell cmdlet to delete the resource group and all related resources (replacing MyResourceGroupName with the resource group you created).

Remove-AzResourceGroup -Name MyResourceGroupName

When you're asked to confirm the delete, answer Yes, or you can add the -Force parameter to skip the prompt. The command might take several minutes to complete.

Check your knowledge

1.

True or false: The Azure portal, the Azure CLI, and Azure PowerShell offer significantly different services, so it's unlikely that all three will support the operation you need.

2.

Suppose you're building a video-editing application that will offer online storage for user-generated video content. You'll store the videos in Azure Blobs, so you need to create an Azure storage account to contain the blobs. Once the storage account is in place, it's unlikely you would remove and recreate it because all the user videos would be deleted. Which tool is likely to offer the quickest and easiest way to create the storage account?

3.

What needs to be installed on your machine to let you execute Azure PowerShell cmdlets locally?