Skip to content

Commit 3532f23

Browse files
authored
docs(Common): Improve Deployment License Keys docs (#2854)
* docs(Common): Improve Deployment License Keys docs * Update deployment/ci-cd-license-key.md * Revamp page structure * fixes
1 parent ee5e971 commit 3532f23

File tree

1 file changed

+74
-33
lines changed

1 file changed

+74
-33
lines changed

deployment/ci-cd-license-key.md

Lines changed: 74 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,32 @@ position: 7
1010

1111
# Telerik License Key in CI/CD Environment
1212

13-
This article describes how to set up and activate your [Telerik UI for Blazor license key](slug:installation-license-key) across a few popular CI/CD services by using environment variables.
13+
This article describes how to set up and activate your [Telerik UI for Blazor license key](slug:installation-license-key) across a few popular cloud build CI/CD services. You can find guidance and examples on how to set environment variables for some of the most popular CI/CD platforms.
1414

1515
@[template](/_contentTemplates/common/get-started.md#license-key-version)
1616

1717
## Basics
1818

19-
The Telerik license activation process in a CI/CD environment involves the following steps:
19+
The Telerik license activation process in CI/CD environments involves the following steps:
2020

2121
1. Go to the [License Keys page](https://www.telerik.com/account/your-licenses/license-keys) in your Telerik account and download your license key.
22-
1. Set your license key value as an [environment variable](#creating-environment-variables) with a name `TELERIK_LICENSE`. In specific cases you may need to [use a license file](#using-license-file) instead.
22+
1. Set an environment variable with either of the following names:
23+
* `TELERIK_LICENSE`—the value must be the Telerik license key string.
24+
* `TELERIK_LICENSE_PATH`—the value must be the full path to the license key file, including the license file name itself. `TELERIK_LICENSE_PATH` requires `Telerik.Licensing` version `1.4.9` and above. You can use it with Telerik UI for Blazor `8.1.0` and above.
2325

24-
## Creating Environment Variables
26+
In most cases, the recommended way to provide your license key to the `Telerik.Licensing` NuGet package in CI/CD environments is to use the `TELERIK_LICENSE` environment variable.
2527

26-
The recommended way to provide your license key to the `Telerik.Licensing` NuGet package in CI/CD environment is to use an environment variable. Each CI/CD platform has a different process for setting environment variables. This article lists only some of the most popular examples.
28+
Use `TELERIK_LICENSE_PATH` or [only a license file](slug:installation-license-key#manual-installation) on Windows and Windows Server machines, which are managed directly through the operating system's user interface. Do not use the `TELERIK_LICENSE` environment variable in this case, due to the large variable value length.
2729

28-
### Azure Pipelines
30+
> Treat the license key and the license file as secrets. Always store and retrieve them in a secure manner, according to the build platform's best practices.
2931
30-
1. Create a new [secret variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables). Follow the respective producedure for your **YAML**, **Classic**, or **CLI** pipeline setup. Also check the separate article [Set Secret Variables](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables).
32+
## Azure Pipelines
33+
34+
Azure Pipelines provides built-in tools to store and use secret environment variables and secure files. The recommended option with **Classic** pipelines is to [download the Telerik license file as a secure file](#use-telerik_license_path).
35+
36+
### Use TELERIK_LICENSE
37+
38+
1. Create a new [secret variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#secret-variables). Also check the separate article [Set Secret Variables](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-secret-variables).
3139
1. Paste the contents of the license key file as a value of the secret variable.
3240
1. Map the secret variable to a new environment variable named `TELERIK_LICENSE`.
3341
1. Use the `TELERIK_LICENSE` environment variable in the tasks, steps, or scripts that build and publish the Blazor app. **Classic** pipelines may need to [set an output variable to share and consume the license key in multiple steps](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/set-variables-scripts?view=azure-devops&tabs=bash#set-an-output-variable-for-use-in-future-jobs).
@@ -43,36 +51,73 @@ steps:
4351
# ...
4452
env:
4553
TELERIK_LICENSE: $(Secret_Telerik_License_Key)
54+
55+
- task: DotNetCoreCLI@2
56+
inputs:
57+
command: 'publish'
58+
# ...
59+
env:
60+
TELERIK_LICENSE: $(Secret_Telerik_License_Key)
4661
````
4762

48-
> Another option is to use a Telerik license file as a [secure file in the pipeline](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/secure-files). Implement a [script that copies the license file](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/secure-files?view=azure-devops#consume-a-secure-file-in-a-pipeline) to the application's root folder, so that it's available to all projects that need it.
63+
### Use TELERIK_LICENSE_PATH
64+
65+
1. [Add a secure file](https://learn.microsoft.com/en-us/azure/devops/pipelines/library/secure-files) and grant any necessary permissions to use it in the pipeline.
66+
1. [Download the secure file](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/download-secure-file-v1?view=azure-pipelines) during pipeline run. The secure file path is available through the [`secureFilePath` output](https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/reference/download-secure-file-v1?view=azure-pipelines#output-variables).
67+
1. Set the `TELERIK_LICENSE_PATH` environment variable in all tasks, steps, or scripts that build and publish the Blazor app.
68+
69+
>caption Using a TELERIK_LICENSE_PATH environment variable in Azure Pipeline YAML
70+
71+
````YAML.skip-repl
72+
steps:
73+
74+
- task: DownloadSecureFile@1
75+
name: telerikLicense
76+
displayName: 'Download telerik-license.txt'
77+
inputs:
78+
secureFile: 'telerik-license.txt'
79+
80+
- task: DotNetCoreCLI@2
81+
inputs:
82+
command: 'build'
83+
# ...
84+
env:
85+
TELERIK_LICENSE_PATH: $(telerikLicense.secureFilePath)
86+
87+
- task: DotNetCoreCLI@2
88+
displayName: 'Publish'
89+
inputs:
90+
command: 'publish'
91+
# ...
92+
env:
93+
TELERIK_LICENSE_PATH: $(telerikLicense.secureFilePath)
94+
````
4995

50-
### GitHub Actions
96+
## GitHub Actions
5197

5298
1. Create a new [Repository Secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-a-repository) or an [Organization Secret](https://docs.github.com/en/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-organization).
5399
1. Paste the contents of the license key file as a value of the GitHub secret.
54100
1. Assign the secret to an environment variable named `TELERIK_LICENSE`.
55-
1. Use the `TELERIK_LICENSE` environment variable in the steps, which build and publish the Blazor app:
56-
````YAML.skip-repl
57-
env:
58-
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
59-
````
60-
The resulting workflow steps may look similar to:
61-
````YAML.skip-repl
62-
- name: Build Step
63-
run: dotnet build -c Release
64-
env:
65-
TELERIK_NUGET_KEY: ${{ "{{ secrets.Telerik_NuGet_Key }}" }}
66-
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
67-
68-
- name: Publish Step
69-
run: dotnet publish -c Release
70-
env:
71-
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
72-
````
73-
Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the article [Restoring NuGet Packages in Your CI Workflow](slug:deployment-nuget). It shows how to use the `TELERIK_NUGET_KEY` environment variable in your CI build environment.
101+
1. Use the `TELERIK_LICENSE` environment variable in the steps, which build and publish the Blazor app.
74102

75-
### Docker
103+
>caption Using a TELERIK_LICENSE environment variable in GitHub Actions
104+
105+
````YAML.skip-repl
106+
- name: Build Step
107+
run: dotnet build -c Release
108+
env:
109+
TELERIK_NUGET_KEY: ${{ "{{ secrets.Telerik_NuGet_Key }}" }}
110+
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
111+
112+
- name: Publish Step
113+
run: dotnet publish -c Release
114+
env:
115+
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
116+
````
117+
118+
Also see [Using NuGet Keys](slug:deployment-nuget#using-nuget-keys) in the article [Restoring NuGet Packages in Your CI Workflow](slug:deployment-nuget). It shows how to use the `TELERIK_NUGET_KEY` environment variable in your CI build environment.
119+
120+
## Docker
76121

77122
1. [Create a Docker build secret](https://docs.docker.com/build/building/secrets/#using-build-secrets) that holds the Telerik license key file.
78123
````SH.skip-repl
@@ -84,10 +129,6 @@ steps:
84129
dotnet publish BlazorProjectName.csproj -c Release -o /app/publish /p:UseAppHost=false
85130
````
86131
87-
## Using License File
88-
89-
Use a license file on Windows and Windows Server machines, which are managed directly through the operating system's user interface. Do not use an environment variable in these cases.
90-
91132
## Next Steps
92133
93134
* [Restore Telerik NuGet Packages in CI/CD Workflows](slug:deployment-nuget)

0 commit comments

Comments
 (0)