百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
T

TailwindTraders-Backend

> 编程语言
开源

Tailwind Traders 后端服务

196 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

Tailwind Traders 后端服务

Tailwind Traders Backend Services

This repository contains all code + deployment scripts for the Tailwind Traders Backend.

Table of contents

  • Repositories
  • Deployment scenarios
    • Deploy Tailwind Traders Backend on Azure AKS and Azure resources (CosmosDb and Storage accounts)
    • Deploy Tailwind Traders Backend on Windows and Linux containers in AKS
  • [Run Tailwind Traders Backend Services Locally(#run-backend-locally)
  • Run Tailwind Traders Backend using Bridge to Kubernetes
  • Test image classiffier
  • Contributing

Repositories

For this demo reference, we built several consumer and line-of-business applications and a set of backend services. You can find all repositories in the following locations:

  • Tailwind Traders
  • Backend (AKS)
  • Website (ASP.NET & React)
  • Desktop (WinForms & WPF -.NET Core)
  • Rewards (ASP.NET Framework)
  • Mobile (Xamarin Forms 4.0)

Deployment scenarios

Tailwind Traders supports two deployment scenarios:

  1. Deploy Tailwind Traders Backend on Azure AKS and Azure resources (CosmosDb and Storage accounts)
  2. Deploy Tailwind Traders Backend on Windows and Linux containers in AKS

Service Principal

A Service Principal is needed for creating the AKS. If you use the CLI for create the resources, you can reuse a SP one passing to the script the id and password as optional parameters; if not, the script will create a new one for you and will print the details (id and password among them).

In case you use Azure Portal for the resources' creation, you can also reuse a SP or create manually a new one for passing the credentials to the template.

If you want to create a Service Principal, you can do so via the CLI

az ad sp create-for-rbac --skip-assignment --name myAKSClusterServicePrincipal

The output is similar to the following example. Make a note of your own appId and password. These values are used when you create an AKS cluster throughout this guide.

{
  "appId": "559513bd-0c19-4c1a-87cd-851a26afd5fc",
  "displayName": "myAKSClusterServicePrincipal",
  "name": "http://myAKSClusterServicePrincipal",
  "password": "e763725a-5eee-40e8-a466-dc88d980f415",
  "tenant": "72f988bf-86f1-41af-91ab-2d7cd011db48"
}

Deploy using one script

You can deploy all basics scenarios using one script under /Deploy folder.

  • Deploy Tailwind Traders Backend on Azure AKS and Azure resources (CosmosDb and Storage accounts)

    Running the following command you can deploy starting with the infrastructure and ending with deploying the images on the storage:

.\Deploy-Unified.ps1 -resourceGroup  -location  -clientId  -password  -subscription 
  • resourceGroup: The name of your resource group where all infrastructure will be created Required
  • location: Select where you want to create your resource group, for example: eastus Required
  • clientId: Id of the service principal used to create the AKS Required if your user does not have permissions to create a new one
  • password: Password of the service principal Required
  • subscription: Id of your subscription where you are going to deploy your resource group Required

The process will take few minutes.

  • Deploy Tailwind Traders Backend on Windows and Linux containers in AKS

    Running the following command you can deploy starting with the infrastructure and ending with deploying the images on the storage. This command requires more parameters than Linux scenario because we need to build and deploy a WCF service.

    Note For mixed (Windows and Linux containers) scenario we need to deploy Tailwind Traders Rewards before it. Because you are going to need some resources that Tailwind Traders Rewards creates.

.\Deploy-Unified-WinLinux.ps1 -resourceGroup  -location  -clientId  -password  -subscription  -deployWinLinux $true -rewardsResourceGroup  -rewardsDbPassword 
  • deployWinLinux: Flag needed to execute Windows-Linux scenario
  • csprojPath: Path location where Tailwind.Traders.Rewards.Registration.Api.csproj is in your machine Required
  • msBuildPath: Path location where MSBuild.exe is, for example: C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Current\Bin
  • rewardsResourceGroup: The name of the resource group where Tailwind Traders Rewards is deployed Required
  • rewardsDbPassword: Tailwind Traders Rewards database password (Tailwind Traders Rewards Registration, WCF service, connects to this database) Required

The process will take few minutes, more than Linux scenario, it will create an Azure Kubernetes Service with Windows and Linux nodes.

In addition to the following documentation you can also deploy infrastructure and services step by step.

Deploy Tailwind Traders on AKS and Azure Resources (CosmosDb and Storage accounts)

To run Tailwind Traders you need to create the Azure infrastructure. There are two ways to do it. Using Azure portal or using a Powershell script.

Step 1 - Option 1: Creating infrastructure using Azure Portal

An ARM script is provided so you can automate the creation of the resources required for the backend services just clicking following button:

Azure portal will ask you for the following parameters:

  • servicePrincipalId: Id of the service principal used to create the AKS
  • servicePrincipalSecret: Password of the service principal
  • aksVersion: AKS version to use (at least 1.14).

The deployment could take more than 10 minutes, and once finished all needed resources will be created:

Step 1 - Option 2: Create the resources using the CLI

You can use the CLI to deploy the ARM script. Open a Powershell window from the /Deploy/powershell folder and run the Deploy-Arm-Azure.ps1 with following parameters:

  • -resourceGroup: Name of the resource group
  • -location: Location of the resource group

You can optionally pass two additional parameters:

  • -clientId: Id of the service principal uesd to create the AKS
  • -password: Password of the service principal

If these two parameters are not passed a new service principal will be created.

There is an additional optional parameters to control some aspects of what is created:

  • -deployAks: If set to $false AKS and ACR are not created. This is useful if you want to create the AKS yourself or use an existing AKS. Defaults to $true. If this parameter is $true the resource group can't exist (AKS must be deployed in a new resource group).

Once script finishes, everything is installed. If a service principal has been created, the script will output the service principal details - please, take note of the appId and password properties for use them in the AKS deployment

Step 2: Deploy Backend services on AKS

Pre-requisites for this deployment are to have:

  • The AKS and all related resources deployed in Azure
  • A terminal with Powershell environment
  • Azure CLI 2.0 installed.
  • Kubectl installed with the last version (v1.15.0 at this moment).
  • Helm 3 installed with 3.0 or superior version (v3.0.0 at this moment).
  • Docker installed

Connecting kubectl to AKS

From the terminal type:

  • az login and follow instructions to log into your Azure.
  • If you have more than one subscription type az account list -o table to list all your Azure subscriptions. Then type az account set --subscription to select your subscription
  • az aks get-credentials -n -g to download the configuration files that kubectl needs to connect to your AKS.

At this point if you type kubectl config current-context the name of your AKS cluster should be displayed. That means that kubectl is ready to use your AKS

Configuring services

Before deploying services using Helm, you need to setup the configuration. We refer to the configuration file with the name of gvalues file. This file contains all secrets and connection strings so beware to not commit in your repo accidentally.

An example of this file is in helm/gvalues.yaml. The deployment scripts use this file by default, but do not rely on editing this file. Instead create a copy of it a folder outside the repository and use the -valuesFile parameter of the deployment script.

Note: The folder /Deploy/helm/__values/ is added to .gitignore, so you can keep all your configuration files in it, to avoid accidental pushes.

Note: If you come from the Windows and Linux containers scenario you must add the Rewards database's connection string, in the values file you are using, for example:

yaml
inf:
(...)
  db:
  (...)
    rewards:
      host: tcp:*****.database.windows.net
      port: "1433"
      catalog: rewardsdb # you must not modify this name
      user: ttuser
      pwd: YourPassword
    (...)

Please refer to the comments of the file for its usage. Just ignore (but not delete) the tls section (it is used if TLS is enabled).

Auto generating the configuration file

Generating a valid gvalues file can be a bit harder, so there is a Powershell script that can do all work by you. This script assumes that all resources are deployed in the same resource group, and this resource group contains only the Tailwind Traders resources. Also assumes the Azure resources have been created using the tools provided in this repo.

Note The Generate-Config.ps1 uses the application-insights CLI extension to find the application insights id. Install it with az extension add --name application-insights

To auto-generate your gvalues file just go to /Deploy/powershell folder and from a Powershell window, type the following:

.\Generate-Config.ps1 -resourceGroup  -outputFile ..\helm\__values\

The parameters that Generate-Config.ps1 accepts are:

  • -resourceGroup: Resource group where all Azure resources are. Required.
  • -outputFile: Full path of the output file to generate. A good idea is to generate a file in /Deploy/helm/__values/ folder as this folder is ignored by Git. If not passed the result file is written on screen.
  • -gvaluesTemplate: Template of the gvalues file to use. The parameter defaults to the /Deploy/helm/gvalues.template which is the only template provided.

The script checks that all needed resources exists in the resource group. If some resource is missing or there is an unexpected resource, the script exits.

If you come from the Windows and Linux containers in AKS scenario and you want to use the rewards registration service you have to pass also the following parameters:

  • -rewardsResourceGroup: Fill it if you are going to use Rewards DB (this is used, for example in the Windows and Linux containers in AKS scenarios).
  • -rewardsDbPassword: The database password for the administrator user. Required if a rewardsResourceGroup is provided.

Otherwise the script will disable the rewards registration service.

Create secrets on the AKS

Docker images are stored in a ACR (a private Docker Registry hosted in Azure).

Before deploying anything on AKS, a secret must be installed to allow AKS to connect to the ACR through a

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言