Log Trace.WriteLine in Azure - azure

Our team has an ASP.NET Core Web Application which integrates Multisafepay payment provider (MSP). We use the .NET wrapper of MSP to communicate with the API of the payment provider. In some cases when we asking for the payment URL where the user can pay for his order we got an error code 9999 (unknown error). Mostly this happens after we restart our Web App in Azure or when it comes back from idle time.
I checked out the code of the MSP wrapper. It has some Trace.WriteLine statement in its code right where the error 9999 occurs. Is there any way to log the content of the trace in Azure?
I've tried almost everything. Modyfing the web.config, and adding trace listneres to it, turning on the Application Loggin and Log Stream in Azure, etc. but nothing worked.

Related

Internal Server Error 500 - Azure App Service hosting Microsoft Bot Framework

My bot on Azure used to work normally some days before without any issue for a year now.
But suddenly, when a user sends a message to the server, the server does not respond and has a Internal Server Error 500, with detailed error information regarding the ManagedPipelineHandler and System.Web.Http.WebHost.HttpControllerHandler
There was a temporary issue with the default state service September 15th. The bug has been fixed. https://github.com/Microsoft/BotBuilder/issues/3466
The default state service is not intended for production bots. Using the Azure Extensions for state is recommended. Please review: https://blog.botframework.com/2017/07/18/saving-state-azure-extensions/
Reason: The reason this happens is the fact you’ve deployed a binary which doesn’t have an old name (SampleEchoBot.dll). As the web application has now a second binary which tries to host a Messages controller. More details can be found when accessing it via web browser
Solution: To fix it you need to modify your publish profile. Click Publish once again, switch to Settings tab, expand the File Publish Options and check the Remove additional files at destination. After another publish you can deselect this option. The bot should respond now as expected.

How to resolve error 500 on Azure web app?

What I have:
VS2015U2
ASP.NET 5 MVC 6 website
Deployed to Azure Web App
The site works locally
When I deploy to Azure I get internal server error (500)
I'm unable to Attach a debugger since they messed up something with the latest versions (tried manually too https://azure.microsoft.com/en-us/blog/introduction-to-remote-debugging-on-azure-web-sites/)
I have app.UseDeveloperExceptionPage(); but I guess the site is failing during configuration so it doesn't display any other information.
So how to resolve this? I need to see the .net exception but I have no idea how to do that.
Try adding Application Insights to the app. You should see errors on startup of your application.
I would also take a look at your startup code to see if you are writing to disk anywhere during configuration or app.start. This might be the case if you are using AAD in any capacity.
You can also hit up the KUDU console by targetting https://sitename.scm.azurewebsites.net . You will be able to navigate in the debugging console to see the RAW logs from IIS. That might shed some light into the situation. See KUDU for more info.
I solved this problem like show below.HTTP 500 error interested about that is not allowed to access the server.Go to azure portal address and choose your database.Press"Set server firewall " and Allow Azure services and resources to access this server choose "Yes" save that page and refresh your service.Than you can see your data
Use the KUDU console at https://sitename.scm.azurewebsites.net
Go to web.config file and check if the process path is correct.
I used the Azure Log Stream to help figure out what was going on. As Karishma Tiwari - MSFT said, the issue ended up being my web.config file (which was built for .NET 3.5 and not 4.7)
Here's the tutorial to set up Log Streaming: https://blogs.msdn.microsoft.com/azureossds/2016/09/28/how-to-identifyreview-errors-on-php-applications-in-azure-web-apps-using-log-stream-service/
My particular app's solution was to update my Azure App Service to use .NET 3.5, in its Application Settings, like so:
For me it worked after I turned "Allow Azure services and resources to access this server
" to Yes
I got this error even though I had enabled Application Logging (Filesystem), Detailed error messages and Failed request tracing in App Service logs
This page isn’t working
mysite.azurewebsites.net is currently unable
to handle this request.
HTTP ERROR 500
However by navigating to Log stream and selecting Application Logs I could see a detailed error message:
I know this question has already been answered but here is a recent view of the Azure Portal where I found a solution to this problem

Azure Website - Web API Swallowing Errors

