我正在使用 ARM 模板配置新的 Azure 环境。
为了进行部署,我使用 Azure PowerShell New-AzureRmResourceGroupDeployment
命令,在其中指定 DeploymentName
、 ResourceGroupName
等。
但是,当我想通过运行删除已部署的资源时
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
关于azure - 如何根据Azure中的部署名称删除所有已部署的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36211557/