We are attempting to run a site collection copy job through PowerShell. Recently we began noticing that for some of our longer running migrations we were getting StackOverflowException while running the migration from PowerShell, but if we ran the migration through the console it worked as expected. It does not seem to effect all migrations, just some. The script had been working previously then started to fail on multiple machines after a few migrations had been performed. After doing some debugging, the crash dumps seem to indicate that there are a large number of threads relating to Azure that are not completing.