Occurs only on Azure Web or Worker role and only when trying to process a media from Internet by passing a URI to MFCreateSourceReaderFromURL() method. Local media files are opened and processed successfully. Under Azure Emulator both local and remote files are opened successfully as well.
The reason is obvious: Azure Worker Host process (WaWorkerHost.exe) runs under NETWORK SERVICE account, which doesn't have write access to some specific temp folder. This time the folder is D:\Windows\System32\config\systemprofile\AppData. Media Foundation tries to store the downloaded media file in that folder and fails.
Solution: RDP to your role instance and give full access to that folder to NETWORK SERVICE account.
User contributions licensed under CC BY-SA 3.0