Thoughts from the Wet Coast

The musings of an ASP.NET Developer from Canada's We(s)t Coast

Naif.Blog: 7. We’re live

Category: ASP.NET Core
Last Modified: Aug 28 2018
May 9 2017

Just over a year ago when I started creating my own Blogging web application I stated that one of the goals of this exercise was to remove my dependency on an expensive SQL Server database.  I am pleased to announce that I have accomplished my goal - You are reading this post on my re-launched personal blog site running on my new blog app - Naif.Blog on Microsoft Azure.

A few days ago I made some final updates to Naif.Blog, mostly around updating the source code to the latest version of the ASP.NET Core framework, which re-introduced the use of csproj project files rather than the xproj project file with a project.json configuration file. 

Once I was satisfied that the code was functioning as expected I created a new Azure Web App in my Microsoft Azure subscription and published my project, using the Publish option in Visual Studio 2017.

New LocalURL Property

In order to support the ability to work locally as well as on Azure, without worrying about keeping separate blogs.json configuration files, I added an additional LocalUrl property, to the Blog object (see below)


The LocalUrl property can be used when running locally and the Url property can be used when running remotely.  As long as we ensure all the image references and links are relative urls, the site displays exactly the same, regardless of whether you are debugging in your local dev environment or you are viewing the production site.

The ApplicationContextMiddleware class is updated by checking whether the request is local, and determining the correct blog accordingly.


Cost Saving

The next step was to export the blog content from my existing DNN sites - I have 2 DNN blog sites - (this blog) and (my family history site) - update any absolute links to relative links and push everything live.


While that sounds simple it did take a few days, but now that its been done for a few days I can already see the cost savings in my Azure subscription.  My typical monthly burn rate is $35-40. 

You can see from the figure that the burn rate slowed considerably about a week ago as both of my DNN sites and their accompanying SQL Databases were deleted in favour of the new Naif.Blog based site.  Azure is projecting this months cost to be $22, and I expect that this will drop to $12-15 once there is a full month of cost savings.


The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.