To delete a resource group in Azure that contains resources such as a network security group, public IP address, and load balancer, you can use one of the following methods:
Azure CLI
You can delete the resource group using the Azure CLI with the following command:
az group delete --name YourResourceGroupName --yes
PowerShell
If you prefer using PowerShell, you can execute the following command:
Remove-AzResourceGroup -Name YourResourceGroupName -Force
Azure Portal
Alternatively, you can delete the resource group through the Azure Portal:
- Sign in to the Azure portal.
- Navigate to Resource groups.
- Select the resource group you want to delete.
- Click on Delete resource group.
- Confirm the deletion by typing the name of the resource group and selecting Delete.
Make sure to replace YourResourceGroupName with the actual name of your resource group. This will remove the resource group along with all the resources it contains, helping you stop any ongoing costs associated with them.
References: