Update-AzDataProtectionBackupVault
更新屬於資源群組的BackupVault資源。 例如,更新資源的標記。
語法
Update-AzDataProtectionBackupVault
[-Token <String>]
[-AzureMonitorAlertsForAllJobFailure <AlertsState>]
[-CrossRegionRestoreState <CrossRegionRestoreState>]
[-CrossSubscriptionRestoreState <CrossSubscriptionRestoreState>]
[-IdentityType <String>]
[-IdentityUserAssignedIdentity <Hashtable>]
[-ImmutabilityState <ImmutabilityState>]
[-ResourceGuardOperationRequest <String[]>]
[-SoftDeleteRetentionDurationInDay <Double>]
[-SoftDeleteState <SoftDeleteState>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
-ResourceGroupName <String>
-VaultName <String>
[-SubscriptionId <String>]
[-CmkEncryptionState <EncryptionState>]
[-CmkIdentityType <IdentityType>]
[-CmkUserAssignedIdentityId <String>]
[-CmkEncryptionKeyUri <String>]
[-SecureToken <SecureString>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Update-AzDataProtectionBackupVault
-InputObject <IDataProtectionIdentity>
[-Token <String>]
[-AzureMonitorAlertsForAllJobFailure <AlertsState>]
[-CrossRegionRestoreState <CrossRegionRestoreState>]
[-CrossSubscriptionRestoreState <CrossSubscriptionRestoreState>]
[-EncryptionSetting <IEncryptionSettings>]
[-IdentityType <String>]
[-IdentityUserAssignedIdentity <Hashtable>]
[-ImmutabilityState <ImmutabilityState>]
[-ResourceGuardOperationRequest <String[]>]
[-SoftDeleteRetentionDurationInDay <Double>]
[-SoftDeleteState <SoftDeleteState>]
[-Tag <Hashtable>]
[-DefaultProfile <PSObject>]
[-AsJob]
[-NoWait]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
更新屬於資源群組的BackupVault資源。 例如,更新資源的標記。
範例
範例 1:將標籤新增至現有的備份保存庫
$tag = @{"Owner"="sarath";"Purpose"="AzureBackupTesting"}
Update-AzDataProtectionBackupVault -SubscriptionId "xxx-xxx-xxx" -ResourceGroupName sarath-rg -VaultName sarath-vault -Tag $tag
ETag IdentityPrincipalId IdentityTenantId IdentityType Location Name Type
---- ------------------- ---------------- ------------ -------- ---- ----
2ca1d5f7-38b3-4b61-aa45-8147d7e0edbc 72f988bf-86f1-41af-91ab-2d7cd011db47 SystemAssigned centraluseuap sarath-vault Microsoft.DataProtection/backupVaults
第一個命令會建立具有標籤及其值的新標籤哈希表。 第二個命令會將指定的標記新增至備份保存庫。
範例 2:停用作業失敗的 Azure 監視器警示
Update-AzDataProtectionBackupVault -ResourceGroupName "rgName" -VaultName "vaultName" -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -AzureMonitorAlertsForAllJobFailure 'Disabled'
Name Location Type IdentityType
---- -------- ---- ------------
vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned
此命令會停用備份保存庫所有作業失敗的監視警示。 允許的值為:Enabled、Disabled。 請注意,預設會啟用此設定。
範例 3:更新保存庫 ImmutabilityState、CrossSubscriptionRestoreState、虛刪除設定
Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CrossSubscriptionRestoreState Disabled -ImmutabilityState Disabled -SoftDeleteRetentionDurationInDay 99 -SoftDeleteState Off
Name Location Type IdentityType
---- -------- ---- ------------
vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned
此命令可用來修改保存庫的不變性狀態、跨訂用帳戶還原狀態、虛刪除設定。 這些參數是選擇性的,可以獨立使用。
範例 4:將保存庫 CmkIdentityType 從 UserAssignedManagedIdentity 更新為 SystemAssignedManagedIdentity 和 CmkEncryptionKeyUri
$cmkKeyUri = "https://samplekvazbckp.vault.azure.net/keys/testkey/3cd5235ad6ac4c11b40a6f35444bcbe1"
Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CmkIdentityType SystemAssigned -CmkEncryptionKeyUri $cmkKeyUri
Name Location Type IdentityType
---- -------- ---- ------------
vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned
此命令可用來修改 CmkIdentityType 和 CmkEncryptionKeyUri。 這些參數是選擇性的,可以獨立使用。
範例 5:將保存庫 CmkIdentityType 從 SystemAssignedManagedIdentity 更新為 UserAssignedManagedIdentity
$cmkIdentityId = "/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/resourcegroups/samplerg/providers/Microsoft.ManagedIdentity/userAssignedIdentities/sampleuami"
Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CmkIdentityType UserAssigned -CmkUserAssignedIdentityId $cmkIdentityId
Name Location Type IdentityType
---- -------- ---- ------------
vaultName southeastasia Microsoft.DataProtection/backupVaults UserAssigned
此命令用來將 CmkIdentityType 從 SystemAssigned 變更為 UserAssgined。 CmkIdenityId 是必要參數。
範例 6:更新保存庫以指派使用者指派的受控識別 (UAMI)
$UAMI = @{"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/userAssignedIdentityName"=[Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api40.UserAssignedIdentity]::new()}
$vault = Update-AzDataProtectionBackupVault -AssignUserIdentity $UAMI -SubscriptionId "00000000-0000-0000-0000-000000000000" -VaultName "vaultName" -ResourceGroupName "resourceGroupName" -IdentityType 'SystemAssigned,UserAssigned'
Name Location Type IdentityType
---- -------- ---- ------------
vaultName southeastasia Microsoft.DataProtection/backupVaults SystemAssigned, UserAssigned
首先,為使用者指派的受控識別 (UAMI) 物件建立哈希表。 此物件會將 UAMI 資源標識碼對應至 UserAssignedIdentity 的新實例。 接下來,使用 Update-AzDataProtectionBackupVault Cmdlet 將 UAMI 指派給備份保存庫,同時保留系統指派的受控識別。 -IdentityType 參數會指定使用 SystemAssigned 和 UserAssigned 身分識別。
參數
-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 |
-CmkUserAssignedIdentityId
如果身分識別類型為UserAssigned,則需要此參數。 新增使用者指派的受控識別標識碼,以用來具有 Key Vault 訪問許可權。
類型: | 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
DefaultProfile 參數無法運作。 如果針對不同的訂用帳戶執行 Cmdlet,請使用 SubscriptionId 參數。
類型: | PSObject |
別名: | AzureRMContext, AzureCredential |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-EncryptionSetting
客戶管理的資源金鑰詳細數據。 若要建構,請參閱 ENCRYPTIONSETTING 屬性的 NOTES 區段並建立哈希表。
類型: | IEncryptionSettings |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-IdentityType
identityType,可以是 SystemAssigned、UserAssigned、'SystemAssigned、UserAssigned' 或 None
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-IdentityUserAssignedIdentity
取得或設定使用者指派的身分識別。
類型: | Hashtable |
別名: | UserAssignedIdentity, AssignUserIdentity |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ImmutabilityState
保存庫的不變性狀態。 允許的值為 Disabled、Unlocked、Locked。
類型: | ImmutabilityState |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-InputObject
Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
類型: | IDataProtectionIdentity |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | True |
接受萬用字元: | False |
-NoWait
以異步方式執行命令
類型: | SwitchParameter |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGroupName
資源群組的名稱。 名稱不區分大小寫。
類型: | String |
Position: | Named |
預設值: | None |
必要: | True |
接受管線輸入: | False |
接受萬用字元: | False |
-ResourceGuardOperationRequest
將執行 LAC 檢查的 ResourceGuardOperationRequests
類型: | String[] |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-SecureToken
用來授權受跨租用戶資源防護保護之作業的參數。 使用命令 (Get-AzAccessToken -TenantId “xxxxxxxx-xxxx-xxxx-xxxx-xxxx-xxxxxx -AsSecureString”要擷取不同租用戶的授權令牌的令牌。
類型: | SecureString |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-SoftDeleteRetentionDurationInDay
虛刪除保留期間以天為單位。
類型: | Double |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-SoftDeleteState
保存庫的虛刪除狀態。 允許的值為 Off、On、AlwaysOn。
類型: | SoftDeleteState |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-SubscriptionId
目標訂用帳戶的標識碼。 此值必須是 UUID。
類型: | String |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Tag
資源標籤。
類型: | Hashtable |
Position: | Named |
預設值: | None |
必要: | False |
接受管線輸入: | False |
接受萬用字元: | False |
-Token
用來授權受跨租用戶資源防護保護之作業的參數。 使用命令 (Get-AzAccessToken -TenantId “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxx” 。要擷取不同租用戶的授權令牌的令牌。
類型: | String |
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 |