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.
I am working Headless Browser that is ChromiumWebBrowser thats work fine on local machine and when we publish code on Azure App Service this gives us above mentioned error. Currently we use Shared infastructured (Free version for Testing).
region ChromiumWebBrowser
var browser = new ChromiumWebBrowser(url);
await LoadPageAsync(browser);
var result = browser.GetBrowser().MainFrame.GetSourceAsync().Result;
browser.Stop();
if (!browser.IsDisposed)
browser.Dispose();
#endregion