New to Telerik UI for WinForms? Download free 30-day trial

Adding Your License Key to CI/CD Services

This article describes how to set up and activate your Telerik UI for .NET WinForms license key across a few popular CI/CD 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 the Telerik UI for .NET WinForms components at build time by using the provided license key.

If you cannot use NuGet packages in your project, see the workaround in the Adding Your License Key to CI Platforms as a Code Snippet KB article.

The license activation process in a CI/CD environment involves the following steps:

  1. Download a license key from your Telerik account.

  2. Add the Telerik.Licensing NuGet package as a project dependency.

    <PackageReference Include="Telerik.Licensing" Version="1.*" />
    
  3. Create an environment variable named TELERIK_LICENSE and add your Telerik UI for .NET WinForms license key as a value.

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.

Azure Pipelines (YAML)

  1. Create a new user-defined variable named TELERIK_LICENSE.
  2. Paste the contents of the license key file as a value.

Azure Pipelines (Classic)

In Classic Pipelines, the user-defined variables can only hold up t0 4k characters. This is too small for the full key, as an alternative there are two more popular options.

Option 1. Azure KeyVault Linked Variable

  1. In Azure Key Vault, create a new variable named TELERIK_LICENSE
  2. Paste the contents of the license key file as a value.
  3. In the classic pipeline, use the linked variable

Option 2. Secure File

  1. Upload your telerik-license.txt file as a Secure File in your AzDO project. See Secure Files for instructions.
  2. In the pipeline, use the Download Secure File task
    1. Important: Set the Output Variables reference name, otherwise you cannot reference it in a later step.
      • image
  3. Just prior the build task, add a PowerShell step to move the file to $(Build.Repository.LocalPath) and we will automatically locate it.
    1. Example: Move-Item -Path $(telerik.secureFilePath) -Destination $(Build.Repository.LocalPath)

For a walkthrough example and more details, see DevOps Examples - Telerik License with Secure File in Classic Pipeline

GitHub Actions

  1. Create a new Repository Secret or an Organization Secret.
  2. Set the name of the secret to TELERIK_LICENSE and paste the contents of the license file as a value.
  3. After running npm install or yarn, add a build step to activate the license:
env:
    TELERIK_LICENSE: $

See Also

In this article