From 97c363f0d8ff721601d19c96f766af116a47ea6e Mon Sep 17 00:00:00 2001 From: Kartik Mahajan Date: Mon, 22 Apr 2024 15:33:30 +0530 Subject: [PATCH] cmk encryption examples update added quotes --- .../docs/Get-AzDataProtectionBackupVault.md | 2 +- .../docs/New-AzDataProtectionBackupVault.md | 21 ++++++++++++------- .../Update-AzDataProtectionBackupVault.md | 8 +++++-- .../Get-AzDataProtectionBackupVault.md | 2 +- .../New-AzDataProtectionBackupVault.md | 21 ++++++++++++------- .../Update-AzDataProtectionBackupVault.md | 8 +++++-- 6 files changed, 40 insertions(+), 22 deletions(-) diff --git a/src/DataProtection/DataProtection.Autorest/docs/Get-AzDataProtectionBackupVault.md b/src/DataProtection/DataProtection.Autorest/docs/Get-AzDataProtectionBackupVault.md index 038cf89d6c6d..0498ff62c21f 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/Get-AzDataProtectionBackupVault.md +++ b/src/DataProtection/DataProtection.Autorest/docs/Get-AzDataProtectionBackupVault.md @@ -98,7 +98,7 @@ First command gets a specific vault by given vault name, then we fetch the secur ### Example 4: Get encryption settings of backup vault. ```powershell -$vault = Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName -VaultName +$vault = Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" $vault.EncryptionSetting |fl $vault.EncryptionSetting.CmkIdentity |fl $vault.EncryptionSetting.CmkKeyVaultProperty |fl diff --git a/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupVault.md b/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupVault.md index acc213e68edc..cd41c3cc7928 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupVault.md +++ b/src/DataProtection/DataProtection.Autorest/docs/New-AzDataProtectionBackupVault.md @@ -63,18 +63,23 @@ This command creates a new backup vault while setting Immutability state, cross ### Example 3: Create a Backup Vault with CMK ```powershell -$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType "" -Type "" +$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant $userAssignedIdentity = @{ - "" = @{ - clientId = "" - principalId = "" + "/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" } - "" = @{ - clientId = "" - principalId = "" + "/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" } } -New-AzDataProtectionBackupVault -SubscriptionId -ResourceGroupName -VaultName -Location -StorageSetting $storagesetting -IdentityType UserAssigned -UserAssignedIdentity $userAssignedIdentity -CmkEncryptionState Enabled -CmkIdentityType UserAssigned -CmkUserAssignedIdentityId -CmkEncryptionKeyUri -CmkInfrastructureEncryption Enabled + +$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 ``` ```output diff --git a/src/DataProtection/DataProtection.Autorest/docs/Update-AzDataProtectionBackupVault.md b/src/DataProtection/DataProtection.Autorest/docs/Update-AzDataProtectionBackupVault.md index 038de5c5b6d7..d55d66202044 100644 --- a/src/DataProtection/DataProtection.Autorest/docs/Update-AzDataProtectionBackupVault.md +++ b/src/DataProtection/DataProtection.Autorest/docs/Update-AzDataProtectionBackupVault.md @@ -89,7 +89,9 @@ These parameters are optional and can be used independently. ### Example 4: Update vault CmkIdentityType from UserAssignedManagedIdentity to SystemAssignedManagedIdentity and CmkEncryptionKeyUri ```powershell -Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CmkIdentityType SystemAssigned -CmkEncryptionKeyUri "cmkKeyUri" +$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 ``` ```output @@ -103,7 +105,9 @@ These parameters are optional and can be used independently. ### Example 5: Update vault CmkIdentityType from SystemAssignedManagedIdentity to UserAssignedManagedIdentity ```powershell -Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CmkIdentityType UserAssigned -CmkUserAssignedIdentityId "cmkIdentityId" -CmkEncryptionKeyUri "cmkEncryptionKeyUri" +$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 ``` ```output diff --git a/src/DataProtection/DataProtection.Autorest/examples/Get-AzDataProtectionBackupVault.md b/src/DataProtection/DataProtection.Autorest/examples/Get-AzDataProtectionBackupVault.md index 7685b9b5f650..610dc2092047 100644 --- a/src/DataProtection/DataProtection.Autorest/examples/Get-AzDataProtectionBackupVault.md +++ b/src/DataProtection/DataProtection.Autorest/examples/Get-AzDataProtectionBackupVault.md @@ -55,7 +55,7 @@ First command gets a specific vault by given vault name, then we fetch the secur ### Example 4: Get encryption settings of backup vault. ```powershell -$vault = Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName -VaultName +$vault = Get-AzDataProtectionBackupVault -SubscriptionId "xxxx-xxx-xxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" $vault.EncryptionSetting |fl $vault.EncryptionSetting.CmkIdentity |fl $vault.EncryptionSetting.CmkKeyVaultProperty |fl diff --git a/src/DataProtection/DataProtection.Autorest/examples/New-AzDataProtectionBackupVault.md b/src/DataProtection/DataProtection.Autorest/examples/New-AzDataProtectionBackupVault.md index afee55580ad7..01dc5f23f523 100644 --- a/src/DataProtection/DataProtection.Autorest/examples/New-AzDataProtectionBackupVault.md +++ b/src/DataProtection/DataProtection.Autorest/examples/New-AzDataProtectionBackupVault.md @@ -30,18 +30,23 @@ This command creates a new backup vault while setting Immutability state, cross ### Example 3: Create a Backup Vault with CMK ```powershell -$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType "" -Type "" +$storagesetting = New-AzDataProtectionBackupVaultStorageSettingObject -DataStoreType VaultStore -Type LocallyRedundant $userAssignedIdentity = @{ - "" = @{ - clientId = "" - principalId = "" + "/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" } - "" = @{ - clientId = "" - principalId = "" + "/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" } } -New-AzDataProtectionBackupVault -SubscriptionId -ResourceGroupName -VaultName -Location -StorageSetting $storagesetting -IdentityType UserAssigned -UserAssignedIdentity $userAssignedIdentity -CmkEncryptionState Enabled -CmkIdentityType UserAssigned -CmkUserAssignedIdentityId -CmkEncryptionKeyUri -CmkInfrastructureEncryption Enabled + +$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 ``` ```output diff --git a/src/DataProtection/DataProtection.Autorest/examples/Update-AzDataProtectionBackupVault.md b/src/DataProtection/DataProtection.Autorest/examples/Update-AzDataProtectionBackupVault.md index e3fb3ff6921c..c150e2826c2b 100644 --- a/src/DataProtection/DataProtection.Autorest/examples/Update-AzDataProtectionBackupVault.md +++ b/src/DataProtection/DataProtection.Autorest/examples/Update-AzDataProtectionBackupVault.md @@ -40,7 +40,9 @@ This command is used to modify Immutability state, cross subscription restore st ### Example 4: Update vault CmkIdentityType from UserAssignedManagedIdentity to SystemAssignedManagedIdentity and CmkEncryptionKeyUri ```powershell -Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CmkIdentityType SystemAssigned -CmkEncryptionKeyUri "cmkKeyUri" +$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 ``` ```output @@ -53,7 +55,9 @@ This command is used to modify CmkIdentityType and CmkEncryptionKeyUri. These pa ### Example 5: Update vault CmkIdentityType from SystemAssignedManagedIdentity to UserAssignedManagedIdentity ```powershell -Update-AzDataProtectionBackupVault -SubscriptionId "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" -ResourceGroupName "resourceGroupName" -VaultName "vaultName" -CmkIdentityType UserAssigned -CmkUserAssignedIdentityId "cmkIdentityId" -CmkEncryptionKeyUri "cmkEncryptionKeyUri" +$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 ``` ```output