0
votes

502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.

1

1 Answers

1
votes

This sounds like you are uploading the video asset that is large and it is timing out. You could try adjusting the settings for this in web.config:

<system.web>
    <httpRuntime maxRequestLength="102400" executionTimeout="3600" />

ref: http://www.telerik.com/blogs/upload-large-files-asp-net-radasyncupload

Also, verify you are uploading media correctly:

First create an IAsset:

IAsset inputAsset = _context.Assets.Create(assetName, assetCreationOptions.none);

Then create the asset file to be uploaded:

var assetFile = inputAsset.AssetFiles.Create(Path.GetFileName(filePath));

Create the access permisions and resource locator:

var policy = _context.AccessPolicies.Create(
                        assetName,
                        TimeSpan.FromDays(30),
                        AccessPermissions.Write | AccessPermissions.List);

var locator = _context.Locators.CreateLocator(LocatorType.Sas, inputAsset, policy);

And then finaly upload the file:

assetFile.Upload(singleFilePath);

ref: https://azure.microsoft.com/en-us/documentation/articles/media-services-dotnet-upload-files/