> For the complete documentation index, see [llms.txt](https://docs.tricloudnexus.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.tricloudnexus.io/edge/nexus-modules/platform-modules/apphostmodule/twin-config.md).

# Twin Config

To host external applications in the AppHostingModule, each application requires some configuration.\
The twin configuration should contain a list of applications, that are set in the property "applications".

The required properties for each application are:

* **executableName**: Name of the executable to run. Only .net dll's and exe files are currently supported.
* **executableFolderInsideZip**: The AppHostingModule downloads zip files containing the application. This property states the path inside the zip file, to the executable. If the executable is not in a folder, leave this empty.
* **sasUri**: SAS uri for cloud blob storage location of the application zip file. There is one SAS Uri per application.
* **httpPort**: The port exposed by the application. Currently only supports http from localhost.
* **executableArguments**: The arguments provided for running the executable.
* **executableType**: Application type. Currently only "Dotnet" is supported (0).
* **zipFileName**: Name of the zip file, containing the application.
* **validateChecksum**: If set to true, the zip file checksum is validated against the sha256Checksum, to ensure the file integrity.
* **sha256Checksum**: If the validateChecksum is set to true, this property holds the desired sha256 checksum.

To generate the sha256 checksum, the following powershell must be executed:

`Get-FileHash <Path to zip file>`

Here is an example of a twin configuration, containing 2 .net applications:

```
"applications": {
    "Application1": {
        "executableName": "Application1.dll",
        "executableFolderInsideZip": "",
        "sasUri": "https://tciotingestionstoragedev.blob.core.windows.net/app-hosting-module-drop/Application1.zip?sp=r&st=2023-02-20T09:39:24Z&se=2024-02-20T17:39:24Z&spr=https&sv=2021-06-08&sr=b&sig=ETj8%2BxIdf3duGOmp6xyOkf4mxv4dDAHSJNbJMXhOccU%3D",
        "httpPort": "5010",
        "executableArguments": "--AppHostingModuleRootDirectoryPath=/appdata/apphostingmodule --ImagesRootDirectoryPath=/appdata/images",
        "executableType": 0,
        "zipFileName": "Application1.zip",
        "validateChecksum": true,
        "sha256Checksum": "8F4E994DCE5EC56AFCE7188B11B47A6F705AC3EB8D209312140433A202E3E04C"
    },
    "Application2": {
        "executableName": "Application2.exe",
        "executableFolderInsideZip": "",
        "sasUri": "https://tciotingestionstoragedev.blob.core.windows.net/app-hosting-module-drop/Application2.zip?sp=r&st=2023-02-20T09:39:24Z&se=2024-02-20T17:39:24Z&spr=https&sv=2021-06-08&sr=b&sig=ETj8%2BxIdf3duGOmp6xyOkf4mxv4dDAHSJNbJMXhOccU%3D",
        "httpPort": "5011",
        "executableArguments": "--AppHostingModuleRootDirectoryPath=/appdata/apphostingmodule --ImagesRootDirectoryPath=/appdata/images",
        "executableType": 0,
        "zipFileName": "Application2.zip",
        "validateChecksum": false,
        "sha256Checksum": ""
    }
}
```
