共用方式為


New-AzDataProtectionBackupVault

建立或更新屬於資源群組的BackupVault資源。

語法

New-AzDataProtectionBackupVault
   -ResourceGroupName <String>
   -VaultName <String>
   -Location <String>
   -StorageSetting <IStorageSetting[]>
   [-SubscriptionId <String>]
   [-ETag <String>]
   [-IdentityType <String>]
   [-AzureMonitorAlertsForAllJobFailure <AlertsState>]
   [-ImmutabilityState <ImmutabilityState>]
   [-CrossRegionRestoreState <CrossRegionRestoreState>]
   [-CrossSubscriptionRestoreState <CrossSubscriptionRestoreState>]
   [-SoftDeleteRetentionDurationInDay <Double>]
   [-SoftDeleteState <SoftDeleteState>]
   [-Tag <Hashtable>]
   [-IdentityUserAssignedIdentity <Hashtable>]
   [-CmkEncryptionState <EncryptionState>]
   [-CmkInfrastructureEncryption <InfrastructureEncryptionState>]
   [-CmkIdentityType <IdentityType>]
   [-CmkUserAssignedIdentityId <String>]
   [-CmkEncryptionKeyUri <String>]
   [-DefaultProfile <PSObject>]
   [-AsJob]
   [-NoWait]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

建立或更新屬於資源群組的BackupVault資源。

範例

範例 1:建立新的備份保存庫

$sub = "xxxx-xxxx-xxxxx"
$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName sarath-rg -VaultName "MyVault" -StorageSetting $storagesetting -Location westus

ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name    Type
---- ------------------- ---------------- ------------ -------- ----    ----
                                                       westus   MyVault Microsoft.DataProtection/backupVaults

此命令會建立新的備份保存庫。

範例 2:使用 ImmutabilityState、CrossSubscriptionRestoreState、虛刪除設定建立新的備份保存庫

$sub = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
New-AzDataProtectionBackupVault -SubscriptionId $sub -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Location westus -StorageSetting $storagesetting -CrossSubscriptionRestoreState Enabled -ImmutabilityState Unlocked -SoftDeleteRetentionDurationInDay 100 -SoftDeleteState On

ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name    Type
---- ------------------- ---------------- ------------ -------- ----    ----
                                                       westus   MyVault Microsoft.DataProtection/backupVaults

此命令會在建立時設定保存庫的不變性狀態、跨訂用帳戶還原狀態、虛刪除保存庫設定時建立新的備份保存庫。

範例 3:使用 CMK 建立備份保存庫

$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant
$userAssignedIdentity = @{
    "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sampleuami" = @{
        clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        principalId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
    "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sampleuami2" = @{
        clientId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
        principalId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
}

$cmkIdentityId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sampleuami"

$cmkKeyUri = "https://samplekvazbckp.vault.azure.net/keys/testkey/3cd5235ad6ac4c11b40a6f35444bcbe1"

New-AzDataProtectionBackupVault -SubscriptionId xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -Location "location" -StorageSetting $storagesetting -IdentityType UserAssigned -UserAssignedIdentity $userAssignedIdentity -CmkEncryptionState Enabled -CmkIdentityType UserAssigned -CmkUserAssignedIdentityId $cmkIdentityId -CmkEncryptionKeyUri $cmkKeyUri -CmkInfrastructureEncryption Enabled

Name      Location   IdentityType
--------  --------   ------------
vaultName location   UserAssigned

此命令會建立已啟用 CMK 加密的備份保存庫

參數

-AsJob

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-AzureMonitorAlertsForAllJobFailure

啟用或停用內建 Azure 監視器失敗警示的參數。 無法停用安全性警示。

類型:AlertsState
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CmkEncryptionKeyUri

要用於加密之 CMK 金鑰的金鑰 URI。 若要啟用金鑰的自動輪替,請從金鑰 URI 中排除版本元件。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CmkEncryptionState

啟用備份保存庫的 CMK 加密狀態。

類型:EncryptionState
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CmkIdentityType

要用於 CMK 加密的身分識別類型 - SystemAssigned 或 UserAssigned Identity。

類型:IdentityType
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CmkInfrastructureEncryption

在此保存庫上使用 CMK 啟用基礎結構加密。 只有在建立保存庫時,才能設定基礎結構加密。

類型:InfrastructureEncryptionState
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CmkUserAssignedIdentityId

如果身分識別類型為UserAssigned,則需要此參數。 新增使用者指派的受控識別標識碼,以用於具有 金鑰保存庫 訪問許可權。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

執行 Cmdlet 之前先提示您確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CrossRegionRestoreState

保存庫的跨區域還原狀態。 允許的值為 Disabled、Enabled。

類型:CrossRegionRestoreState
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-CrossSubscriptionRestoreState

保存庫的跨訂用帳戶還原狀態。 允許的值為 Disabled、Enabled、PermanentlyDisabled。

類型:CrossSubscriptionRestoreState
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

類型:PSObject
別名:AzureRMContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ETag

選擇性 ETag。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-IdentityType

identityType 可以接受值 - “SystemAssigned”、“UserAssigned”、“SystemAssigned、UserAssigned”、“None”。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-IdentityUserAssignedIdentity

取得或設定使用者指派的身分識別。

類型:Hashtable
別名:UserAssignedIdentity
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ImmutabilityState

保存庫的不變性狀態。 允許的值為 Disabled、Unlocked、Locked。

類型:ImmutabilityState
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Location

資源位置。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-NoWait

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ResourceGroupName

備份保存庫的資源組名

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-SoftDeleteRetentionDurationInDay

以天為單位的虛刪除保留期間

類型:Double
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SoftDeleteState

保存庫的虛刪除狀態。 允許的值為 Off、On、AlwaysOn

類型:SoftDeleteState
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-StorageSetting

保存庫的記憶體設定。 使用 New-AzDataProtectionBackupVaultStorageSetting Cmdlet 來建立。 若要建構,請參閱 STORAGESETTING 屬性的 NOTES 區段並建立哈希表。

類型:IStorageSetting[]
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-SubscriptionId

保存庫的訂用帳戶標識碼

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Tag

資源標籤。

類型:Hashtable
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-VaultName

備份保存庫的名稱

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示執行 Cmdlet 後會發生的情況。 未執行 Cmdlet。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸出

PSObject