Azure网站上的502 Bad Gateway错误

And*_*ini 4 azure azure-web-sites

我目前正在将新的支付系统(Trustly)整合到我的网站中.这涉及向Trustlys服务器发送jsonstring.这段代码在本地完美运行,但在我的测试环境中,我发现了一个502错误的网关错误.什么是奇怪的是应用程序似乎打破了一个try块,但下面的catch块不会触发.考虑以下代码:

        var postData = PrepJsonForTrustly(someSecretData);

        try
        {
            _logger.Info("attempting Deposit to trustly");  //this shows up in my logs
            var res = _client.Deposit(postData);
            _logger.Info("TrustlyDeposit successful"); //this doesn't
            return res;
        }
        catch (Exception ex)
        {
            _logger.Info("Failed Deposit to Trustly"); //and, oddly, neither does this!
            throw ex;
        }
Run Code Online (Sandbox Code Playgroud)

谷歌这个问题我找到了这个http://blog.wouldbetheologian.com/2014/07/502-bad-gateway-error-on-azure-websites.html

这似乎描述了大多数相同的symtoms,除了我的代码在localhost上完美运行,他描述的stackoverflowexception也会崩溃我的本地服务器.

什么想法可能导致这个?或者为什么我的拦截块没有开火?

小智 7

丢失日志的可能解释是,如果进程崩溃.您是否检查了eventlog.xml文件(在logFiles文件夹中) - 这是编写应用程序事件日志的文件.