適用於 Node.js 的 Azure 備份模組Azure Backup Modules for Node.js

概觀Overview

Azure 備份是您可用來備份 (或保護) 和還原 Microsoft Cloud 資料的 Azure 服務。Azure Backup is the Azure-based service you can use to back up (or protect) and restore your data in the Microsoft cloud. Azure 備份將以一個可靠、安全及具成本競爭力的雲端架構解決方案,取代您現有的內部部署或異地備份解決方案。Azure Backup replaces your existing on-premises or off-site backup solution with a cloud-based solution that is reliable, secure, and cost-competitive. Azure 備份提供多個元件,您可以下載並部署在適當的電腦、伺服器或雲端中。Azure Backup offers multiple components that you download and deploy on the appropriate computer, server, or in the cloud. 您部署的元件或代理程式,取決於您想要保護的項目。The component, or agent, that you deploy depends on what you want to protect. 所有 Azure 備份的元件 (無論您要保護的是內部部署或雲端資料) 都可以將資料備份至 Azure 中的復原服務保存庫。All Azure Backup components (no matter whether you're protecting data on-premises or in the cloud) can be used to back up data to a Recovery Services vault in Azure.

管理封裝Management package

使用 npm 安裝模組Install the modules with npm

使用 npm 來安裝適用於 Node.js 的 Azure 備份模組Use npm to install the Azure Backup modules for Node.js

npm install azure-arm-recoveryservicesbackup

範例Example

此範例會列出指定之保存庫與資源群組的復原作業。This example lists the recovery jobs for a given vault and resource group.

const msRestAzure = require('ms-rest-azure');
const RecoveryServicesBackupManagement = require('azure-arm-recoveryservicesbackup');

const subcriptionId = 'your-subscription-id';
const vault = 'your-recovery-service-vault';
const resourceGroupName = 'your-resource-group';

msRestAzure
  .interactiveLogin()
  .then(credentials => {
    const client = new RecoveryServicesBackupManagement(
      credentials,
      subcriptionId
    );
    return client.jobs.list(vault, resourceGroupName);
  })
  .then(jobs => console.dir(jobs, { depth: null, colors: true }))
  .catch(err => console.log(err));

範例Samples

深入探索可在應用程式中使用的 Node.js 程式碼範例Explore more sample Node.js code you can use in your apps.