Adding the License Key to CI/CD Services
This article describes how to set up and activate your Telerik Reporting license key across a few popular CI services by using environment variables.
When working with CI/CD platforms, always add the Telerik.Licensing
NuGet package as a project dependency. This package activates Telerik Reporting at build time by using the provided license key.
The license activation process in a CI/CD environment involves the following steps:
- Download a license key from your Telerik account.
-
Create an environment variable named
TELERIK_LICENSE
and add your Telerik Reporting license key as a value. Alternatively, use the Azure Secure files approach.
Creating an Environment Variable
The recommended approach for providing your license key to the Telerik.Licensing
NuGet package is to use environment variables. Each CI/CD platform has a different process for setting environment variables and this article lists only some of the most popular examples.
If your CI/CD service is not listed in this article, don’t hesitate to contact the Telerik technical support.
GitHub Actions
- Create a new Repository Secret or an Organization Secret.
- Set the name of the secret to
TELERIK_LICENSE
and paste the contents of the license file as a value. -
After running
npm install
oryarn
, add a build step to activate the license:
Azure Pipelines (YAML)
- Create a new secret variable named
TELERIK_LICENSE
. - Paste the contents of the license key file as a value.
Always consider the Variable size limit—if you are using a Variable Group, the license key will typically exceed the character limit for the variable values. The only way to have a long value in the Variable Group is to link it from Azure Key Vault. If you cannot use a Key Vault, then use a normal pipeline variable instead (see above) or the Secure files approach.
Using Secure Files on Azure DevOps
Secure files are an alternative approach for sharing the license key file in Azure Pipelines that does not have the size limitations of environment variables.
You have two options for the file-based approach. Set the TELERIK_LICENSE_PATH
variable or add a file named telerik-license.txt
to the project directory or parent directory.
Make sure you’re referencing
Telerik.Licensing v1.4.10
or later.
YAML Pipeline
With a YAML pipeline, you can use the DownloadSecureFile@1 task, then use $(name.secureFilePath)
to reference it. For example:
Classic Pipeline
With a classic pipeline, use the “Download secure file” task and a PowerShell script to set TELERIK_LICENSE_PATH
to the secure file path.
- Add a "Download secure file" task and set the output variable's name to
telerikLicense
.
- Add a PowerShell task and set the
TELERIK_LICENSE_PATH
variable to thesecureFilePath
property of the output variable:
The script to set the environment variable is quoted below:
Alternatively, copy the file into the repository directory: