diff --git a/Rock/Storage/Provider/AzureBlobStorage.cs b/Rock/Storage/Provider/AzureBlobStorage.cs index c1342556656..7404651950f 100644 --- a/Rock/Storage/Provider/AzureBlobStorage.cs +++ b/Rock/Storage/Provider/AzureBlobStorage.cs @@ -108,9 +108,23 @@ The exception was being thrown by the second call to BlobClient.Upload() when re Reason: Wide SMS image attachments stored in Azure cause exceptions in Communication Wizard. https://github.com/SparkDevNetwork/Rock/issues/5719 */ - blobClient.Upload( binaryFile.ContentStream, overwrite: true ); + /* + 9/28/2026 - SL (SECC) - fileSize = binaryFile.ContentStream.Length; + Dispose the content stream after uploading so this provider follows the same + contract as the Database and FileSystem providers. Callers such as + SignatureDocumentTemplateService.UpdateDocumentStatus assign a FileStream to + ContentStream, save, then File.Delete() the temp file; leaving the stream open + leaked the file handle and caused the delete to throw IOException. + + Reason: ROCK-9041 Process Signature Documents job fails with file lock on Azure provider. + */ + using ( var stream = binaryFile.ContentStream ) + { + blobClient.Upload( stream, overwrite: true ); + + fileSize = stream.Length; + } } ///