你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

KeyVaultBackupClient class

KeyVaultBackupClient 提供了生成任何给定 Azure Key Vault 实例的备份和还原备份的方法。 此客户端支持生成完整备份、特定密钥的选择性还原和 Key Vault 实例的完整还原。

构造函数

KeyVaultBackupClient(string, TokenCredential, KeyVaultBackupClientOptions)

创建 KeyVaultBackupClient 的实例。

示例用法:

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

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

属性

vaultUrl

保管库的基 URL

方法

beginBackup(string, KeyVaultBeginBackupOptions)

使用用户分配的托管标识访问存储帐户,开始在指定的存储帐户上生成 Azure Key Vault 的备份。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到生成 Key Vault 备份。

示例用法:

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

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

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
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)

开始在指定的存储帐户上生成 Azure Key Vault 的备份。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到生成 Key Vault 备份。

示例用法:

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

const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultBackupClient(vaultUrl, 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);

启动完整备份作。

beginPreBackup(string, KeyVaultBeginPreBackupOptions)

启动预备份作,该作可用于检查客户是否可以使用托管 HSM 配置的用户分配的托管标识对 Azure 存储进行身份验证 beginBackup作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// Serializing the poller
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreBackup(blobStorageUri, { resumeFrom: serialized });

// Waiting until it's done
const result = await poller.pollUntilDone();
console.log(result);
beginPreBackup(string, string, KeyVaultBeginPreBackupOptions)

启动预备份作,该作可用于检查客户是否可以使用提供的 SAS 令牌执行 beginBackup作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// Serializing the poller
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreBackup(blobStorageUri, sasToken, { resumeFrom: serialized });

// Waiting until it's done
const result = await poller.pollUntilDone();
console.log(result);
beginPreRestore(string, KeyVaultBeginPreRestoreOptions)

启动一个预还原作,该作可用于检查客户是否可以使用提供的 SAS 令牌执行 beginRestore作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// The poller can be serialized with:
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });

// Waiting until it's done
await poller.pollUntilDone();
beginPreRestore(string, string, KeyVaultBeginPreRestoreOptions)

启动一个预还原作,该作可用于检查客户是否可以使用提供的 SAS 令牌执行 beginRestore作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// The poller can be serialized with:
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });

// Waiting until it's done
await poller.pollUntilDone();
beginRestore(string, KeyVaultBeginRestoreOptions)

使用指向以前存储的 Azure Blob 存储备份文件夹的 SAS 令牌开始还原所有密钥材料,并使用用户分配的托管标识访问存储帐户。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待 Key Vault 还原作完成。

示例用法:

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

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

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
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
await poller.pollUntilDone();

启动完全还原作。

beginRestore(string, string, KeyVaultBeginRestoreOptions)

使用指向以前存储的 Azure Blob 存储备份文件夹的 SAS 令牌开始还原所有密钥材料。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待 Key Vault 还原作完成。

示例用法:

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

const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultBackupClient(vaultUrl, 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 存储备份文件夹。 将使用用户分配的托管标识访问 Blob 存储备份文件夹。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到 Key Vault 选择性还原完成。

示例用法:

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

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

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

// Serializing the poller
const serialized = poller.toString();

// A new poller can be created with:
await client.beginSelectiveKeyRestore(keyName, blobStorageUri, { resumeFrom: serialized });

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

创建新的角色分配。

beginSelectiveKeyRestore(string, string, string, KeyVaultBeginSelectiveKeyRestoreOptions)

使用用户提供的 SAS 令牌开始还原给定密钥的所有密钥版本,该令牌指向以前存储的 Azure Blob 存储备份文件夹。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到 Key Vault 选择性还原完成。

示例用法:

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

const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultBackupClient(vaultUrl, 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 { DefaultAzureCredential } from "@azure/identity";
import { KeyVaultBackupClient } from "@azure/keyvault-admin";

const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
const credentials = new DefaultAzureCredential();
const 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)

使用用户分配的托管标识访问存储帐户,开始在指定的存储帐户上生成 Azure Key Vault 的备份。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到生成 Key Vault 备份。

示例用法:

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

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

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
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)

开始在指定的存储帐户上生成 Azure Key Vault 的备份。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到生成 Key Vault 备份。

示例用法:

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

