The New VirtualStream in BizTalk Server 2006… that still exists in 2020

Posted: September 18, 2023  |  Categories: BizTalk

Yes, I know that in my last post, I told you that it was the previous blog post from Thomas Canter that I was revitalizing. Still, last week, while I was relaxing in my car waiting for my wife to get out of the pool, I received an email titled: Are you interested in more old blogs? Hell yes! was my prompt response… So, here it goes, another Thomas Canter old and still very updated blog post: The New VirtualStream in BizTalk Server 2006.

I bet you are all drooling over the new VirtualStream support in BizTalk Server 2006 (once again, valid for any version of BizTalk Server, including 2020). With this, you can access a forward-read-only stream as if it were a fully implemented stream with backward and forward access to the data.

The VirtualStream is implemented in the undocumented APIs but is also exposed in the SDK as VirtualStream.cs, so I feel pretty safe in using the deployed version.

But, the use of the VirtualStream is not what this is about. This is about the security implications of the VirtualStream. The VS supports a disk caching scheme to store large streams…

As such, this means that the stream size in the cache can be quite large, and you _generally_ don’t have to worry about it, but in fact, you do because this can fail subtly and unexpectedly.

Two things can go wrong in this scenario.

Understand that the stream is cached to the BizTalk Server Host Instance account’s %TEMP% folder, generally under:

  • C:\Documents and Settings\<BTSHostInstanceName>\Local Settings\Temp

The first problem I see here is that the C: drive is NOT a good place to put large files that grow unexpectedly. The IO performance is poor, and in addition, you could exhaust the drive space unexpectedly. So, I recommend manually setting the BizTalk Host Instance’s TEMP folder to a separate drive, preferably a non-backed-up high-speed disk.

Ok, so now you have the TEMP folder set to a separate drive, the second problem that could occur is that the BizTalk Host Instance account may not have Read-Write access to that folder. When the account is logged on the first time, the OS builds the account’s local folder structure and gives it the correct access, but you need to manually set this when you manually set the TEMP folder location.


  • Try to move the TEMP folder of the BizTalk Host Instance account to a large and non-OS used drive.
  • Make sure that the BizTalk Host Instance account has full control of the folder.

That’s it! Then you won’t get surprising failures in your pipeline when processing large files.

Thanks Tom for sending me this interesting stuff!

Hope you find this helpful! So, if you liked the content or found it helpful and want to help me write more content, you can buy (or help buy) my son a Star Wars Lego! 

Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to Top