From 7195e34529bbfed8ee1a6537d69a5dc9213cd66f Mon Sep 17 00:00:00 2001 From: Yufan Yang <95342181+CaptainFanZzz@users.noreply.github.com> Date: Fri, 6 May 2022 17:01:27 +0800 Subject: [PATCH] Update Az.Databox Examples (#17779) --- src/DataBox/help/New-AzDataBoxContactDetailsObject.md | 3 +-- src/DataBox/help/New-AzDataBoxDiskJobDetailsObject.md | 10 +++++++++- src/DataBox/help/New-AzDataBoxHeavyJobDetailsObject.md | 10 +++++++++- src/DataBox/help/New-AzDataBoxJobDetailsObject.md | 6 ++++-- .../help/New-AzDataBoxKeyEncryptionKeyObject.md | 3 +-- .../help/New-AzDataBoxManagedDiskDetailsObject.md | 7 ++++++- src/DataBox/help/New-AzDataBoxShippingAddressObject.md | 3 +-- .../help/New-AzDataBoxStorageAccountDetailsObject.md | 3 +-- .../help/New-AzDataBoxTransferConfigurationObject.md | 2 +- src/DataBox/help/Update-AzDataBoxJob.md | 5 ++++- 10 files changed, 37 insertions(+), 15 deletions(-) diff --git a/src/DataBox/help/New-AzDataBoxContactDetailsObject.md b/src/DataBox/help/New-AzDataBoxContactDetailsObject.md index e1b3d8deb1fc..b2806ff3d21f 100644 --- a/src/DataBox/help/New-AzDataBoxContactDetailsObject.md +++ b/src/DataBox/help/New-AzDataBoxContactDetailsObject.md @@ -25,8 +25,7 @@ Create an in-memory object for ContactDetails. ### Example 1: Create a in-memory object for ContactDetails ```powershell -$contactDetail = New-AzDataBoxContactDetailsObject -ContactName "random" -EmailList @("emailId") -Phone "1234567891" -$contactDetail +New-AzDataBoxContactDetailsObject -ContactName "random" -EmailList @("emailId") -Phone "1234567891" ``` ```output diff --git a/src/DataBox/help/New-AzDataBoxDiskJobDetailsObject.md b/src/DataBox/help/New-AzDataBoxDiskJobDetailsObject.md index d3842be311dc..1fc83b20af68 100644 --- a/src/DataBox/help/New-AzDataBoxDiskJobDetailsObject.md +++ b/src/DataBox/help/New-AzDataBoxDiskJobDetailsObject.md @@ -27,9 +27,17 @@ Create an in-memory object for DataBoxDiskJobDetails. ### Example 1: DataBoxDisk details in-memory object ```powershell -$details = New-AzDataBoxDiskJobDetailsObject -Type "DataBoxDisk" -DataImportDetail @(@{AccountDetail=$dataAccount; AccountDetailDataAccountType = "StorageAccount"} ) -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -Passkey "randm@423jarABC" -PreferredDisk @{"8" = 8; "4" = 2} -ExpectedDataSizeInTeraByte 18 +$contactDetail = New-AzDataBoxContactDetailsObject -ContactName "random" -EmailList @("emailId") -Phone "1234567891" +$ShippingDetails = New-AzDataBoxShippingAddressObject -StreetAddress1 "101 TOWNSEND ST" -StateOrProvince "CA" -Country "US" -City "San Francisco" -PostalCode "94107" -AddressType "Commercial" + +New-AzDataBoxDiskJobDetailsObject -Type "DataBoxDisk" -DataImportDetail @(@{AccountDetail=$dataAccount; AccountDetailDataAccountType = "StorageAccount"} ) -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -Passkey "randm@423jarABC" -PreferredDisk @{"8" = 8; "4" = 2} -ExpectedDataSizeInTeraByte 18 ``` +```output +Action ChainOfCustodySasKey ExpectedDataSizeInTeraByte ReverseShipmentLabelSasKey Type Passkey +------ -------------------- -------------------------- -------------------------- ---- ------- + 18 DataBoxDisk randm@423jarABC +``` DataBoxDisk details in-memory object ## PARAMETERS diff --git a/src/DataBox/help/New-AzDataBoxHeavyJobDetailsObject.md b/src/DataBox/help/New-AzDataBoxHeavyJobDetailsObject.md index 35f90d042161..e648598950b8 100644 --- a/src/DataBox/help/New-AzDataBoxHeavyJobDetailsObject.md +++ b/src/DataBox/help/New-AzDataBoxHeavyJobDetailsObject.md @@ -26,9 +26,17 @@ Create an in-memory object for DataBoxHeavyJobDetails. ### Example 1: Create a in-memory object for DataBoxHeavyJobDetails ```powershell -$details = New-AzDataBoxHeavyJobDetailsObject -Type "DataBoxHeavy" -DataImportDetail @(@{AccountDetail=$dataAccount; AccountDetailDataAccountType = "StorageAccount"} ) -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -DevicePassword "randm@423jarABC" -ExpectedDataSizeInTeraByte 10 +$contactDetail = New-AzDataBoxContactDetailsObject -ContactName "random" -EmailList @("emailId") -Phone "1234567891" +$ShippingDetails = New-AzDataBoxShippingAddressObject -StreetAddress1 "101 TOWNSEND ST" -StateOrProvince "CA" -Country "US" -City "San Francisco" -PostalCode "94107" -AddressType "Commercial" + +New-AzDataBoxHeavyJobDetailsObject -Type "DataBoxHeavy" -DataImportDetail @(@{AccountDetail=$dataAccount; AccountDetailDataAccountType = "StorageAccount"} ) -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -DevicePassword "randm@423jarABC" -ExpectedDataSizeInTeraByte 10 ``` +```output +Action ChainOfCustodySasKey ExpectedDataSizeInTeraByte ReverseShipmentLabelSasKey Type DevicePassword +------ -------------------- -------------------------- -------------------------- ---- -------------- + 10 DataBoxHeavy randm@423jarABC +``` Create a in-memory object for DataBoxHeavyJobDetails ## PARAMETERS diff --git a/src/DataBox/help/New-AzDataBoxJobDetailsObject.md b/src/DataBox/help/New-AzDataBoxJobDetailsObject.md index 9922e78c6726..30ce329eba9c 100644 --- a/src/DataBox/help/New-AzDataBoxJobDetailsObject.md +++ b/src/DataBox/help/New-AzDataBoxJobDetailsObject.md @@ -26,8 +26,10 @@ Create an in-memory object for DataBoxJobDetails. ### Example 1: Creates a databox job detail in memory object ```powershell -$details = New-AzDataBoxJobDetailsObject -Type "DataBox" -DataImportDetail @(@{AccountDetail=$dataAccount; AccountDetailDataAccountType = "StorageAccount"} ) -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -$details +$contactDetail = New-AzDataBoxContactDetailsObject -ContactName "random" -EmailList @("emailId") -Phone "1234567891" +$ShippingDetails = New-AzDataBoxShippingAddressObject -StreetAddress1 "101 TOWNSEND ST" -StateOrProvince "CA" -Country "US" -City "San Francisco" -PostalCode "94107" -AddressType "Commercial" + +New-AzDataBoxJobDetailsObject -Type "DataBox" -DataImportDetail @(@{AccountDetail=$dataAccount; AccountDetailDataAccountType = "StorageAccount"} ) -ContactDetail $contactDetail -ShippingAddress $ShippingDetails ``` ```output diff --git a/src/DataBox/help/New-AzDataBoxKeyEncryptionKeyObject.md b/src/DataBox/help/New-AzDataBoxKeyEncryptionKeyObject.md index 5e3d51108f58..3d3d02e3df46 100644 --- a/src/DataBox/help/New-AzDataBoxKeyEncryptionKeyObject.md +++ b/src/DataBox/help/New-AzDataBoxKeyEncryptionKeyObject.md @@ -24,8 +24,7 @@ Create an in-memory object for KeyEncryptionKey. ### Example 1: Create a in-memory object for KeyEncryptionKey ```powershell -$keyEncryptionDetails = New-AzDataBoxKeyEncryptionKeyObject -KekType "CustomerManaged" -IdentityProperty @{Type = "UserAssigned"; UserAssignedResourceId = "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"} -KekUrl "keyIdentifier" -KekVaultResourceId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/keyVaultName" -$keyEncryptionDetails +New-AzDataBoxKeyEncryptionKeyObject -KekType "CustomerManaged" -IdentityProperty @{Type = "UserAssigned"; UserAssignedResourceId = "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"} -KekUrl "keyIdentifier" -KekVaultResourceId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/keyVaultName" ``` ```output diff --git a/src/DataBox/help/New-AzDataBoxManagedDiskDetailsObject.md b/src/DataBox/help/New-AzDataBoxManagedDiskDetailsObject.md index b47b257ffaec..6d562c6dc0fb 100644 --- a/src/DataBox/help/New-AzDataBoxManagedDiskDetailsObject.md +++ b/src/DataBox/help/New-AzDataBoxManagedDiskDetailsObject.md @@ -24,9 +24,14 @@ Create an in-memory object for ManagedDiskDetails. ### Example 1: ManagedDisk object ```powershell -$managedDiskAccount=New-AzDataBoxManagedDiskDetailsObject -ResourceGroupId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName" -StagingStorageAccountId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/stagingAccountName" -DataAccountType "ManagedDisk" +New-AzDataBoxManagedDiskDetailsObject -ResourceGroupId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName" -StagingStorageAccountId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/stagingAccountName" -DataAccountType "ManagedDisk" ``` +```output +DataAccountType SharePassword ResourceGroupId StagingStorageAccountId +--------------- ------------- --------------- ----------------------- +ManagedDisk /subscriptions/SubscriptionId/resourceGroups/resourceGroupName /subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/stagingAccountName +``` Creates a in-memory managed disk object ## PARAMETERS diff --git a/src/DataBox/help/New-AzDataBoxShippingAddressObject.md b/src/DataBox/help/New-AzDataBoxShippingAddressObject.md index 3a5ed28d30b6..a79b78fb3dbc 100644 --- a/src/DataBox/help/New-AzDataBoxShippingAddressObject.md +++ b/src/DataBox/help/New-AzDataBoxShippingAddressObject.md @@ -25,8 +25,7 @@ Create an in-memory object for ShippingAddress. ### Example 1: Shipping Address object ```powershell -$ShippingDetails = New-AzDataBoxShippingAddressObject -StreetAddress1 "101 TOWNSEND ST" -StateOrProvince "CA" -Country "US" -City "San Francisco" -PostalCode "94107" -AddressType "Commercial" -$ShippingDetails +New-AzDataBoxShippingAddressObject -StreetAddress1 "101 TOWNSEND ST" -StateOrProvince "CA" -Country "US" -City "San Francisco" -PostalCode "94107" -AddressType "Commercial" ``` ```output diff --git a/src/DataBox/help/New-AzDataBoxStorageAccountDetailsObject.md b/src/DataBox/help/New-AzDataBoxStorageAccountDetailsObject.md index f6caf8e7faba..c0f600c0abfb 100644 --- a/src/DataBox/help/New-AzDataBoxStorageAccountDetailsObject.md +++ b/src/DataBox/help/New-AzDataBoxStorageAccountDetailsObject.md @@ -24,8 +24,7 @@ Create an in-memory object for StorageAccountDetails. ### Example 1: Storage account in-memory object ```powershell -$dataAccount = New-AzDataBoxStorageAccountDetailsObject -DataAccountType "StorageAccount" -StorageAccountId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageAccountName" -$dataAccount +New-AzDataBoxStorageAccountDetailsObject -DataAccountType "StorageAccount" -StorageAccountId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.Storage/storageAccounts/storageAccountName" ``` ```output diff --git a/src/DataBox/help/New-AzDataBoxTransferConfigurationObject.md b/src/DataBox/help/New-AzDataBoxTransferConfigurationObject.md index b618b5f75089..14c4d8b7e59e 100644 --- a/src/DataBox/help/New-AzDataBoxTransferConfigurationObject.md +++ b/src/DataBox/help/New-AzDataBoxTransferConfigurationObject.md @@ -25,7 +25,7 @@ Create an in-memory object for TransferConfiguration. ### Example 1: In-memory object for export job transfer configuration ```powershell -$transferConfigurationType = New-AzDataBoxTransferConfigurationObject -Type "TransferAll" -TransferAllDetail @{"IncludeDataAccountType"="StorageAccount";"IncludeTransferAllBlob"= "True"; "IncludeTransferAllFile"="True"} +New-AzDataBoxTransferConfigurationObject -Type "TransferAll" -TransferAllDetail @{"IncludeDataAccountType"="StorageAccount";"IncludeTransferAllBlob"= "True"; "IncludeTransferAllFile"="True"} ``` Create a in-memory object for export jobs TransferConfiguration diff --git a/src/DataBox/help/Update-AzDataBoxJob.md b/src/DataBox/help/Update-AzDataBoxJob.md index 6e22cc449dd5..8e75b7d9fe25 100644 --- a/src/DataBox/help/Update-AzDataBoxJob.md +++ b/src/DataBox/help/Update-AzDataBoxJob.md @@ -87,7 +87,10 @@ For any failure re-run with $DebugPreference = "Continue" as mentioned in exampl ### Example 3: Update databox job from system assigned to user assigned with customer managed key encryption ```powershell $keyEncryptionDetails = New-AzDataBoxKeyEncryptionKeyObject -KekType "CustomerManaged" -IdentityProperty @{Type = "UserAssigned"; UserAssignedResourceId = "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName"} -KekUrl "keyIdentifier" -KekVaultResourceId "/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.KeyVault/vaults/keyVaultName" -$updateSystemToUserAssigned = Update-AzDataBoxJob -Name "pwshTestSAssigned" -ResourceGroupName "resourceGroupName" -KeyEncryptionKey $keyEncryptionDetails -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -IdentityType "SystemAssigned,UserAssigned" -UserAssignedIdentity @{"/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName" = @{}} +$contactDetail = New-AzDataBoxContactDetailsObject -ContactName "random" -EmailList @("emailId") -Phone "1234567891" +$ShippingDetails = New-AzDataBoxShippingAddressObject -StreetAddress1 "101 TOWNSEND ST" -StateOrProvince "CA" -Country "US" -City "San Francisco" -PostalCode "94107" -AddressType "Commercial" + +Update-AzDataBoxJob -Name "pwshTestSAssigned" -ResourceGroupName "resourceGroupName" -KeyEncryptionKey $keyEncryptionDetails -ContactDetail $contactDetail -ShippingAddress $ShippingDetails -IdentityType "SystemAssigned,UserAssigned" -UserAssignedIdentity @{"/subscriptions/SubscriptionId/resourceGroups/resourceGroupName/providers/Microsoft.ManagedIdentity/userAssignedIdentities/identityName" = @{}} ``` Update databox job from system assigned to user assigned with customer managed key encryption.