Microsoft Fabric Stage JDBC - Replace the placeholders - 1.4

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

You should replace all the placeholders to deploy to Microsoft Fabric Stage JDBC Target System.

Replace the Placeholders

A toolkit is provided in the generated artifacts to replace the 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
    • Each database_directory placeholder should contain the path to create the Target Parquet files
        • If you are using our Microsoft Fabric Stage JDBC environment example, you can copy the path by:
          • Opening the Lake House (bglakehouse1 in our example) in the left menu:
          • Opening the Context menu of the Tables folder and choosing the Properties entry:
          • Copying the ABFS path:

Currently, all the Target Parquet files should be stored in the default Tables folder. Soon, Microsoft Fabric's new releases will allow storing them in subfolders by Layer for example.

Please delete in the replacement_config.json file all the values filled by the generator for database_name.

    • The jdbc-url placeholder should contain the JDBC URL to connect to the source through JDBC:
      • If you are using our Microsoft Fabric Stage JDBC environment, the JDBC URL is the following:
        jdbc:sqlserver://bgsqlserver.database.windows.net:1433;encrypt=true;databaseName=AdventureWorks2019;trustServerCertificate=true;
        • bgsqlserver is the name of the Azure SQL Server
        • AdventureWorks2019 is the name of the Azure database
    • The jdbc-user and jdbc-password placeholders should have credentials to connect to the JDBC source.
      • You can enter the user and password directly in plain text, for example:
{
"name": "fabric1.4.0stagejdbc#adventureworks#jdbc_user",
"value": "'user_name'",
"secretname": ""
},
{
"name": "fabric1.4.0stagejdbc#adventureworks#jdbc_password",
"value": "'password'",
"secretname": ""
}

Putting the user and password inside quotes 'user_name' and 'password' is essential.

      • Or you can use KeyVault to store a secret. In this case, the syntax should be:
        • jdbc_user: TokenLibrary.getSecret('<name of the secret>', '<name of the user property in the secret>')
        • jdbc_password: TokenLibrary.getSecret('<name of the secret>', '<name of the password property in the secret>')
  • 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 configured values in all generated artifacts replaced the placeholders
    • 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 allows 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_

If you run into any issues, check our FAQs section for Generate Artifacts: