Microsoft SQL Server Stage Files - Replace placeholders - 1.7

The Generated Artifacts zip file contains files with placeholders for the target environment parameters.

You should replace all the placeholders to deploy your Microsoft SQL Server Target System.

Replace Placeholders

A toolkit is provided in the generated artifacts to replace placeholders.

It is composed of a Powershell script to execute: replace_placeholders.ps1.

For executing commands with Powershell later in this article, please use at least version 7 provided by Microsoft. If you would like to install the latest version, please check here.

The process to follow is:

Update the replacement_config.json file with your values:
  • Insert the value to replace into the value node

The placeholder values for server_name must be empty, except your data solution architecture is deployed on several servers, and you are using Linked Server to allow communication between them. In this case, the Linked Server name must be filled in the server_name placeholder.

  • The database_name for the stage and load control layers should contain the desired name for your target database
    • In our example, we will use a target database named MS_SQL_FI
  • The schema_name for the stage and load control layers should contain the desired name for your target schemas
    • In our example, we will use SA for the stage layer and let the default value LC for the load control layer
  • The four XXX_directory must contain the local path to the folders Source, Format, Archive, and Error
    • In our example, the values are:
      • C:\\TEMP\\biGENIUS-X\\Ressources\\Source\\
      • C:\\TEMP\\biGENIUS-X\\Ressources\\Format\\
      • C:\\TEMP\\biGENIUS-X\\Ressources\\Archive\\
      • C:\\TEMP\\biGENIUS-X\\Ressources\\Error\\

As the path contains  \, you should escape them with another \.

For example, your path is: "C:\TEMP\biGENIUS-X\Ressources\Source\"

In the placeholder's value, you should put "C:\\TEMP\\biGENIUS-X\\Ressources\\Source\\"

DON'T USE PATHS ON CLOUD SPACES AS ONE DRIVE, DROPBOX...

Integrated security inside them stops Microsoft SQL Server from loading a file.

 

Replace the placeholders in the files:

  • Open Windows Powershell (or equivalent) in the replace_placeholders.ps1 location:
  • Execute the following command :
  • .\replace_placeholders.ps1
  • You should have a similar result:

The placeholders were replaced in each concerned file                  
You can now use these files and deploy your Target system

Some parameters can be added to the replace_placeholders.ps1 command.

All are described and available by executing:

.\replace_placeholders.ps1 -help

The -ReplacementConfigPath parameter mainly permits using a replacement_config.json file in another path. It is beneficial when you are in a development mode for your project.

Example of usage:

.\replace_placeholders.ps1 -ReplacementConfigPath "C:\TEMP\Replacement config files\replacement_config_MSSQLServer.json"