用于 .NET 的 Azure 恢复服务和备份库

概述

Azure 恢复服务是一套数据恢复服务,包括 Azure 备份Azure Site Recovery

管理库

直接从 Visual Studio 包管理器控制台或使用 .NET Core CLI 安装 NuGet 包

Visual Studio 包管理器

Install-Package Microsoft.Azure.Management.RecoveryServices
Install-Package Microsoft.Azure.Management.RecoveryServices.Backup

.NET Core CLI

dotnet add package Microsoft.Azure.Management.RecoveryServices
dotnet add package Microsoft.Azure.Management.RecoveryServices.Backup

代码示例

以下代码示例使用管理库来触发备份。

RecoveryServicesBackupManagementClient client = new RecoveryServicesBackupManagementClient(credentials);
TriggerBackupRequest triggerBackupRequest = new TriggerBackupRequest();
BaseRecoveryServicesJobResponse resp =
    await client.Backups.TriggerBackupAsync(resourceGroupName, resourceName, null,
        fabricName, containerName, protectedItemName, triggerBackupRequest);