I have a very simple service,
public class AzureService : IAzureService
{
private readonly CloudBlobContainer _container;
public AzureService(ISettin
The behaviour you are describing sounds very much like a threading problem (i.e. if you breakpoint the code it works fine as it's effectively single-threaded at that time) resulting in incomplete or invalid data being sent to the Azure Storage API.
Your "var image" definition may behave unexpectedly in a multi-threaded environment (If you utilised ReSharper it will highlight this variable and advise to change the code because it is potentially unsafe).
Have a read of this SO post to understand a little more and how you might better implement your code.
The foreach identifier and closures