Install LS Central with PowerShell
In this section, we are going to install LS Central with PowerShell. Installing packages with PowerShell offers the most flexibility and is easy to experiment with, while you can also install packages with a user-friendly installer.
Prerequisite
- Update Service client, see below.
- PowerShell knowledge.
- Client cmdlets quick start
Let's install an Update Service client if you don't have one already.
- Download the Update Service Client installer from the portal.
- Run the installer. It should say Installed.
- This will add the client and cmdlets to your machine.
- Open a new PowerShell session, such as PowerShell ISE.
Warning
You must restart any open PowerShell session to enable the new cmdlets.
Latest LS Central Demo
We will start with the most simple case, installing a demo setup of LS Central, where the necessary apps are included, Business Central, and a database with demo data.
You can install all these components with a so-called bundle package, bundle/ls-central-demo-data:
Install-UscPackage -Id 'bundle/ls-central-demo-data' -InstanceName 'LSCentral'
Let's break this down,
Install-UscPackage
is a function or a cmdlet provided with the Update Service client, to install packages.-Id 'bundle/ls-central-demo-data'
tells the cmdlet what package to install. In this instance, it will install a so-called bundle package which includes other packages.-InstanceName 'LSCentral'
sets the name of the service tier, database, and web client. You can install multiple instances with different instance names.
This will download and install almost all the components you need to run the latest version of LS Central, including Business Central and the demo database.
Warning
It is common for the first-time installation to fail, due to dependencies that require a restart after installation.
- Restart the machine and try again.
- No SQL server installed, see below.
- License missing, see below.
- See troubleshooting for further analysis.
Need SQL Server?
Possibly you don't have a SQL server installed, we can include it in the installation:
Import-Module UpdateService
$Packages = @(
@{ Id = 'sql-server-express'; Version = '' }
@{ Id = 'bundle/ls-central-demo-data'; Version = '' }
)
$Packages | Install-UscPackage -InstanceName 'LSCentral'
If you already have a SQL server, you can specify the SQL instance in an argument:
Import-Module UpdateService
$Arguments = @{
'ls-central-demo-database' = @{
ConnectionString = 'Data Source=localhost\SQLEXPRESS;Initial Catalog=${Package.InstanceName};Integrated Security=True'
}
}
Install-UscPackage -Id 'bundle/ls-central-demo-data' -Version '' -InstanceName 'LSCentral' -Arguments $Arguments
Here we specify the argument ConnectionString
for the ls-central-demo-database package, you must specify an existing server in the connection string. By default, Update Service picks the default SQL instance (localhost\MSSQLSERVER).
Notice the database name is specified by the variable ${Package.InstanceName}
, this will be replaced by Update Service at installation with the instance name specified for the installation. You can however replace it yourself with a specific name.
Include a License
We haven't included any license yet, as the bundle package will install runtime version of the apps, which doesn't require any license. But if you want to update to the latest version (when released), you need to include a license. We can also specify that with an argument LicenseUri
for the bc-server package:
Import-Module UpdateService
$Arguments = @{
'bc-server' = @{
LicenseUri = 'c:\path\to\your\license.flf'
}
}
Install-UscPackage -Id 'bundle/ls-central-demo-data' -Version '' -InstanceName 'LSCentral' -Arguments $Arguments
Upgrade LS Central
When there is a new LS Central release, you can run the same script, with -UpdatedInstance
added to the Install-UscPackage
cmdlet. You can also, just try to install an older version and then update to the latest one:
Import-Module UpdateService
$Arguments = @{
'bc-server' = @{
LicenseUri = 'c:\path\to\your\license.flf'
}
}
Install-UscPackage -Id 'bundle/ls-central-demo-data' -Version '16.0' -InstanceName 'LSCentral' -Arguments $Arguments
Install-UscPackage -Id 'bundle/ls-central-demo-data' -Version '' -InstanceName 'LSCentral' -Arguments $Arguments -UpdateInstance
Choose What You Install
For greater flexibility, we can specify the packages to install and which version. An equivalent to the bundle/ls-central-demo-data bundle package would be:
Import-Module UpdateService
$Arguments = @{
'bc-server' = @{
AllowSessionCallSuspendWhenWriteTransactionStarted = 'true'
}
}
$Packages = @(
@{ Id = 'ls-central-demo-database'; Version = '' }
@{ Id = 'bc-server'; Version = '' }
@{ Id = 'bc-web-client'; Version = '' }
@{ Id = 'bc-system-symbols'; Version = '' }
@{ Id = 'bc-system-application-runtime'; Version = '' }
@{ Id = 'bc-base-application-runtime'; Version = '' }
@{ Id = 'ls-central-app-runtime'; Version = '' }
@{ Id = 'map/ls-central-to-bc'; Version = '' }
)
$Packages | Install-UscPackage -InstanceName 'LSCentral' -Arguments $Arguments
Similarly, you can install only Business Central:
Import-Module UpdateService
$Packages = @(
@{ Id = 'bc-demo-database'; Version = '' }
@{ Id = 'bc-server'; Version = '' }
@{ Id = 'bc-web-client'; Version = '' }
@{ Id = 'bc-system-symbols'; Version = '' }
@{ Id = 'bc-system-application-runtime'; Version = '' }
@{ Id = 'bc-base-application-runtime'; Version = '' }
)
$Packages | Install-UscPackage -InstanceName 'BC' -Arguments $Arguments
Specify Version
We can also specify the version of LS Central:
Import-Module UpdateService
$Arguments = @{
'bc-server' = @{
AllowSessionCallSuspendWhenWriteTransactionStarted = 'true'
}
}
$LsCentralVersion = '16.0'
$Packages = @(
@{ Id = 'ls-central-demo-database'; Version = $LsCentralVersion }
@{ Id = 'bc-server'; Version = '' }
@{ Id = 'bc-web-client'; Version = '' }
@{ Id = 'bc-system-symbols'; Version = '' }
@{ Id = 'bc-system-application-runtime'; Version = '' }
@{ Id = 'bc-base-application-runtime'; Version = '' }
@{ Id = 'ls-central-app-runtime'; Version = $LsCentralVersion }
@{ Id = 'map/ls-central-to-bc'; Version = $LsCentralVersion }
)
$Packages | Install-UscPackage -InstanceName 'LSCentral' -Arguments $Arguments
Notice how we can only specify the LS Central version and leave the version empty for the Business Central packages. This is because we are also installing the map/ls-central-to-bc package, which has internal dependencies to select the Business Central version that LS Central was released on.
If you want to specify a newer version of Business Central, remove the map/ls-central-to-bc package from the list, and specify a version for Business Central:
Import-Module UpdateService
$Arguments = @{
'bc-server' = @{
AllowSessionCallSuspendWhenWriteTransactionStarted = 'true'
}
}
$LsCentralVersion = '16.0'
$BcAppVersion = '16.3'
$BcPlatformVersion = '16.0.14073'
$Packages = @(
@{ Id = 'ls-central-demo-database'; Version = $LsCentralVersion }
@{ Id = 'bc-server'; Version = $BcPlatformVersion }
@{ Id = 'bc-web-client'; Version = $BcPlatformVersion }
@{ Id = 'bc-system-symbols'; Version = $BcPlatformVersion }
@{ Id = 'bc-system-application-runtime'; Version = $BcAppVersion }
@{ Id = 'bc-base-application-runtime'; Version = $BcAppVersion }
@{ Id = 'ls-central-app-runtime'; Version = $LsCentralVersion }
)
$Packages | Install-UscPackage -InstanceName 'LSCentral' -Arguments $Arguments
this could however fail if the newer version of the Business Central apps has broken any of their APIs that LS Central depends on.
More Examples
See more examples of how to install LS Central with PowerShell in our Github repository.