@@ -1629,8 +1629,6 @@ internal async Task<Response<BlobContentInfo>> StagedUploadInternal(
16291629 . ClientSideEncryptInternal ( content , options . Metadata , async, cancellationToken ) . ConfigureAwait ( false ) ;
16301630 }
16311631
1632- var client = new BlockBlobClient ( Uri , ClientConfiguration ) ;
1633-
16341632 var uploader = GetPartitionedUploader (
16351633 transferOptions : options ? . TransferOptions ?? default ,
16361634 operationName : $ "{ nameof ( BlobClient ) } .{ nameof ( Upload ) } ") ;
@@ -1710,11 +1708,24 @@ internal async Task<Response<BlobContentInfo>> StagedUploadInternal(
17101708 }
17111709 #endregion Upload
17121710
1711+ private BlockBlobClient _blockBlobClient ;
1712+
1713+ private BlockBlobClient BlockBlobClient
1714+ {
1715+ get
1716+ {
1717+ if ( _blockBlobClient == null )
1718+ {
1719+ _blockBlobClient = new BlockBlobClient ( Uri , ClientConfiguration ) ;
1720+ }
1721+ return _blockBlobClient ;
1722+ }
1723+ }
1724+
17131725 internal PartitionedUploader < BlobUploadOptions , BlobContentInfo > GetPartitionedUploader (
17141726 StorageTransferOptions transferOptions ,
17151727 ArrayPool < byte > arrayPool = null ,
17161728 string operationName = null )
1717- => new BlockBlobClient ( Uri , ClientConfiguration )
1718- . GetPartitionedUploader ( transferOptions , arrayPool , operationName ) ;
1729+ => BlockBlobClient . GetPartitionedUploader ( transferOptions , arrayPool , operationName ) ;
17191730 }
17201731}
0 commit comments