Skip to content

1. Deployment

Mark Downie edited this page Feb 21, 2023 · 37 revisions

There are multiple ways to deploy dasblog-core. The fastest and easiest way to try out dasblog-core is to use the "Deploy to Azure Button" below.

Deployment topology

Have it your way! When you deploy a blog there are essentially three options for your URI. The two first two options deploy technically in the same way.

  1. https://yourdomain.com
  2. https://blog.yourdomain.com
  3. https://yourdomain.com/blog

As stated options 1. and 2. technically mean the same thing in terms of deployment. Your whole site is a das-blog application. This is the standard way to deploy dasblog-core, you configure the dasblog-core site.config file with <root>https://yourdomain.com</root> or <root>https://blog.yourdomain.com</root>. There are more details about the mechanics of configuration below.

The third option depends on the purpose of your site and what part the blog plays on the site. If your blog is a part of a larger web site, you may decide to deploy the blog as a sub-path on your site:

  • <root>https://yourdomain.com/blog</root>

If you want to follow this approach, you will need to deploy dasblog-core slightly different. Review this section below: Deploy your blog as part of a larger site.

Deploy to Azure Button

1. Click the Deploy To Azure Button

Deploy to Azure

  • Choose your Azure Subscription
  • Choose or create a Resource Group
  • Choose a Region
  • Choose A Unique Site Name
  • SKU and Worker Size default to the recommended values for production
  • Set the repo URL to your fork of DasBlog-Core (e.g. https://github.com/MYUSERNAME/dasblog-core.git)
  • Choose the branch to deploy (main is recommended)

2. Configure DasBlog Core settings

Go to your App Service in the Azure Portal and click on the Advanced Tools then click on Debug Console->CMD. At the prompt type the following commands to configure DasBlog Core with your sites root URL.

cd site\wwwroot

dasblog-core init

dasblog-core config root https://yoursitename.azurewebsites.net

Deploy to Azure App Services for Linux

1. Create your Azure App Service

  • Publish: Code
  • Runtime Stack: .NET 6 (Early Access)
  • Operating System: Linux
  • SKU & size: B1 or above is recommended for production use.

2. Grab the latest version of DasBlog Core and upload

Download the latest version of the DasBlog Core zip files. To upload the content of the zip file you will need to grab your FTP credentials from Deployment Center in the Azure Portal and upload the files to the site root location (site/wwwroot) using an FTP client.

3. Configure your App Services Environment

Go to your App Service in the Azure Portal and navigate to Configuration settings and under Application Settings click the New Application Setting button to create a new setting with the following name and value:

  • Name: ASPNETCORE_ENVIRONMENT
  • Value: Production

Under General Settings ensure the the Stack Settings are as follows:

  • Stack: .NET
  • Major Version: .NET 6
  • Minor Version: .NET 6 (Early Access)
  • Startup Command: dotnet DasBlog.Web.dll

4. Configure DasBlog Core settings

Go to your App Service in the Azure Portal click on the Advanced Tools then click on SSH. At the prompt type the following commands to configure DasBlog Core with your sites root URL.

cd ..

cd home\site\wwwroot

dotnet dasblog-core.dll init

dotnet dasblog-core.dll config root https://yoursitename.azurewebsites.net

Deploy to Azure App Services for Windows

1. Create your Azure App Service

  • Publish: Code
  • Runtime Stack: .NET 6 (Early Access)
  • Operating System: Windows
  • SKU & size: B1 or above is recommended for production use.

2. Grab the latest version of DasBlog Core and upload

Download the latest version of the DasBlog Core zip files. To upload the content of the zip file you will need to grab your FTP credentials from Deployment Center in the Azure Portal and upload the files to the site root location (site/wwwroot) using an FTP client.

3. Configure your App Services Environment

Go to your App Service in the Azure Portal and navigate to Configuration settings and under Application Settings click the New Application Setting button to create a new setting with the following name and value:

  • Name: ASPNETCORE_ENVIRONMENT
  • Value: Production

Under General Settings ensure the the Stack Settings are as follows:

  • Stack: .NET
  • .NET Version: .NET 6 (Early Access)

4. Configure DasBlog Core settings

Go to your App Service in the Azure Portal and click on the Advanced Tools then click on Debug Console->CMD. At the prompt type the following commands to configure DasBlog Core with your sites root URL.

cd site\wwwroot

dasblog-core init

dasblog-core config root https://yoursitename.azurewebsites.net

Deploy to your own web host

This option requires a host that supports .NET 6.

1. Grab the latest version of DasBlog Core and configure locally

Download the latest version of DasBlog Core zip files, unzip the content and open the DasBlog directory with a command line tool. Execute the following commands to configure your DasBlog configuration files:

dasblog-core.exe init

dasblog-core.exe config root https://www.yoursitename.com

Upload the updated content to your site root location, this can generally be accomplished with FTP (using an FTP client), or you can sign in an upload via the host provided user interface for managing files.

2. Configure your Host environment

DasBlog Core requires sufficient permissions to read/write to its own directories specifically the Content and Config folders.

Deploy to your local machine

1. Grab the latest version of DasBlog Core and configure locally

Download the latest version of DasBlog Core zip files, unzip the content and open the DasBlog directory with a command line tool. Execute the following commands to configure your DasBlog configuration files:

dasblog-core.exe init

dasblog-core.exe config root https://localhost:5001/

To run DasBlog locally run the following command from your preferred CLI:

DasBlog.Web.exe

Navigate to https://localhost:5001/.

Note: You may see cert errors for connecting to localhost.

Deploy your blog as part of a larger site

This is the scenario where your blog is a part of a larger site and you choose to deploy dasblog-core as a 'subfolder'. The site.config will look similar to this <root>https://yourdomain.com/{blog}</root>. The exact subfolder structure is up to you and dasblog-core supports whatever path you choose.

When you deploy in this manner to Azure you will create a subdirectory virtual application for your blog on the site. Depending on what OS you host on and on what platform, it may look different, but here is what this looks like on Azure App Services for Windows:

image

image

The /blog virtual path is mapped to the site\wwwblog physical folder. You deploy dasblog-core to that folder.

The deployment of files into this folder is supported directly in MS Deploy Web Publish. You configure the deployment to send the files to a certain path on your site and the IIS will save the files to the physical folder configured as the target for the virtual application.

This is what that looks like in Visual Studio in the publish file:

image

If you follow this approach your blog will be an aspect of your site and you can deploy it in exactly the same manner as the rest of your site. The approach has clear advantages and an additional responsibility. You will need to synchronize styling and menu options between the two sites / and /blog, but the advantage is that you get a site-integrated blog feature and can also host other content on the same site.

Additional questions?

If you have additional questions or concerns please submit an issue.

Clone this wiki locally