Share via


KeyVaultBackupClient class

KeyVaultBackupClient には、特定の Azure Key Vault インスタンスのバックアップを生成し、バックアップを復元する方法が用意されています。 このクライアントでは、完全バックアップの生成、特定のキーの選択的復元、Key Vault インスタンスの完全復元がサポートされています。

コンストラクター

KeyVaultBackupClient(string, TokenCredential, KeyVaultBackupClientOptions)

KeyVaultBackupClient のインスタンスを作成します。

使用例:

import { KeyVaultBackupClient } from "@azure/keyvault-admin";
import { DefaultAzureCredential } from "@azure/identity";

let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
let credentials = new DefaultAzureCredential();

let client = new KeyVaultBackupClient(vaultUrl, credentials);

プロパティ

vaultUrl

コンテナーへのベース URL

メソッド

beginBackup(string, KeyVaultBeginBackupOptions)

ユーザー割り当てマネージド ID を使用してストレージ アカウントにアクセスし、指定したストレージ BLOB アカウントで Azure Key Vaultのバックアップの生成を開始します。

この関数は、Key Vault バックアップが生成されるまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginBackup(blobStorageUri);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginBackup(blobStorageUri, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全バックアップ操作を開始します。

beginBackup(string, string, KeyVaultBeginBackupOptions)

指定したストレージ BLOB アカウントで Azure Key Vaultのバックアップの生成を開始します。

この関数は、Key Vault バックアップが生成されるまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginBackup(blobStorageUri, sasToken);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全バックアップ操作を開始します。

beginRestore(string, KeyVaultBeginRestoreOptions)

ユーザー割り当てマネージド ID を使用してストレージ アカウントにアクセスし、以前に保存した Azure Blob Storage バックアップ フォルダーを指す SAS トークンを使用して、すべてのキーマテリアルの復元を開始します。

この関数は、Key Vault復元操作が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginRestore(blobStorageUri);

// The poller can be serialized with:
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginRestore(blobStorageUri, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全復元操作を開始します。

beginRestore(string, string, KeyVaultBeginRestoreOptions)

以前に格納された Azure Blob Storage バックアップ フォルダーを指す SAS トークンを使用して、すべてのキーマテリアルの復元を開始します。

この関数は、Key Vault復元操作が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginRestore(blobStorageUri, sasToken);

// The poller can be serialized with:
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全復元操作を開始します。

beginSelectiveKeyRestore(string, string, KeyVaultBeginSelectiveKeyRestoreOptions)

を使用して、特定のキーのすべてのキー バージョンを以前に格納された Azure Blob Storage バックアップ フォルダーに復元します。 Blob Storage バックアップ フォルダーには、ユーザー割り当てマネージド ID を使用してアクセスされます。

この関数は、Key Vault選択的復元が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>";
const sasToken = "<sas-token>";
const keyName = "<key-name>";
const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
await poller.pollUntilDone();

新しいロールの割り当てを作成します。

beginSelectiveKeyRestore(string, string, string, KeyVaultBeginSelectiveKeyRestoreOptions)

以前に格納された Azure Blob Storage バックアップ フォルダーを指すユーザー指定の SAS トークンを使用して、特定のキーのすべてのキー バージョンの復元を開始します。

この関数は、Key Vault選択的復元が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>";
const sasToken = "<sas-token>";
const keyName = "<key-name>";
const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
await poller.pollUntilDone();

新しいロールの割り当てを作成します。

コンストラクターの詳細

KeyVaultBackupClient(string, TokenCredential, KeyVaultBackupClientOptions)

KeyVaultBackupClient のインスタンスを作成します。

使用例:

import { KeyVaultBackupClient } from "@azure/keyvault-admin";
import { DefaultAzureCredential } from "@azure/identity";

let vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
let credentials = new DefaultAzureCredential();

let client = new KeyVaultBackupClient(vaultUrl, credentials);
new KeyVaultBackupClient(vaultUrl: string, credential: TokenCredential, options?: KeyVaultBackupClientOptions)

パラメーター

vaultUrl

string

Key Vaultの URL。 この図形は である必要があります。 https://${your-key-vault-name}.vault.azure.net この URL が有効なKey Vaultまたはマネージド HSM リソースを参照していることを検証する必要があります。 詳細については、https://aka.ms/azsdk/blog/vault-uri を参照してください。

credential
TokenCredential

サービスへの要求を TokenCredential 認証するために使用されるインターフェイスを実装する オブジェクト。 パッケージを @azure/identity 使用して、ニーズに合った資格情報を作成します。

options
KeyVaultBackupClientOptions

Key Vault API 要求を構成するために使用されるオプション。

プロパティの詳細

vaultUrl

コンテナーへのベース URL

vaultUrl: string

プロパティ値

string

メソッドの詳細

beginBackup(string, KeyVaultBeginBackupOptions)

ユーザー割り当てマネージド ID を使用してストレージ アカウントにアクセスし、指定したストレージ BLOB アカウントで Azure Key Vaultのバックアップの生成を開始します。

この関数は、Key Vault バックアップが生成されるまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginBackup(blobStorageUri);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginBackup(blobStorageUri, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全バックアップ操作を開始します。

function beginBackup(blobStorageUri: string, options?: KeyVaultBeginBackupOptions): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>

パラメーター

blobStorageUri

string

バックアップが最終的に格納されるコンテナーへのパスを含む、BLOB ストレージ リソースの URL。

options
KeyVaultBeginBackupOptions

省略可能なパラメーター。

戻り値

beginBackup(string, string, KeyVaultBeginBackupOptions)

指定したストレージ BLOB アカウントで Azure Key Vaultのバックアップの生成を開始します。

この関数は、Key Vault バックアップが生成されるまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginBackup(blobStorageUri, sasToken);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginBackup(blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全バックアップ操作を開始します。

function beginBackup(blobStorageUri: string, sasToken: string, options?: KeyVaultBeginBackupOptions): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>

パラメーター

blobStorageUri

string

バックアップが最終的に格納されるコンテナーへのパスを含む、BLOB ストレージ リソースの URL。

sasToken

string

BLOB ストレージ リソースへのアクセスに使用される SAS トークン。

options
KeyVaultBeginBackupOptions

省略可能なパラメーター。

戻り値

beginRestore(string, KeyVaultBeginRestoreOptions)

ユーザー割り当てマネージド ID を使用してストレージ アカウントにアクセスし、以前に保存した Azure Blob Storage バックアップ フォルダーを指す SAS トークンを使用して、すべてのキーマテリアルの復元を開始します。

この関数は、Key Vault復元操作が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginRestore(blobStorageUri);

// The poller can be serialized with:
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginRestore(blobStorageUri, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全復元操作を開始します。

function beginRestore(folderUri: string, options?: KeyVaultBeginRestoreOptions): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>

パラメーター

folderUri

string

以前に正常に完了した完全バックアップが格納された BLOB ストレージ リソースの URL。

options
KeyVaultBeginRestoreOptions

省略可能なパラメーター。

戻り値

beginRestore(string, string, KeyVaultBeginRestoreOptions)

以前に格納された Azure Blob Storage バックアップ フォルダーを指す SAS トークンを使用して、すべてのキーマテリアルの復元を開始します。

この関数は、Key Vault復元操作が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
const sasToken = "<sas-token>";
const poller = await client.beginRestore(blobStorageUri, sasToken);

// The poller can be serialized with:
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginRestore(blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
const backupUri = await poller.pollUntilDone();
console.log(backupUri);

完全復元操作を開始します。

function beginRestore(folderUri: string, sasToken: string, options?: KeyVaultBeginRestoreOptions): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>

パラメーター

folderUri

string

以前に正常に完了した完全バックアップが格納された BLOB ストレージ リソースの URL。

sasToken

string

SAS トークン。 SAS トークンが指定されていない場合は、ユーザー割り当てマネージド ID を使用して BLOB ストレージ リソースにアクセスします。

options
KeyVaultBeginRestoreOptions

省略可能なパラメーター。

戻り値

beginSelectiveKeyRestore(string, string, KeyVaultBeginSelectiveKeyRestoreOptions)

を使用して、特定のキーのすべてのキー バージョンを以前に格納された Azure Blob Storage バックアップ フォルダーに復元します。 Blob Storage バックアップ フォルダーには、ユーザー割り当てマネージド ID を使用してアクセスされます。

この関数は、Key Vault選択的復元が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>";
const sasToken = "<sas-token>";
const keyName = "<key-name>";
const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
await poller.pollUntilDone();

新しいロールの割り当てを作成します。

function beginSelectiveKeyRestore(keyName: string, folderUri: string, options?: KeyVaultBeginSelectiveKeyRestoreOptions): Promise<PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>>

パラメーター

keyName

string

復元するキーの名前。

folderUri

string

BLOB ストレージ リソースの URL。以前に正常に完了した完全バックアップが格納された BLOB のフォルダー名。

options
KeyVaultBeginSelectiveKeyRestoreOptions

省略可能なパラメーター。

戻り値

beginSelectiveKeyRestore(string, string, string, KeyVaultBeginSelectiveKeyRestoreOptions)

以前に格納された Azure Blob Storage バックアップ フォルダーを指すユーザー指定の SAS トークンを使用して、特定のキーのすべてのキー バージョンの復元を開始します。

この関数は、Key Vault選択的復元が完了するまで無期限に待機できる実行時間の長い操作ポーリング を返します。

使用例:

const client = new KeyVaultBackupClient(url, credentials);

const blobStorageUri = "<blob-storage-uri>";
const sasToken = "<sas-token>";
const keyName = "<key-name>";
const poller = await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken);

// Serializing the poller
//
//   const serialized = poller.toString();
//
// A new poller can be created with:
//
//   await client.beginSelectiveKeyRestore(keyName, blobStorageUri, sasToken, { resumeFrom: serialized });
//

// Waiting until it's done
await poller.pollUntilDone();

新しいロールの割り当てを作成します。

function beginSelectiveKeyRestore(keyName: string, folderUri: string, sasToken: string, options?: KeyVaultBeginSelectiveKeyRestoreOptions): Promise<PollerLike<KeyVaultSelectiveKeyRestoreOperationState, KeyVaultSelectiveKeyRestoreResult>>

パラメーター

keyName

string

復元するキーの名前。

folderUri

string

BLOB ストレージ リソースの URL。以前に正常に完了した完全バックアップが格納された BLOB のフォルダー名。

sasToken

string

SAS トークン。 SAS トークンが指定されていない場合は、ユーザー割り当てマネージド ID を使用して BLOB ストレージ リソースにアクセスします。

options
KeyVaultBeginSelectiveKeyRestoreOptions

省略可能なパラメーター。

戻り値