Implementing Health Checks in ASP.NET Core
Published 5 years ago
Being able to monitor your ASP.NET Core web applications and APIs and detect any issues early on is crucial in ensuring your sites are up and running and in a healthy state. In a previous article I talked about creating a custom health check solution for ASP.NET Framework applications. In this article I'll show you how to leverage the built-in Health Check framework available for ASP.NET Core applications. You may want to check out the previous article to better understand health checks and why they are useful. And seeing the custom solution for the .NET Framework may have you appreciate the built-in ASP.NET Core functionality even more. In a future article I'll dive a little deeper into some existing third-party health checks that make monitoring your sites and services super easy and show you how to build your own health checks and plug them into the system.
Read on ...
Improving your ASP.NET Core site's e-mailing capabilities
Published 5 years ago
Many websites depend heavily on e-mail: they send account confirmation e-mails, password reset e-mails, order confirmations, back-in-stock notifications and much more. Despite its importance, I often see that sending e-mail is an overlooked area when writing well maintainable and stable code. It's also often overlooked when monitoring sites and lots of code I have seen just assumes the mail server is up and running. But problems will occur; mail servers will go down, passwords do expire or get changed without updating the web site and more.
In a preceding article you saw how to monitor your site's SMTP server using an ASP.NET Core health check. While it's great to be notified when your SMTP server is unavailable, it would be even better if your site has an alternative way to deliver the messages when the primary SMTP is not available.
In this article, I'll show you a couple of ways to improve the way you send e-mails from your ASP.NET Core applications. In particular, I'll discuss:
- Hiding send functionality behind an interface
- Providing multiple concrete implementations to send e-mails in different ways and configure the best one at runtime
- Implementing a fallback solution for cases where your primary mail server is not available
- How to use MailKit to replace the built-in SmtpClient which is now considered obsolete by Microsoft
- How to use the SendGrid API to send e-mails from your application
You'll find the full code for the article as a download at the end of this article, as well as in the Github repository for this article.
Read on ...
Implementing Health Checks in ASP.NET Framework
Published 5 years ago
Being able to monitor your ASP.NET web applications and APIs and detect any issues early on is crucial in ensuring your sites are up and running and in a healthy state. To implement simple monitoring in ASP.NET apps until ASP.NET 4.x, I usually add some custom code to my projects to provide health information from an endpoint With ASP.NET Core 2.2 and later this now comes in the box. In this article I'll show you how you can implement health checks using custom code targeting the .NET Framework (although it should also work on .NET Core). In future articles I'll then show you how you can set up similar checks in an ASP.NET Core app with standard functionality and how to extend the base system using existing third-party health checks like an SMTP server monitor, to make your health checks even more powerful.
Read on ...- «First
- ‹Previous
- 1
- ›Next
- »Last
Mobile: False
Crawler: True
I: False