powershell - 无法删除 azure 恢复服务保管库

标签 powershell azure

很抱歉这篇文章很长:

我正在尝试清理我们的 Azure 帐户,但有几个旧保管库不允许我删除它们。我已经尝试了一些方法,但仍坚持从 Powershell 得到的一些响应。

首先尝试在 Azure 门户中删除保管库并收到以下消息:

Vault cannot be deleted as there are existing resources within the vault. Please ensure there are no backup items, protected servers or backup management servers associated with this vault. Unregister the following containers associated with this vault before proceeding for deletion :

环顾四周,微软表示要从保管库中删除该服务器。服务器仍然在线,但 azure 备份实用程序无法从我能找到的 azure 帐户中取消注册。我可以在服务器门户中点击删除按钮,但在确认删除后,它什么也不做,对象仍然存在。

查找 PowerShell 命令并在此处找到另一篇文章:

https://serverfault.com/questions/838463/azure-recoveryservicevault-cant-be-removed/839848#839848

但是前几个命令返回错误:

$vault = Get-AzureRmRecoveryServicesVault -Name "My Server Name"
Set-AzureRmRecoveryServicesVaultContext -Vault $vault

Set-AzureRmRecoveryServicesVaultContext : Cannot validate argument on parameter 'Vault'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again. At line:2 char:48 + Set-AzureRmRecoveryServicesVaultContext -Vault $vault + ~~~~~~ + CategoryInfo : InvalidData: (:) [Set-AzureRmRecoveryServicesVaultContext], ParameterBindingVa lidationException + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.Azure.Commands.RecoveryServices.Bac kup.Cmdlets.SetAzureRmRecoveryServicesVaultContext

technet 上的另一篇文章表示,如果它是较旧的备份保管库,请尝试不同的命令,这就是

$vault = Get-AzureRm​Recovery​Services​Backup​Container -Name "My Server Name"
Set-AzureRmRecoveryServicesVaultContext -Vault $vault

但是,我再次收到错误:

Get-​Azure​Rm​Recovery​Services​Backup​Container : The term 'Get-​Azure​Rm​Recovery​Services​Backup​Container' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:10 + $vault = Get-​Azure​Rm​Recovery​Services​Backup​Container -Name "WDSE ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (Get-​Azure​Rm​R...ackup​Container:String) [], CommandNotFound Exception + FullyQualifiedErrorId : CommandNotFoundException

我不知道从这里该去哪里,如果有任何建议,我将不胜感激。

这是我在门户中看到的备份项目以及如何处理它们的选项。

portal

谢谢

最佳答案

Vault cannot be deleted as there are existing resources within the vault. Please ensure there are no backup items, protected servers or backup management servers associated with this vault. Unregister the following containers associated with this vault before proceeding for deletion :

您可以按照以下步骤在保管库中查找现有资源:

  1. 找到您的恢复服务保管库,转到备份项目,您将看到当前保管库中的备份项目计数。 enter image description here
  2. 单击正在备份的 Azure 虚拟机,然后右键单击“...”停止备份。 enter image description here
  3. 完成停止备份后。您可以刷新项目并删除备份数据。 enter image description here

在该保管库中当前没有备份项目之前,您无法删除该保管库。希望对您有帮助。

更新

感谢您上传图片来澄清问题。我假设您通过 Azure 备份代理在本地服务器上有 D:\xxx 的备份,并且您想要删除恢复服务保管库以及该保管库中的相关资源备份。如果是这样,我建议执行以下步骤:

  1. 卸载绑定(bind)要删除的恢复服务保管库的 Azure 备份代理。在此之前,您需要停止计划备份并清理存储的备份。更多详情Uninstalling the Azure Backup agent
  2. 使用 Windows powershell,使用命令 Connect-AzureRmAccount 登录您的 Azure 门户帐户,运行以下命令来取消注册备份容器。有关命令的更多详细信息 here enter image description here

  3. 然后返回 Azure 门户,您应该会看到备份项目中没有任何项目。现在您可以在 Azure 门户中删除恢复服务保管库。

关于powershell - 无法删除 azure 恢复服务保管库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50729812/

相关文章:

Azure网站调试

node.js - PowerShell 与此 Unix 命令的等效命令

sharepoint - 在同一网站集中的文档库之间移动文件

Python + Azure 存储队列 receive_messages()

sql - 如何执行从 Azure 云数据库到本地服务器数据库的跨服务器查询

azure - 将 ASP.NET 5 vNext RC2 发布到 Azure 后出现错误和问题

azure - Azure 目录中应用程序的回调 URL

PowerShell安装模块命令没有失败但没有安装模块

c# - 通过 PowerShell 启动性能监视器数据收集器集?

azure - 热门获取 Azure 搜索服务查询 key