Azure Service Fabric activation error - azure

The deployment of one of my apps to a Service Fabric Cluster failed and triggered an Unhealthy Evaluation with an error event saying: There was an error during CodePackage activation.The service host terminated with exit code:3762504530
However, on the node where the app is deployed, Health State indicates: The application was activated successfully.
Is there any way to get a more detailed report on the error event?

I usually connect via RDP to the affected node and do the following things in such a case:
Check Console-Out / Console-Error logs: Service Fabric stores console output (if enabled via <ConsoleRedirection> in your ServiceManifest.xml) and errors in a log folder. On your DEV cluster, this should be C:\SfDevCluster\Data\_App\Node.x\<ApplicationTypeFolder>\log. On a default installation in Azure, it should be D:\SvcFab\_App\<ApplicationTypeFolder>\log
EventLog: .NET exceptions sometimes show up in the "Application" log, but Service Fabric also has its own subfolder which might contain helpful events.
PerfView: PerfView is a very powerful tool to monitor ETW events (Event Tracing for Windows). Since .NET exceptions are logged as ETW events, PerfView might show you helpful exceptions. Here's a quick tutorial:
Download and run PerfView
Go to "Collect -> Collect". De-Select "Merge".
Click "Start Collection".
Now kill your Service Fabric Service through Process Explorer, in case it is running. Moments later, Service Fabric will start it again.
If your service is not running, re-deploy your service.
After the service failed, press "Stop collection" in PerfView.
Now double-click on "Events" in the left tree - this will open all recorded ETW events.
Search for "Microsoft-Windows-DotNETRuntime/Exception/Start" and double click on it.
You should now see all .NET exceptions that occurred, ordered by time.

Related

Azure Linux App Service Not Displaying Application Logs

I've set up a linux based azure app service and am unable to see log messages from the application itself in both the "log stream" and "logs" tab of the monitoring options. It is important to note I can see start up messages in the logs for the deployed application and can see outputs when get and post requests are made to the corresponding connection url so i know its running (Also the tasks the application is written to perform are carried out). Additionally, in the "App Service Logs" tab I have "Application Logging" set to "File System" as is standard for what I'm trying to output but this hasn't resulted in any in-application logs being visible.
Lastly about a year ago I managed to set up two other linux based azure app services that work completely as desired and output the in app log messages to the stream and cannot replicate this behaviour with this one. I feel there is just some setting or property somewhere i have overlooked but no matter how many different setting tabs I investigate I cannot spot any significant differences.
Are there any somewhat hidden options or requirements to be aware of in order to get in-application logs to be outputted to a linux based app services "log stream"? Or some other solution at a higher level in the azure resource group, workspace, application insights etc that may solve this issue? Any help and suggestions are greatly appreciated thank you.
I have tested in my environment.
Go to Your App Service --> Select Diagnose and Solve Problems --> Click on Availability and Performance --> Select Application Logs
You should be able to see the Application Logs, Platform Logs and Deployment Logs here.
Log Stream gives you the live logs of your application. The logs displayed in the Application logs should be seen in the Log Stream.

How to schedule restart of web server on Basic tier?

I have a web app running on a Basic Tier with logged in users.
The web server appears to restart randomly about once a day which interrupts these users.
How can I get the web server to restart overnight instead?
Apologies it maybe be late response.
In most cases unexpected restart could happen due to unhandled exception originated in the chosen application framework (such as Python, Asp.Net, PHP etc.) and/or the application code.
Firstly, to understand why the restart occurred, you may leverage App Service diagnostics from Azure Portal> navigate to your App Service app in the Azure portal.
In the left navigation, click on Diagnose and solve problems – Checkout the tile for “Diagnostic Tools” > “Availability and Performance” > and “Web App Restarted” (to fetch more details).
To answer your question, you may create a triggered WebJob task to restart the WebApp. Is available on Basic App Service Plan.
See this doc section 'Create a scheduled WebJob' for more details.

Enable the AI using Application Insights Status Monitor but SQL Dependencies in Command property is not showing the generated SQL

I was hosted my ASP.NET web application into local IIS server, then enable the Application Insights by using Application Insights Status Monitor by following this link.
After configuration done, then I went to azure portal and open my application insights resource for seeing the dependency calls, requests, and exceptions everything coming nicely. The problem is that SQL Dependencies in Command property is not showing the generated SQL.
I can only see <server_name> | <database_name>, whereas in the other app I can see the whole query. See the below image for more information about my issue.
But After some time, I received the notification in status monitor like this below figure.
Can you please tell how to resolve the above issue as soon as possible?

How can i fix a "System.Security.SecurityException" within an Azure web application?

I've uploaded my web app onto azure and get the following error when i try to run it:
The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.
The code does write event logs and it works on local machines cause you can run it as an administrator.
How am i able to work around this in Azure?
Applications can write to the application event log but they do not have access to the SECURITY logs due to the sandbox . Any event logs written to application event log are visible in event log.xml....
More details in https://github.com/projectkudu/kudu/wiki/Azure-Web-App-sandbox

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