I have a asp.net web api application deployed as an azure web app. One of the endpoints occasionally throws an exception. Normally this isn't an issue for us. We have an ExceptionLogger attached to the api services. This has been in place for sometime and normally works fine.
Currently we see that a 500 response comes back from the server, but nothing is logged. I have tried setting GlobalConfiguration.Configuration.IncludeErrorDetailPolicy to IncludeErrorDetailPolicy.Always, but the response always comes back with no body content.
What else can I do to track the source of the problem?
If you have a consistent repro, then you can use remote debugging to attach to your web app and debug it (https://azure.microsoft.com/en-us/documentation/articles/web-sites-dotnet-troubleshoot-visual-studio/).
Failing that, you can enable better diagnostic logs using the web app settings. Information on how to do so is here:
https://azure.microsoft.com/en-us/documentation/articles/web-sites-configure/ under the section "Enabling diagnostic logs".
In your case you should have application logging enabled, and perhaps failed request tracing would be useful (FREB).
For even more tools you can use the Support Site Extension (http://azure.microsoft.com/blog/2014/12/01/new-updates-to-support-site-extension-for-azure-websites/) which would allow you to look at live event logs and HTTP traffic. For a deeper dive into debugging in Azure App Service see: https://channel9.msdn.com/Events/Ignite/2015/BRK4704.

how to diagnose azure problems

I've recently starting experimenting with azure cloud hosting and my web app had about 10 minutes down time today.
I'm not sure why and I was wondering what tools I have available for determining the cause of the downtime.
You have application logs and site logs. Basically application logs are information produced by your web app code. You can use instrumentation to trace call and exceptions in your appliction. Site logs are information produced by the web server and you can see error messages and failed request tracing without instrumenting your code. You won't have relevant information now since by default all diagnostics are turned off but if it happens again you know where to look for.
Here's how to enable and visualize this information.
Enable diagnostics logging for web apps in Azure App Service
https://azure.microsoft.com/en-us/documentation/articles/web-sites-enable-diagnostic-log/

How to resolve error while trying to publish 2013 workflow via designer. Probably a workflow manager backend user account issue?

I am getting error while publishing the 2013 workflow via designer. Also, under sharepoint designer if I try to delete any workflow then the page just refreshes and the workflow does not get deleted.
I checked the services.msc and found that the workflow backend service was stopped. (this happened as the password of the user under which this serivce was running had changed).
So, the network admin changed the service user to LOCAL SYSTEM and started the service.
Now, the workflow backend service is started. We have also ran the iisreset.
However, I am still getting the same error:-
System.IO.InvalidDataException: A response was returned that did not come from the Workflow Manager. Status code = 503: Service Unavailable
Service Unavailable
HTTP Error 503. The service is unavailable.
Client ActivityId : ee94689c-4e08-b055-fe9c-268d7a94
Please find attached snapshot.
Is the error as a result of the change in service user? Can you tell me what priviledges should the account running the workflow backend service must have?
UPDATE 1
We have tried to set the account to farm admin and also tried to set it to site admin. Now, for a new web application, I can delete workflows. However, for existing site, I am not able to delete the existing workflows.. Also, I am not able to publish workflows (present under new and previous sites) and the error is same as described earlier.
Open IIS and make sure identify of the WorkflowMgmtPool is correct, you can re-type the identify. Then make this pool is started.
Check and reenter credentials for:-
Open Services.msc, find Service Bus Message Broker service and Windows Fabric Host Service. Make sure they are running. If not, firstly, start Windows Fabric Host Service, then start Service Bus Message Broker service. If Service Bus Message Broker service is started, stop and re-start it.
Reference- this forum link
This error occur because you have not registered the workflow correctly. Re-register the workflow and it will get solved. Also make sure you have activated the App management Service in your site features.
http://designerworkflow.blogspot.in/
Workflow Manager CU2 to get to 1.0 Refresh in Web Platform installer worked first time for me!
http://support.microsoft.com/kb/2902007/en-us
I had this same issue.
I was able to resolve it by going to IIS on my application server, editing the identity on the Workflow Management Application Pool, saving it and restarting it. I also restarted the server.

Resources