Remove resource groups – Manage Azure identities and governance – AZ-104 Study Guide

Remove resource groups

In Azure, you can delete individual resources in a resource group, or you can delete a resource group and all its resources. Deleting a resource group also deletes all the resources contained within it in one operation. When deleting resource groups, exercise caution because the resource group might contain resources that other resources you have deployed depend on. For example, if you attempt to delete a storage account that is used by an application to store application data, the Azure platform will not recognize that dependency and will allow the storage account to be deleted.

For resources that have dependent resources, you will not be able to delete the target resource until the dependencies have been cleared. For example, to delete a resource group that contains an App Service plan, you must first remove or disassociate any App Service apps that depend on that plan. An example of attempting to delete an App Service plan with existing App Service app associations is shown in Figure 1-47.

FIGURE 1-47 Delete an Azure resource with dependencies

To delete a resource group, you can use the Azure portal, Azure PowerShell, the Azure CLI, or the REST API.

To delete a resource group in the Azure portal, browse to the resource group and click Delete Resource Group (see Figure 1-48).

FIGURE 1-48 Delete Resource Group option

In the Are You Sure You Want To Delete [“resource group name”]? dialog box that opens, you will need to type the resource group name to confirm that you want to delete it. As shown in Figure 1-49, the blade will also show the affected resources and warn you that the operation is irreversible.

FIGURE 1-49 Azure resource group deletion confirmation

Selecting Delete will begin deleting resources immediately. Note that it can take several minutes for a resource group to be deleted because each resource is deleted individually.

Manage Azure subscriptions

Azure subscriptions include controls that govern access to the resources within a subscription, govern cost through quotas and tagging, and govern the resources that are allowed in an environment with Azure Policy.

As discussed earlier, a subscription is a logical unit of Azure services linked to an Azure account, which is an identity in Entra ID. Entra ID is an identity provider for Azure and provides authentication to resources in an Azure subscription. The resources themselves then have

role-based access controls applied to them that provide authorization to the resources (see Figure 1-50).

FIGURE 1-50 Entra ID and Azure subscription relationship

There are multiple ways to obtain an Azure subscription, and a wide range of subscription types (or offers). Some common types include the following:

  • Free trial
  • Pay-As-You-Go/Web Direct
  • Visual Studio/MSDN subscriptions
  • Microsoft Resellers
  • Cloud Solution Provider
  • Microsoft Open Licensing
  • Enterprise Agreements

The capabilities of each subscription are similar in that each subscription type allows you to create and manage resources. Some subscription types have restrictions on supported resource types and locations. For example, Visual Studio subscriptions typically do not have a

credit card associated with them, which prevents you from purchasing services from the Azure

Marketplace, such as network virtual appliances. Visual Studio subscriptions for Azure only have access to a limited number of Azure regions. The regional restrictions for each offer can be viewed at https://azure.microsoft.com/regions/offers/.