Skip to content

Deployment

This section describes the basic general steps need to deploy an application to DHI MIKE Cloud Platform cluster.

Consider an application that consists of a React frontend and a C# Backend. The code can be stored in separate repositories or in a single repository. There is an operations repository in Operations project with predefined templates that can simplify deployment of your application.

1. Add a pipeline folder to your code repository and create the following files:

  1. <project-name>.yaml : Defines the deployment template
  2. <project-name>-infrastructure-template-v<V>.yaml : Optional, see (6).
  3. <project-name>-stage-variable-template-<dev|test|prod>-v<V>.yaml : Optional, see (6).
  4. GenerateAppSettings.ps1 : Contains instructions on how to construct application settings.
  5. Infrastructure.ps1 : Optional, see (6). Contains instructions for setting up any extra resources in your Azure Subscription, such as a database, and for inserting secrets, such as database password, into the key vault.
  6. Environment specific templates (3) must be defined only if you want to reference different AzureDevOps variable groups in different Platform environments. The infrastructure template (1) should be used only if you need any extra resources or scripts that are not part of Infrastructure.ps1 (5). You can also skip all infrastructure setup (steps 2 and 5) entirely by specifying parameter InfrastructureTemplateName as empty string in your deployment template (1). This is an ideal option if you just want to deploy a frontend and backend for frontend without any extra resources.

2. Define the deployment template

  1. This file defines parameters for <operations-repo>/stage-templates/common-stage-template-<X>-v<V>.yml and for <operations-repo>/variable-templates/common-pipeline-variable-template-v<V>.yml that you need to reference from the operations repository.

3 Update Infrastructure.ps1

  1. Define any infrastructure that you need for your application, such as a database or other storage or services. An important role of this script is also to insert all secrets (passwords, keys, etc.) of the create infrastructure in the key vault. The deployment process then makes these secrets available in the cluster so your application can access them. Even if you do not need any extra infrastructure other than the Platform itself, you need to insert application Client ID and Client Secret to the key vault using this script.

4. Update GenerateAppSettings.ps1

  1. This script constructs application settings document and pulls secretes from the Key Vault so they are available as secrets in the cluster.

5. Define the infrastructure template

  1. This template links the Infrastructure.ps1 script with DeployInfrastructure pipeline variable so you can control if the Infrastructure.ps1 runs during a particular deployment. In this template, you can also define extra variables that will be passed to Infrastructure.ps1.

6 Reference the deployment template in Azure DevOps pipeline.

  1. Finally, create a 'Existing Azure Pipelines YAML file' pipeline in Azure Devops and reference the deployment template yaml file as the Path parameter. At this stage you can define any default Pipeline variables, such as DeployInfrastructure=false. Save the new pipeline and Run it.

7 Define the argocd-aks-1- repository

  1. Platform uses ArgoCD for GitOps. ArgoCD orchestrates automatic deployment of your application whenever your source code changes. To configure this, your project will need so called "argocd" repository.
  2. Please reach out to the Platform team for assistance.

For more details and information about advanced setup options, contact wdpservice@dhigroup.com.