Skip to content

Commit

Permalink
[Storage] Support copy block blob from Uri
Browse files Browse the repository at this point in the history
  • Loading branch information
blueww committed Feb 22, 2021
1 parent 63c3b4d commit 5686714
Show file tree
Hide file tree
Showing 10 changed files with 938 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -288,13 +288,17 @@ function Test-Blob

# Encryption Scope Test
$scopename = "testscope"
$scopename2 = "testscope2"
$containerName2 = "testscopecontainer"
New-AzStorageEncryptionScope -ResourceGroupName $ResourceGroupName -StorageAccountName $storageAccountName -EncryptionScopeName $scopename -StorageEncryption
$container = New-AzStorageContainer -Name $containerName2 -Context $storageContext -DefaultEncryptionScope $scopeName2 -PreventEncryptionScopeOverride $true
New-AzStorageEncryptionScope -ResourceGroupName $ResourceGroupName -StorageAccountName $storageAccountName -EncryptionScopeName $scopename2 -StorageEncryption
$container = New-AzStorageContainer -Name $containerName2 -Context $storageContext -DefaultEncryptionScope $scopeName -PreventEncryptionScopeOverride $true
Assert-AreEqual $scopename $container.BlobContainerProperties.DefaultEncryptionScope
Assert-AreEqual $true $container.BlobContainerProperties.PreventEncryptionScopeOverride
$blob = Set-AzStorageBlobContent -Context $storageContext -File $localSrcFile -Container $containerName -Blob encryscopetest -EncryptionScope $scopename
Assert-AreEqual $scopename $blob.BlobProperties.EncryptionScope
$blob = Copy-AzStorageBlob -Context $storageContext -SrcContainer $containerName -SrcBlob encryscopetest -DestContainer $containerName -DestBlob encryscopetest -Force -EncryptionScope $scopename2
Assert-AreEqual $scopename2 $blob.BlobProperties.EncryptionScope
Remove-AzStorageContainer -Name $containerName2 -Force -Context $storageContext

# Clean Storage Account
Expand Down
3 changes: 2 additions & 1 deletion src/Storage/Storage.Management/Az.Storage.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,8 @@ CmdletsToExport = 'Get-AzStorageAccount', 'Get-AzStorageAccountKey',
'Set-AzDataLakeGen2AclRecursive',
'Update-AzDataLakeGen2AclRecursive',
'Remove-AzDataLakeGen2AclRecursive', 'New-AzStorageEncryptionScope',
'Update-AzStorageEncryptionScope', 'Get-AzStorageEncryptionScope'
'Update-AzStorageEncryptionScope', 'Get-AzStorageEncryptionScope',
'Copy-AzStorageBlob'

# Variables to export from this module
# VariablesToExport = @()
Expand Down
2 changes: 2 additions & 0 deletions src/Storage/Storage.Management/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
- `Set-AzStorageAccount`
* Supported create Encryption Scope with RequireInfrastructureEncryption
- `New-AzStorageEncryptionScope`
* Supported copy block blob synchronously, with encryption scope
- `Copy-AzStorageBlob`

## Version 3.3.0
* Supported RoutingPreference settings in create/update Storage account
Expand Down
3 changes: 3 additions & 0 deletions src/Storage/Storage.Management/help/Az.Storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Adds an action to the input ManagementPolicy Action Group object, or creates a M
### [Close-AzStorageFileHandle](Close-AzStorageFileHandle.md)
Closes file handles of a file share, a file directory or a file.

### [Copy-AzStorageBlob](Copy-AzStorageBlob.md)
Copy a blob synchronously.

### [Disable-AzStorageBlobDeleteRetentionPolicy](Disable-AzStorageBlobDeleteRetentionPolicy.md)
Disable delete retention policy for the Azure Storage Blob service.

Expand Down
Loading

0 comments on commit 5686714

Please sign in to comment.