Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
i added <httpRuntime targetFramework="4.8"/> in web.config it back working perfectly in Azure App Service
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
i created a asp.net page since awhile (1 year) and hosted as App Service on Azure and i call a API and process a JSON response and everything was working normally but since 2 days i start getting this error when call , and this error happen only when open the page from published URL but when open it from local server before publishing its working normally, any idea why this start happening
string json = new WebClient().DownloadString(string.Format("https://api.weather.com/v2/pws/observations/current?stationId=XXXXX&format=json&units=e&apiKey={0}",apicode));
The remote server returned an error: (400) Bad Request.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Net.WebException: The remote server returned an error: (400) Bad Request.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[WebException: The remote server returned an error: (400) Bad Request.]
System.Net.WebClient.DownloadDataInternal(Uri address, WebRequest& request) +298
System.Net.WebClient.DownloadString(Uri address) +106
System.Net.WebClient.DownloadString(String address) +32
JordanMeteo.ZohorRealtime.GetRealtimeText() in c:\JordanMeteo\JordanMeteo\JordanMeteo\ZohorRealtime.aspx.cs:220
JordanMeteo.ZohorRealtime.ShowRecords() in c:\JordanMeteo\JordanMeteo\JordanMeteo\ZohorRealtime.aspx.cs:511
JordanMeteo.ZohorRealtime.Page_Load(Object sender, EventArgs e) in c:\JordanMeteo\JordanMeteo\JordanMeteo\ZohorRealtime.aspx.cs:179
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +52
System.Web.UI.Control.OnLoad(EventArgs e) +97
System.Web.UI.Control.LoadRecursive() +61
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +693
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
A set of technologies in .NET for building web applications and web services. Miscellaneous topics that do not fit into specific categories.
i added <httpRuntime targetFramework="4.8"/> in web.config it back working perfectly in Azure App Service
A remote API like weather.com can return anything it likes and that's out of your control. You will have to contact the vendor of that API for assistance and they might be able to tell you what's wrong and how to fix.