azure - 如何根据Azure中的部署名称删除所有已部署的资源

标签 azure azure-powershell azure-resource-manager azure-deployment azure-rm-template

我正在使用 ARM 模板配置新的 Azure 环境。 为了进行部署,我使用 Azure PowerShell New-AzureRmResourceGroupDeployment 命令,在其中指定 DeploymentNameResourceGroupName 等。

但是,当我想通过运行删除已部署的资源时

Remove-AzureRmResourceGroupDeployment -Name DeploymentName -ResourceGroupName RGname -Force 

它不会删除资源。它只是删除 Azure 门户中的“部署”选项卡中的标签。有没有办法回滚或删除相关资源的部署?我不想删除整个资源组。

最佳答案

Microsoft 的一般指导是资源组包含零个或多个共享共同生命周期的资源。因此,他们可能会告诉您将不同的部署分成不同的资源组。

我实际上已经尝试过与您之前相同的操作,但是删除部署只会删除部署元数据,而不是部署所配置的实际资源。能够根据他们所属的最新部署对资源进行“切片和切 block ”,这将是一个很好的功能请求。

这里是支持文档:

All of the resources in your group should share the same lifecycle. You will deploy, update and delete them together. If one resource, such as a database server, needs to exist on a different deployment cycle it should be in another resource group.

https://azure.microsoft.com/en-us/documentation/articles/resource-group-overview/#resource-groups

enter image description here

关于azure - 如何根据Azure中的部署名称删除所有已部署的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36211557/

相关文章:

azure - 如何获取azure VM的azure VMUUID?

java - 如何为 container.listBlobs() 和 blob.exists() 生成单个帐户 SAS

azure - 无法将类型 'System.__ComObject' 的 COM 对象强制转换为接口(interface)类型“IFabricNodeContextResult2”

azure-resource-manager - 如何以编程方式创建 API 管理服务?

Azure VM 操作系统构建 - Powershell

azure - 如何使用 Azure CLI 获取嵌套属性

azure - Elastic Azure Resource Manager模板中的Azure发现插件

Azure ARM Linux VM 公共(public) IP 和 Docker

mysql - 如何从 Azure MySQL DB 中两个不同数据库中的两个不同表进行批量更新?

azure - 如何在 Azure 中找到所有相关/依赖的资源?