Azure Service fault logs in C# application - c#

I am using different azure service,(Kuberentes cluster,API,Key vault,IOT HUB, ,cosmos db,storage account,datalake,ad b2c,Power BI).I want the failure message and time of these service in my c# (other any other language)application. Is there any api for this purpose ?.or any way to get failure message and time ?
Failure means
failure state or non responding state of azure service.
I just want the any failure or fault message.Not normal message and service message.i didn't find any such kind filter or rest api or type

Since you are already using multiple Azure Services your best bet would be to integrate your application with Azure Application Insights. Application Insights is a monitoring and diagnostics tool provided by Azure. Configuring Application Insights is extremely easy. You can check this link.
Depending upon your framework and choice of language there are multiple options. Once you have installed the Application Insights SDK in your solution, it will automatically start monitoring and reporting all failures. All external dependencies in your application will get automatically tracked and all failures will be logged automatically (in 90% of the scenarios you won't have to write custom code to track these errors). Other parameters like time and failure messages will also get logged. In case you are interested to check which Azure Services are monitored check the link here.
Along with this you will also get the option to log custom messages, events, metrics, exceptions or dependencies.

I don't know the exact purpose of your question ,But if you want to check the service is available or not (failed due to some internal issue of azure) then use resource health check.
https://learn.microsoft.com/en-us/azure/service-health/resource-health-faq

If you want to monitor azure services then you must create a diagnostic setting for each azure service to send its logs to log analytics workspace to use with an azure monitor or for archiving you can use Azure storage archive tier/cool tier or Azure Event hubs to forward outside of Azure(like configuring with Kafka).
For more information visit https://learn.microsoft.com/en-us/azure/azure-monitor/

Related

Azure - HTTP Server Errors from FrontEnd only detected

I am trying to analyze below Azure observation when checked under "Diagnose and Solve Problems" feature - Web App Down. Azure SLA is 99.99% but it shows organic SLA - 99.98%. My App Service Plan is S1 and having only one application. Application is limited to business client but publicly hosted.
client has not raised any concern about web app down. but below observation shows site was down as it is listed under Web App Down feature. I see this observation daily. How do I interpret this?

Logging and troubleshooting HTTP 502s (Request Timeouts) within Azure App Service

We had an issue this week where a non-performant SQL query caused an app to start sending 502's as the time it took to run the query passed the Azure App Service request timeout setting (which seems to NOT be user definable)
I'm trying to find a way to detect and alert on these issues. I've gone thru the microsoft documentation but only find recommendations like "scale out" - If I look at Application Insights it doesn't seem to log the 502 since, from the app's perspective, the script ran successfully. Is there a way to log there instances with some context to fix non-performant scripts before a user calls in about a 502? The only option I see is to NOT use the built in load balancing/app gateway features of Azure App Service and roll a separate load balancer/gateway to have more control over it..

Azure Push notifications without Azure Mobile project?

I'm building a Phonegap application that uses a server backend built with .net MVC 5 & Web API2. It's hosted on Azure cloud services and all is working well.
I now need to add some functionality to send push notifications when certain events happen. I've set up a Mobile Service on Azure and configured it for IOS (I will add Android when I have it working) and I now need to start coding the functionality.
I was planning on storing the device registration Id in my own Database and writing a simple class/service that consumes the Azure Mobile Services API to send the push notification. I've spent the last few hours reading up on this and all of the tutorials involve creating a new Azure Mobile Services project which uses Azure Table storage and configuring that (https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn629482.aspx).
I'd like to avoid this as it seems like overkill and it's yet another thing I'll need to deploy and manage.
Does anyone know if it is it possible to just add the required references to my existing cloud services project and do it the way I proposed?
Many thanks,
John
Since you already have a working backend, you don't need a Mobile Service just to send Push Notifications. Take a look at Azure Notification Hubs. You can call it via REST from your MVC, or use the Azure Service Bus NuGet package.
Take a look at this introduction: Get started with Notification Hubs
Note that you will need two different Notification Hubs, one with the sandbox APNs certificate for use with Xcode development builds, and one with the production APNs certificate for release and ad-hoc builds. If you don't have a separate instance of your MVC service for development, you will have to keep the device registrations straight somehow between the two.

deploying WCF to the WAS

Please allow me to preface that I am in an odd environment.
i need to deploy a WCF service to iis that does not have manager installed, previously i have installed into a virtual directory, etc. that path. Without manager present this appears to not be an option, so I am wanting to install to the WAS, can anyone please provide any information on this I cannot find anything precise details in regard to this. do I need it to be in a precise location? are there command lines to execute for this?
I think I handle it via the config files I am using and I am following this example:How to: Host a WCF Service in WAS
but it lacks specific details as to where I need to locate the service files.
installed features include:
.net 3.5.1
Windows process activation service with process model, .net environment,a dn configuration api's
wcf activation with both http activation and non-http activation.
thx.
I did find this set of instructions for getting this going, everything else just made too many assumptions where this one provided a clear detailed instruction set for actually getting the service going in the WAS.
Extend Your WCF Services Beyond HTTP With WAS

Querying a Windows Service over a Network

I have written a windows service in C# that gathers performance, disk and memory information and writes it to the EventLog. It is enabled as a network service. What I would like to do is be able to gather this information from a remote location. This service will run at various client machines and I would like to retrieve this information periodically (once a day) and store them in a database table. I am confused as to how one can query a windows service over a network. In other words, what exactly makes the service a "Network Service"?
I do not want the service to directly connect to my database and write this information. But I would like to initiate it from a remote machine, retreive the information and then write that information to my database table.
I was unable to find any tutorial that illustrates a networked windows service. Most of them covered writing to event logs and I am pretty much stuck there.
Is this doable, are there any suggestions about how this sort of stuff is done?
If the other suggestions to move over to WCF Web services are not an option, you can do allot with Custom commands in a windows service without having to resort to remoting.
Effectively you can send an integer between 128 & 256 and then have your service execute whatever code you need it to when it receives that command, like sending all the information to your database or web service.
You will be able to initiate it from your side as and when you need to while the service happily trundles along on the client machines.
Take a look at this code project article for an example: Creating a Basic Windows Service in C#
Take a look at the OnCustomCammand method.
Here's another example article from Microsoft: Communicate With Windows Services
Use WCF to enable some form of a RESTful Web Service.
See wcf-getting-started on MSDN, and specially A Guide to Designing and Building RESTful Web Services with WCF.
AFAIK 'Network Service' just means that it is running under the "Network Service" account which has a different set of permission than the 'Local Service' or 'System' accounts.
To expose a service to another machine on the network however (apart from the standard STOP, START, RESTART functionality that you get through the services snap-in - services.msc) you will need to create your service using something like Remoting, Webservices or most ideally as gimel mentioned WCF.

Categories