diff --git a/src/Storage/Storage.Management/ChangeLog.md b/src/Storage/Storage.Management/ChangeLog.md index 4633860f60eb..0fc5803a062d 100644 --- a/src/Storage/Storage.Management/ChangeLog.md +++ b/src/Storage/Storage.Management/ChangeLog.md @@ -18,6 +18,9 @@ - Additional information about change #1 --> ## Upcoming Release +* Fixed upload file with OAuth authentication issue [#24289] + - `Set-AzStorageFileContent` + * Fixed parser logic when downloading blob from managed disk account with Sas Uri and bearer token on Linux and MacOS - `Get-AzStorageBlobContent` * Added warning messages for upcoming breaking changes in Queue cmdlets for removing references to "Microsoft.Azure.Storage.Queue" diff --git a/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs b/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs index 6262f142c65a..47c5b722648e 100644 --- a/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs +++ b/src/Storage/Storage/File/Cmdlet/SetAzureStorageFileContent.cs @@ -244,12 +244,10 @@ await DataMovementTransferHelper.DoTransfer(() => { long currentBlockSize = offset + blockSize < fileSize ? blockSize : fileSize - offset; - // Only need to create new buffer when chunk size change - if (currentBlockSize != lastBlockSize) - { - buffer = new byte[currentBlockSize]; - lastBlockSize = currentBlockSize; - } + // create new buffer, the old buffer will be GC + buffer = new byte[currentBlockSize]; + lastBlockSize = currentBlockSize; + await stream.ReadAsync(buffer: buffer, offset: 0, count: (int)currentBlockSize); if (!fipsEnabled && hash != null) {