How to remove all deployed resources based on deployment name in Azure

I am working on creating a new Azure environment using ARM patterns. For deployment, I use the Azure PowerShell command New-AzureRmResourceGroupDeployment, where I specify DeploymentName, ResourceGroupNameetc.

However, when I want to remove deployed resources by running

Remove-AzureRmResourceGroupDeployment -Name DeploymentName -ResourceGroupName RGname -Force 

it does not delete resources. It simply removes the tag from the deployment tab in the Azure portal. Is there a way to roll back or remove a deployment with related resources? I do not want to delete the entire resource group.

+4
source share
3 answers

, ... .

:

(Get-AzureRmResourceGroupDeploymentOperation -DeploymentName $DeploymentName -ResourceGroupName $RGName).Properties.ProvisioningOperation

(Get-AzureRmResourceGroupDeploymentOperation -DeploymentName $DeploymentName -ResourceGroupName $RGName).Properties.TargetResource.id

, , Id, :

Remove-AzureRMResource

, .

, . , ( ..). , , "" ...

+1

,

Azure PowerShell:

Remove-AzureRmResourceGroup [-Name] <ResourceGroupName> [-Force <SwitchParameter>]

Remove-AzureRmResourceGroupDeployment , .

, !

-1

All Articles