Skip to content

Commit

Permalink
Update Az.Databox Examples (#17779)
Browse files Browse the repository at this point in the history
  • Loading branch information
CaptainFanZzz authored May 6, 2022
1 parent 57b2f64 commit 7195e34
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 15 deletions.
3 changes: 1 addition & 2 deletions src/DataBox/help/New-AzDataBoxContactDetailsObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/DataBox/help/New-AzDataBoxDiskJobDetailsObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 9 additions & 1 deletion src/DataBox/help/New-AzDataBoxHeavyJobDetailsObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions src/DataBox/help/New-AzDataBoxJobDetailsObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/DataBox/help/New-AzDataBoxKeyEncryptionKeyObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/DataBox/help/New-AzDataBoxManagedDiskDetailsObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/DataBox/help/New-AzDataBoxShippingAddressObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions src/DataBox/help/New-AzDataBoxStorageAccountDetailsObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion src/DataBox/help/Update-AzDataBoxJob.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 7195e34

Please sign in to comment.