Search Results for

    Show / Hide Table of Contents

    Deploy Casewhere on Azure

    Prerequisites

    Minimum requirements for Dev and Test

    • App Service: S2 - 2 cores, Ram 3.5 GB
    • Azure VM for databases: 2 cores, Ram 4 GB, Standard SSD
    • Azure Storage: Standard
    • Application Insights: Standard

    Minimum requirements for Production

    • App Service: P1v3 - 2 cores, Ram 8 GB
    • Azure VM for databases: 2 cores, Ram 8 GB, Premium SSD
    • Recovery Services Vault
    • Azure Storage: Standard
    • Application Insights: Standard

    Casewhere

    • Version 2.5 or later
    • Prepare the service certificates as described here
    • Prepare the SSL certificates for your websites

    Deployment diagram

    image-20211116110626556

    Deploy MongoDB

    Deploy Azure VM

    You can quickly learn to create a VM from Azure Portal here. Below are the key settings for deploying MongoDB for Casewhere. Make sure the VM fulfills the requirements of your project as well as the minimum specification required by Casewhere.

    Availability

    If you need to deploy a cluster of VMs, it is recommended to use the Availability Zone for production workload to achieve the highest availability, 99.99%. To ensure high availability, we must spread the VMs across the zones equally.

    image-20211116112546495

    Networking

    • Virtual Network: Specify an appropriate name.

    • Public inbound ports: 3389

    • Make sure you close port 3389 in the Network Security Group when you finish the deployment.

    Monitoring

    • Boot diagnostics: Enabled
    • Enable OS guest diagnostics: Enabled

    Set up Private DNS Zone

    Create a Private DNS Zone.

    Navigate to the Private DNS Zone resource and select the setting Virtual network links. On the upper menu, select Add.

    Select the Virtual Network used by the MongoDB cluster created in the previous step:

    image-20211116153614851

    Create A records for all VMs in your MongoDB cluster.

    image-20211116163452132

    Deploy MongoDB replica set

    MongoDB recommends using a replica set for production workloads. You can follow the guidelines here to install MongoDB and configure the replica set for Casewhere.

    For development and testing environments, a single MongoDB instance can be used to host all Casewhere databases, providing a straightforward and easy setup. However, for high-performance systems where strict Service Level Agreements (SLAs) are required, it is recommended that the database workloads be separated into multiple replica sets. This approach helps optimize performance, scalability, and reliability.

    • Read workload
      • CasewhereData
      • CasewhereFileStorage
      • CasewhereHangfire
      • CasewhereKeys
    • Write workload
      • CasewhereEvents
      • CasewhereLog

    We also recommend using private domain names to reference the VMs instead of IP addresses. For example, use "cw-prod-mongo1.casewhere.db".

    Deploy Azure App Services

    Create App Service Plan

    Follow this guideline to create a Windows App Service Plan. Choose the Pricing Tier relevant for your deployment purpose.

    A Casewhere deployment will need the following sites created. In this document, we will use "cw-prod" as a resource-name prefix but make sure you use an approriate one for your project.

    Azure App Service Casewhere source
    cw-prod-web Casewhere.Worker.Web
    cw-prod-api Casewhere.Worker.Api
    cw-prod-admin Casewhere.Configuration.Web
    cw-prod-job Casewhere.Hangfire

    Deploy files

    There are many ways to deploy files to Azure App Service. In this document, to keep things simple, we recommend using Kudu Zip Push Deploy. Make sure you use the right package for the right app.

    image-20211116181112040

    image-20211116180004900

    Common settings

    The following settings should be done for all four Casewhere App Services.

    Configuration

    Application settings

    This is where you configure the application settings and the connection strings for your app service. We can use the Advanced edit feature to quickly input the settings.

    image-20211116174401485

    Append the keys in the below JSON files to the corresponding configuration sections. Make sure you review and edit the values before applying them, especially the ones related to database URIs, storage accounts, certificates, etc.

    Casewhere source Website Application settings Connection strings
    Worker.Web cw-prod-web cw-prod-web-settings.json None
    Worker.Api cw-prod-api cw-prod-api-settings.json cw-prod-api-connection-strings.json
    Configuration.Web cw-prod-admin cw-prod-admin-settings.json cw-prod-admin-connection-strings.json
    Hangfire cw-prod-job cw-prod-job-settings.json cw-prod-job-connection-strings.json

    If you don't know what a key is about, you can find it in Configuration settings - a complete list of all Casewhere settings.

    You can also learn more about the service certificates for Casewhere here.

    General settings

    Update the followings:

    • Always on: On
    • ARR affinity: On

    For Worker.Api only, change the Platform to 64 bit. The other sites should be 32 bit as-is.

    Custom domains

    Use the following links to add custom domains for your apps. We recommend using the free-managed certificates offered by Azure:

    • Map an existing custom DNS name to Azure App Service
    • Secure a custom DNS with a TLS/SSL binding
    • Add and manage TLS/SSL certificates

    TLS/SSL settings

    Configure the binding setings as below:

    • HTTPS Only: On
    • Minimum TLS Version: 1.2

    Install the service certificates as described here.

    Networking

    The replica set is not accessible from the internet. For the Azure App Service to connect to the replica set, you must link it to the VNet shared with the replica set.

    From the Networking setting, you can configure VNet Integration.

    image-20211116164139293

    In the next screen, choose the VNet and create a new Subnet if not existing with the following settings:

    • Subnet address range: 10.1.0.0/24
    • Network security group: select the existing
    • Delegate subnet to a service: Microsoft.Web/serverFarms

    Finally, add the following settings in the Application settings of your Azure Websites

    • WEBSITE_DNS_SERVER with value 168.63.129.16

    • WEBSITE_VNET_ROUTE_ALL with value 1

    image-20211116164908572

    App Service Logs

    Configure the following setings:

    • Detailed error messages: On

    • Failed request tracing: On

    Configure API key for the background job

    Update the following keys in both Casewhere Api (Worker.Api) and Casewhere Job (Hangfire). These keys are to protect the communication between the two sites.

    Key Sample value Description
    cwjobs:RuntimeApiKey 8sK/3irhASZR/1orkNa50i3vvpSjKn/l7epMRIKSF4g= A secret string
    cwjobs:RuntimeApiEndpoint https://cw-prod-api.casewhere.com/external/v0.1/ Link to your Casewhere Api

    Authentication for Casewhere Admin and Casewhere Job

    Follow this guideline to configure authentication for Casewhere Admin (Configuration.Web) and Casewhere Job (Hangfire). When this step is done, you can login to Casewhere Admin and start configuring your Casewhere solution.

    Configure backup

    For production workload, it is recommened to enable backup for your MongoDB database. It's always a good idea to maintain a backup policy with multiple restore points.

    image-20211116205414683

    In This Article
    Back to top Generated by DocFX