Applications

Creating Applications

When creating a new application on your server, a variety of configuration options are available to you:

  • Domain name: The domain name that the server should respond to for this app.
  • .NET version: The version of .NET your application is using.

Create application

Supported .NET Versions

Dotnet Engine supports the following .NET versions:

  • .NET 6
  • .NET 7
  • .NET 8

Supported Application Types

Dotnet Engine supports the following types of ASP.NET applications:

  • ASP.NET Razor
  • ASP.NET MVC
  • Blazor SSR
  • Blazor Server (websockets)
  • Minimal API

Linking Repositories

After creating your application, you will need to link your Github repository and the branch you want to deploy.

You will also need to provide the path to your .csproj file that you want to be built and deployed.

link app repo

App Configs

If your application needs environment specific values, like a database connection string or API keys, you can add them to your apps .env or appsettings.Secret.json file in Dotnet Engine.

These files only exists on your server and are never added to your source control.

appsettings.Secret.json

The appsettings.Secret.json file is added to your application during the build process by Dotnet Engine. It provides the ability to add environment specific values to your app securely.

You can edit your appsettings.Secret.json file on your apps app-config page in Dotnet Engine.

Creating appsettings.Secret.json

Configuring appsettings.Secret.json in your app

You can tell your app to use the appsettings.Secret.json file by adding it as an optional json config in your Program.cs file.

var builder = WebApplication.CreateBuilder(args);

builder
    .Configuration
    .AddJsonFile("appsettings.Secret.json", optional: true, reloadOnChange: true);

Environment Variables

You can also make environment specific variables accessable to your app via environment variables. Dotnet Engine does this by including a .env file to your apps Docker container.

You can add environment variables to the .env file on your apps environment page in Dotnet Engine.

environment file

Accessing environment variables in your app

You can access environment variables in your app by using the Environment.GetEnvironmentVariable method.

var apiKey = Environment.GetEnvironmentVariable("SOME_API_KEY");

Deployments

You can trigger deploys for you app after linking your repo in your apps dashboard page in Dotnet Engine.

The most recent commit in your linked repo will be deployed

Your application will be deployed in a docker container. Each deployment will tear down the container of your last deployment and create a new container.

It is recommended to setup your DNS records prior to your first deploy.

You can find instructions on setting up your DNS records here

deploying app

Deployment Logs

Once your deployment is finished, you can view all of the deployment output in your servers event logs. This can be very helpful for debugging failed deployments.

DNS Records

To view your applications at an actual URL, you will need to setup your DNS records wherever you purchased your domain.

It is important you enter this correctly. Dotnet Engine will setup the proper NGINX configurations with this domain name.

Setting Up DNS Records

When setting up DNS Records, you will need your server’s public IP address. This can be found on your server page in Dotnet Engine.

As an example, if your domain is mydomain.com, you would need to setup the following DNS records:

Record 1:

  • Hostname @
  • Type A
  • Data Server IP Address

Record 2:

  • Hostname www
  • Type CNAME
  • Data mydomain.com

DNS Records for Subdomain

If you want your app on a subdomain, you will only need 1 DNS record.

As an example, if your domain was test.mydomain.com, you would need to setup the following record:

  • Hostname test
  • Type A
  • Data Server IP Address