New-AzDataProtectionBackupVault
创建或更新属于资源组的 BackupVault 资源。
语法
Default (默认值)
New-AzDataProtectionBackupVault
-ResourceGroupName <String>
-VaultName <String>
-Location <String>
-StorageSetting <IStorageSetting[]>
[-SubscriptionId <String>]
[-ETag <String>]
[-EnableSystemAssignedIdentity]
[-AzureMonitorAlertsForAllJobFailure <String>]
[-ImmutabilityState <String>]
[-CrossRegionRestoreState <String>]
[-CrossSubscriptionRestoreState <String>]
[-SoftDeleteRetentionDurationInDay <Double>]
[-SoftDeleteState <String>]
[-Tag <Hashtable>]
[-UserAssignedIdentity <String[]>]
[-CmkEncryptionState <String>]
[-CmkInfrastructureEncryption <String>]
[-CmkIdentityType <String>]
[-CmkUserAssignedIdentityId <String>]
[-CmkEncryptionKeyUri <String>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
说明
创建或更新属于资源组的 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","/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sampleuami2"
$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 -UserAssignedIdentity $userAssignedIdentity -CmkEncryptionState Enabled -CmkIdentityType UserAssigned -CmkUserAssignedIdentityId $cmkIdentityId -CmkEncryptionKeyUri $cmkKeyUri -CmkInfrastructureEncryption Enabled
Name Location IdentityType
-------- -------- ------------
vaultName location UserAssigned
此命令创建启用了 CMK 加密的备份保管库
参数
-AsJob
创建或更新属于资源组的 BackupVault 资源。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-AzureMonitorAlertsForAllJobFailure
用于启用或禁用内置 Azure Monitor 警报的参数,说明作业失败。
无法禁用安全警报。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CmkEncryptionKeyUri
要用于加密的 CMK 密钥的密钥 URI。
若要启用密钥的自动轮换,请从密钥 URI 中排除版本组件。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CmkEncryptionState
为备份保管库启用 CMK 加密状态。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CmkIdentityType
用于 CMK 加密的标识类型 - SystemAssigned 或 UserAssigned Identity。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CmkInfrastructureEncryption
在此保管库上使用 CMK 启用基础结构加密。
仅当创建保管库时,才必须配置基础结构加密。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CmkUserAssignedIdentityId
如果标识类型为 UserAssigned,则此参数是必需的。
添加用户分配的托管标识 ID,以用于对密钥保管库具有访问权限。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Confirm
在运行 cmdlet 之前,提示你进行确认。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CrossRegionRestoreState
保管库的跨区域还原状态。
允许的值为 Disabled、Enabled。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-CrossSubscriptionRestoreState
保管库的跨订阅还原状态。
允许的值为 Disabled、Enabled、PermanentlyDisabled。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-DefaultProfile
创建或更新属于资源组的 BackupVault 资源。
参数属性
类型: PSObject
默认值: None
支持通配符: False
不显示: False
别名: AzureRMContext, AzureCredential
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-EnableSystemAssignedIdentity
确定是否为资源启用系统分配的标识。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ETag
可选 ETag。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ImmutabilityState
保管库的不可变状态。
允许的值为 Disabled、Unlocked、Locked。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Location
资源位置。
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-NoWait
创建或更新属于资源组的 BackupVault 资源。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-ResourceGroupName
备份保管库的资源组名称
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-SoftDeleteRetentionDurationInDay
软删除保留期(以天为单位)
参数属性
类型: Double
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-SoftDeleteState
保管库的软删除状态。
允许的值为 Off、On、AlwaysOn
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-StorageSetting
保管库的存储设置。
使用 New-AzDataProtectionBackupVaultStorageSetting Cmdlet 创建。
参数属性
类型: Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.IStorageSetting [ ]
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-SubscriptionId
保管库的订阅 ID
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-Tag
资源标记。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-UserAssignedIdentity
与资源关联的用户分配标识的数组。
数组中的元素将为 ARM 资源 ID,格式为:“/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft。ManagedIdentity/userAssignedIdentities/{identityName}。”
参数属性
类型: String [ ]
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-VaultName
备份保管库的名称
参数属性
类型: String
默认值: None
支持通配符: False
不显示: False
参数集
(All)
Position: Named
必需: True
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
-WhatIf
显示 cmdlet 运行时会发生什么情况。
命令脚本未运行。
参数属性
参数集
(All)
Position: Named
必需: False
来自管道的值: False
来自管道的值(按属性名称): False
来自剩余参数的值: False
CommonParameters
此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters 。
输出