Skip to content

Repository files navigation

Using markdown for static web pages

Cheapest .NET Core 10 app on Azure

Introduction

The main idea of this repository is to design and implement the cheapest website based on the latest .NET Core and Angular frameworks deployed to Microsoft Azure. The total cost for the website is $69 per month, and it includes:

  1. Azure App Service Basic Plan - B1
  2. SQL Database Single Basic - B
  3. Virtual Network Private Link

Publish .NET Core 10 app

The Azure App is composed of compiled .NET Core 10 and compiled Angular 20 app and designed to work like a dynamic (server side) and a static (client side) website. The static part of Angular app is generated with a script based on NG-ZORRO documentation scripts The main architecture of Angular app is described here. The architecture of .NET Core app is described here The compiled JavaScript files are served by the same .NET Core app which serves API controllers. In this way, we get the simplest and cheapest website deployed to Microsoft Azure. Compared to Moonglade, our website has a much simple API controller architecture and deployment process is done from Visual Studio with a click on a single Publish button.

What Is This?

.NET Core 10 app

Here are all my markdown files that I use to build all my "static" web pages for my website: https://cioina.azurewebsites.net

Why?

When you find something wrong and really want me to correct it, just make a pull request!

Run Binary on Local Windows Machine

Website Setup

In order use compiled binary from bin folder

  1. Clone this repository
  2. Delete database BlogAngularDb if already exists. Make sure you do not need previous data.
  3. Change ConnectionStrings to your MS SQL Server in bin/Release/net9.0/appsettings.json
  4. In IIS 10, setup a website to http://localhost:5000

appsettings.json

{
  "ApplicationSettings": {
    "SecurityTokenDescriptorKey": "TheSecurityTokenDescriptorKeyGoesHere",
    "SecurityTokenDescriptorExpiresInMinutes": 60,
    "SecurityTokenRefreshRate": 0.5,
    "MaxFailedAccessAttempts": 7,
    "DefaultLockoutTimeSpanInMinutes": 30,
    "ExperimentalIpAddress": "0"
  },
  "ConnectionStrings": {
    "DefaultConnection": "Data Source=YourSQLServer;Initial Catalog=BlogAngularDb;Integrated Security=False;User Id=sa;Password=YourPassword;MultipleActiveResultSets=True;Encrypt=False;"
  },
  "AllowedHosts": "*",
  "Serilog": {
    "Using": [ "Serilog.Sinks.Console", "Serilog.Sinks.File" ],
    "MinimumLevel": {
      "Default": "Information",
      "Override": {
        "Microsoft": "Warning",
        "Microsoft.Hosting.Lifetime": "Information"
      }
    },
    "WriteTo": [
      { "Name": "Console" },
      {
        "Name": "File",
        "Args": {
          "path": "logs\\blog-log-.txt",
          "rollingInterval": "Month"
        }
      }
    ],
    "Enrich": [ "FromLogContext" ]
  },
  "IpRateLimiting": {
    "EnableEndpointRateLimiting": true,
    "SecurityTokenRefreshRate": 0.5,
    "StackBlockedRequests": false,
    "RealIpHeader": "X-Real-IP",
    "HttpStatusCode": 429,
    "IpWhitelist": [
    ],
    "EndpointWhitelist": [
      "post:/api/v1.0/identity",
      "post:/api/v1.0/articles",
      "get:/api/v1.0/tags",
      "get:/*.json",
      "get:/*.js",
      "get:/*.css",
      "get:/*.ico",
      "get:/*.svg",
      "get:/*.ttf",
      "get:/*.woff",
      "get:/*.woff2"
    ],
    "ClientWhitelist": [
    ],
    "QuotaExceededResponse": {
      "Content": "Quota exceeded. Maximum allowed: {0} per {1}. Please try again in {2} second(s). Your IP address is {3}",
      "ContentType": "application/json"
    },
    "GeneralRules": [
      {
        "Endpoint": "post:/api/v1.0/identity/login",
        "Period": "30m",
        "Limit": 10
      },
      {
        "Endpoint": "post:/api/v1.0/identity/register",
        "Period": "30m",
        "Limit": 3
      }
    ]
  },
  "IpRateLimitPolicies": {
    "IpRules": [
    ]
  }
}

Administrator Credential

Email: admin@myblog.com Password: Admin123456Admin!

Releases

Packages

Used by

Contributors

Languages