Skip to content

Commit adfe056

Browse files
authored
docs(common): Improve Azure Pipelines license key info (#2802)
1 parent 8351b9b commit adfe056

File tree

1 file changed

+24
-8
lines changed

1 file changed

+24
-8
lines changed

deployment/ci-cd-license-key.md

+24-8
Original file line numberDiff line numberDiff line change
@@ -31,32 +31,48 @@ The recommended way to provide your license key to the `Telerik.Licensing` NuGet
3131
3232
### Azure Pipelines
3333
34-
1. Create a new [user-defined variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables) named `TELERIK_LICENSE`, according to your [YAML](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#set-variables-in-pipeline) or [Classic](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=classic%2Cbatch#set-variables-in-pipeline) pipeline setup.
35-
1. Paste the contents of the license key file as a value of the variable.
34+
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).
35+
1. Paste the contents of the license key file as a value of the secret variable.
36+
1. Map the secret variable to a new environment variable named `TELERIK_LICENSE`.
37+
1. Use the `TELERIK_LICENSE` environment variable in the tasks, steps, or scripts that build and publish the Blazor app.
38+
39+
>caption Using a TELERIK_LICENSE environment variable in Azure Pipeline YAML
40+
41+
````YAML.skip-repl
42+
steps:
43+
44+
- task: DotNetCoreCLI@2
45+
inputs:
46+
command: 'build'
47+
# ...
48+
env:
49+
TELERIK_LICENSE: $(Secret_Telerik_License_Key)
50+
````
3651

3752
> 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.
3853
3954
### GitHub Actions
4055

4156
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).
42-
1. Set the name of the secret to `TELERIK_LICENSE` and paste the contents of the license file as a value.
43-
1. Add a `TELERIK_LICENSE` environment variable to the steps, which build and publish the Blazor app:
57+
1. Paste the contents of the license key file as a value of the GitHub secret.
58+
1. Assign the secret to an environment variable named `TELERIK_LICENSE`.
59+
1. Use the `TELERIK_LICENSE` environment variable in the steps, which build and publish the Blazor app:
4460
````YAML.skip-repl
4561
env:
46-
TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }}
62+
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
4763
````
4864
The resulting workflow steps may look similar to:
4965
````YAML.skip-repl
5066
- name: Build Step
5167
run: dotnet build -c Release
5268
env:
53-
TELERIK_NUGET_KEY: ${{ "{{ secrets.TELERIK_NUGET_KEY }}" }}
54-
TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }}
69+
TELERIK_NUGET_KEY: ${{ "{{ secrets.Telerik_NuGet_Key }}" }}
70+
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
5571
5672
- name: Publish Step
5773
run: dotnet publish -c Release
5874
env:
59-
TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }}
75+
TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }}
6076
````
6177
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.
6278

0 commit comments

Comments
 (0)