Monday, December 16, 2019

Deploy/Host a .Net Core App on a Low Cost Provider (InterServer)

As I am progressing in my journey with .Net Core (Razor Pages), I wanted to showcase my apps and gain some experience with hosting/deployment. But which place to choose? I came across many cheap solutions, out of which I chose https://www.interserver.net/


It's important to note that I want to avoid Azure for this purpose, as it is more costly and I use it only for my job related project to host databases. Of course, I tried the free tier app hosting and deployment, but anyway I need to try a more serious cheap solution, that has way more apps/databases with a lower cost. That's how I came across the above mentioned ASP hosting provider.

Just as a quick note, a list of comparable cheap hosts is presented in this article:  https://dottutorials.net/best-fast-cheap-windows-hosting-asp-net-core/


I purchased the 5 USD/month tier, which contains, most importantly:
- 25 sites
- unlimited databases (MYSQL, MS SQL)
- unlimited storage.

Let's log in to their site, after paying the amount, and use Plesk to manage my sites.

After entering PLESK,  let's see how we can deploy our asp.net core web app!
The following screen appears.

1.  you can add subdomains. I added test3.zoltanhalasz.net (my domain being zoltanhalasz.net)
2. In a subdomain or web site, there will be a dashboard with many functionalities.
3. Download the file from web deploy publishing settings.
4. Go to Visual Studio.
5. Select the Web project (such as Razor pages), hit publish, we will choose web deploy


6. Hit new
7. Import profile - here use the file downloaded at 3)
8. Use the settings from the screenshots below:





Hit Save, and then Publish.
After some minutes, the site should be opening in your browser.
The files (package) deployed will be visible under the File Manager, found in the Plesk dashboard.

How to add a database?

I created a DB, MS SQL Type. It is immediately visible from your local MS SQL Studio, and in 12-24 hours, also from your myLittleAdmin (dashboard app from PLESK).

Any database can be added to an app's connection string (the local ones from Plesk, or even from Azure) and the applications will work.





2 comments:

  1. I was faced with a similar conundrum before building my latest app. I wanted data storage that scaled well as I hoped that my user base would grow to large numbers. Like you, I did not want to use SQL Azure due to the high costs. At the same time I wanted to use Azure web hosting because of the really simple scale out / scale up options. It really is so simple with Azure. The simple compromise I found was to switch my storage to Azure table storage. It required a bit of relearning to understand how non SQL storage needs to be designed for optimum retrieval. Yes there is some data duplication around non normalised table structures but I must say I am so glad I went down this route. I now have 4000 active users and u find the application is lightening fast. Total hosting cost including custom domains is 45 pounds a moth which I consider good value. How does your hosting solution highlighted above perform when it comes to scaling up (firing up new servers). Is it done on an automated basis based on user demand?

    ReplyDelete
  2. I use Interserver.net mainly to test applications, tutorials. I am still in the beginning of my journey. I have a web app on Azure/Linux machine, and two databases on Azure SQL. I am planning to host in the future maybe on Digital Ocean for web app, and probably azure for the SQL database.

    ReplyDelete