<style>p { margin: 0 0 10px; }h1, h2, h3 { margin: 20px 0 10px; }h4, h5, h6 { margin: 10px 0 10px; }</style><p>The Instances area in Halo allows you to see config changes to each of your Halo instances and push config changes from UAT to Production.</p>
<p>This is available automatically in Hosted Halo, but for On-Prem Halo this works a little different and requires some manual set up.</p>
<p>To use this feature with On-Prem Halo, each of your Halo Instances will have their own set of Halo application files. These can be on the same web server or different web servers, but it must be possible for each instance to connect to the database of the other instance(s).</p>
<p>This feature is available in Halo version 2.170+.</p>
<h2 id="defining-the-linked-instances-array">Defining the Linked Instances Array</h2>
<p>First create a JSON array with the names and connection string of each of your Halo databases.</p>
<p>In this example we are using two instances - Production and UAT. Although this can be done with more instances. E.g Production, UAT, Staging, Sandbox. etc.</p>
<pre><code class="language-json">[
{
"envname": "Production",
"hostname": "https://production-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=ProdHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
},
{
"envname": "UAT",
"hostname": "https://uat-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=UATHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
}
]
</code></pre>
<p>Here;</p>
<ul>
<li>Each object in the array represents an instance you want to link.</li>
<li><em>envname</em> is your name for the instance. This should be unique.</li>
<li><em>hostname</em> is the url of the agent app for the instance</li>
<li><em>connectionstring</em> is the database connection string for that instance. This can be the same as the value for ConnectionStrings.DefaultConnection in the instances /api/appsettings.json file.</li>
<li><strong>The Production/Live database must be first in the list</strong></li>
</ul>
<h2 id="add-the-linked-instances-array-and-envname-apiappsettings.json">Add the Linked Instances array and envname /api/appsettings.json</h2>
<p>For each of the instances you want to link, on their Halo web application server, go to the Halo files and open the <em>appsettings.json</em> file in the <em>/api</em> directory.</p>
<p>Add the <em>LinkedInstances</em> property and set it to the array you defined in the previous step.</p>
<p>Add the <em>envname</em> property and set to the name of the instance. This should match the envname of one of the LinkedInstances and is used by Halo to identify which of the instances in the array it is.</p>
<p>For example, the <strong>Production</strong> instance should look similar to this;</p>
<pre><code class="language-json">{
"authentication_root": "",
"ConnectionStrings": {
"DefaultConnection": "Server=SQLSERVER;Database=ProdHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
},
"envname": "Production",
"LinkedInstances": [
{
"envname": "Production",
"hostname": "https://production-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=ProdHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
},
{
"envname": "UAT",
"hostname": "https://uat-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=UATHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
}
]
}
</code></pre>
<p>The <strong>UAT</strong> instance should look similar to this;</p>
<pre><code class="language-json">{
"authentication_root": "",
"ConnectionStrings": {
"DefaultConnection": "Server=SQLSERVER;Database=UATHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Warning"
}
},
"envname": "UAT",
"LinkedInstances": [
{
"envname": "Production",
"hostname": "https://production-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=ProdHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
},
{
"envname": "UAT",
"hostname": "https://uat-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=UATHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
}
]
}
</code></pre>
<p>Save the changes and restart the site.</p>
<p>If configured correctly you should now see the Instances area in Config in each of your Halo instances.</p>
<h2 id="halo-db-integrator">Halo DB Integrator</h2>
<p>Within the appsettings.json file of the DB Halo Integrator for each instance, you will also have to specify the linkage of the two instances.</p>
<p>Add the below to the appsettings.json file to PROD</p>
<pre><code class="language-json">
"envname": "Production",
"LinkedInstances": [
{
"envname": "Production",
"hostname": "https://production-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=ProdHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
},
{
"envname": "UAT",
"hostname": "https://uat-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=UATHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
}
</code></pre>
<p>And the below to UAT</p>
<pre><code class="language-json">
"envname": "UAT",
"LinkedInstances": [
{
"envname": "Production",
"hostname": "https://production-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=ProdHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
},
{
"envname": "UAT",
"hostname": "https://uat-halo-url.com",
"connectionstring": "Server=SQLSERVER;Database=UATHaloDatabase;Trusted_Connection=True;MultipleActiveResultSets=true"
}
</code></pre>