Skip to content

April 23, 2014

1

Implementing SSW.HealthCheck – Step by Step

by adamstephensen

We ALWAYS automate our deployments. We always deploy often.

This has many, many benefits. The most important of which is early feedback.

An essential tool when managing deployment of many sites to different environments is a smoke-test page that validates the configuration of the website in that particular environment.

SSW.HealthCheck makes it easy to check your site status.

 

clip_image016[4]

Figure: SSW.HealthCheck let’s us see at a Glance that on this site: the database connection is valid, but Debug mode has not been turned off and SMTP is not configured. We can also easily extend SSW.HealthCheck to perform other tasks like ensuring your database is up to date. I’ll address this in a future article.

 

Create a new web project

Lets start with a new web project, then we’ll add SSW.HealthCheck.

clip_image002[5]

Figure: Create a new web project called Northwind.MusicStore.WebUI

 

clip_image004[5]

Figure: Select the MVC template and click OK.
Optionally: add the ‘Web.API’ and ‘Add unit tests’ options.

Add SSW.HealthCheck.MVC5 to WebUI

clip_image006[4]

Figure: Select Tools | Library Package Manager | Package Manager Console. Enter Install-Package SSW.HealthCheck.MVC5 and press Enter.

Note: Alternatively you can use Tools | Library Package Manager | Manage NuGet Packages for the Solution, and then search for SSW.HealthCheck.MVC5 and click Install.

clip_image008[4]
Figure: Ensure SignalR is configured: Open Startup.cs from the root of your application. Ensure app.MapSignalR() is being called in the Configuration method.

clip_image010[4]

Figure: Run the application and navigate to /HealthCheck

Configure HealthCheck to Test Your Connection Strings

clip_image012

clip_image014
Figure: Because we are using Entity Framework Code First, and it does not actually create the database until the first time it is accessed: Click the Log In link from the toolbar, enter any username and password and click Log In. Because we are trying to access the database to verify credentials this will cause the database to be created.

clip_image016[4]

Figure: The HealthCheck status of your DefaultConnection should now be Passed !

Also, check out the SSW.HealthCheck user guide here http://sswhealthcheck.com/user-guide/

Advertisements
Read more from  Enterprise MVC
1 Comment Post a comment
  1. Duncan
    Sep 13 2014

    Thanks Adam another great blog! Got it running in five minutes nice!

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Note: HTML is allowed. Your email address will never be published.

Subscribe to comments