const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultBackupClient(vaultUrl, 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

可选参数。

返回

beginPreBackup(string, KeyVaultBeginPreBackupOptions)

启动预备份作,该作可用于检查客户是否可以使用托管 HSM 配置的用户分配的托管标识对 Azure 存储进行身份验证 beginBackup作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// Serializing the poller
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreBackup(blobStorageUri, { resumeFrom: serialized });

// Waiting until it's done
const result = await poller.pollUntilDone();
console.log(result);
function beginPreBackup(blobStorageUri: string, options?: KeyVaultBeginPreBackupOptions): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>

参数

blobStorageUri

string

Blob 存储资源的 URL,包括备份最终将存储到的容器的路径。

options
KeyVaultBeginPreBackupOptions

可选参数。

返回

beginPreBackup(string, string, KeyVaultBeginPreBackupOptions)

启动预备份作,该作可用于检查客户是否可以使用提供的 SAS 令牌执行 beginBackup作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// Serializing the poller
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreBackup(blobStorageUri, sasToken, { resumeFrom: serialized });

// Waiting until it's done
const result = await poller.pollUntilDone();
console.log(result);
function beginPreBackup(blobStorageUri: string, sasToken: string, options?: KeyVaultBeginPreBackupOptions): Promise<PollerLike<KeyVaultBackupOperationState, KeyVaultBackupResult>>

参数

blobStorageUri

string

Blob 存储资源的 URL,包括备份最终将存储到的容器的路径。

sasToken

string

用于访问 Blob 存储资源的 SAS 令牌。

options
KeyVaultBeginPreBackupOptions

可选参数。

返回

beginPreRestore(string, KeyVaultBeginPreRestoreOptions)

启动一个预还原作,该作可用于检查客户是否可以使用提供的 SAS 令牌执行 beginRestore作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// The poller can be serialized with:
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });

// Waiting until it's done
await poller.pollUntilDone();
function beginPreRestore(folderUri: string, options?: KeyVaultBeginPreRestoreOptions): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>

参数

folderUri

string

存储上一次成功完整备份的 Blob 存储资源的 URL。

options
KeyVaultBeginPreRestoreOptions

可选参数。

返回

beginPreRestore(string, string, KeyVaultBeginPreRestoreOptions)

启动一个预还原作,该作可用于检查客户是否可以使用提供的 SAS 令牌执行 beginRestore作。

此函数返回一个长时间运行的作轮询器,该轮询器允许无限期等待作完成。

示例用法:

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

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

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

// The poller can be serialized with:
const serialized = poller.toString();

// A new poller can be created with:
await client.beginPreRestore(blobStorageUri, sasToken, { resumeFrom: serialized });

// Waiting until it's done
await poller.pollUntilDone();
function beginPreRestore(folderUri: string, sasToken: string, options?: KeyVaultBeginPreRestoreOptions): Promise<PollerLike<KeyVaultRestoreOperationState, KeyVaultRestoreResult>>

参数

folderUri

string

存储上一次成功完整备份的 Blob 存储资源的 URL。

sasToken

string

SAS 令牌。 如果未提供 SAS 令牌,则用户分配的托管标识将用于访问 Blob 存储资源。

options
KeyVaultBeginPreRestoreOptions

可选参数。

返回

beginRestore(string, KeyVaultBeginRestoreOptions)

使用指向以前存储的 Azure Blob 存储备份文件夹的 SAS 令牌开始还原所有密钥材料,并使用用户分配的托管标识访问存储帐户。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待 Key Vault 还原作完成。

示例用法:

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

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

const blobStorageUri = "<blob-storage-uri>"; // <Blob storage URL>/<folder name>
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
await poller.pollUntilDone();

启动完全还原作。

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

参数

folderUri

string

存储上一次成功完整备份的 Blob 存储资源的 URL。

options
KeyVaultBeginRestoreOptions

可选参数。

返回

beginRestore(string, string, KeyVaultBeginRestoreOptions)

使用指向以前存储的 Azure Blob 存储备份文件夹的 SAS 令牌开始还原所有密钥材料。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待 Key Vault 还原作完成。

示例用法:

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

const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultBackupClient(vaultUrl, 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 令牌,则用户分配的托管标识将用于访问 Blob 存储资源。

options
KeyVaultBeginRestoreOptions

可选参数。

返回

beginSelectiveKeyRestore(string, string, KeyVaultBeginSelectiveKeyRestoreOptions)

开始将给定密钥的所有密钥版本还原到以前存储的 Azure Blob 存储备份文件夹。 将使用用户分配的托管标识访问 Blob 存储备份文件夹。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到 Key Vault 选择性还原完成。

示例用法:

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

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

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

// Serializing the poller
const serialized = poller.toString();

// A new poller can be created with:
await client.beginSelectiveKeyRestore(keyName, blobStorageUri, { 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)

使用用户提供的 SAS 令牌开始还原给定密钥的所有密钥版本,该令牌指向以前存储的 Azure Blob 存储备份文件夹。

此函数返回一个长时间运行的作轮询程序,该轮询程序允许无限期等待,直到 Key Vault 选择性还原完成。

示例用法:

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

const vaultUrl = `https://<MY KEY VAULT HERE>.vault.azure.net`;
const credentials = new DefaultAzureCredential();
const client = new KeyVaultBackupClient(vaultUrl, 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 令牌,则用户分配的托管标识将用于访问 Blob 存储资源。

options
KeyVaultBeginSelectiveKeyRestoreOptions

可选参数。

返回