From fc7b095ff81932d0aa3cf72253ab32efd8a1ce41 Mon Sep 17 00:00:00 2001 From: Dimo Dimov <961014+dimodi@users.noreply.github.com> Date: Tue, 4 Mar 2025 13:09:00 +0200 Subject: [PATCH] docs(common): Improve Azure Pipelines license key info --- deployment/ci-cd-license-key.md | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/deployment/ci-cd-license-key.md b/deployment/ci-cd-license-key.md index 5015c78982..cb2d6a3482 100644 --- a/deployment/ci-cd-license-key.md +++ b/deployment/ci-cd-license-key.md @@ -31,32 +31,48 @@ The recommended way to provide your license key to the `Telerik.Licensing` NuGet ### Azure Pipelines -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. -1. Paste the contents of the license key file as a value of the variable. +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). +1. Paste the contents of the license key file as a value of the secret variable. +1. Map the secret variable to a new environment variable named `TELERIK_LICENSE`. +1. Use the `TELERIK_LICENSE` environment variable in the tasks, steps, or scripts that build and publish the Blazor app. + +>caption Using a TELERIK_LICENSE environment variable in Azure Pipeline YAML + +````YAML.skip-repl +steps: + +- task: DotNetCoreCLI@2 + inputs: + command: 'build' + # ... + env: + TELERIK_LICENSE: $(Secret_Telerik_License_Key) +```` > 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. ### GitHub Actions 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). -1. Set the name of the secret to `TELERIK_LICENSE` and paste the contents of the license file as a value. -1. Add a `TELERIK_LICENSE` environment variable to the steps, which build and publish the Blazor app: +1. Paste the contents of the license key file as a value of the GitHub secret. +1. Assign the secret to an environment variable named `TELERIK_LICENSE`. +1. Use the `TELERIK_LICENSE` environment variable in the steps, which build and publish the Blazor app: ````YAML.skip-repl env: - TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }} + TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }} ```` The resulting workflow steps may look similar to: ````YAML.skip-repl - name: Build Step run: dotnet build -c Release env: - TELERIK_NUGET_KEY: ${{ "{{ secrets.TELERIK_NUGET_KEY }}" }} - TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }} + TELERIK_NUGET_KEY: ${{ "{{ secrets.Telerik_NuGet_Key }}" }} + TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }} - name: Publish Step run: dotnet publish -c Release env: - TELERIK_LICENSE: ${{ "{{ secrets.TELERIK_LICENSE }}" }} + TELERIK_LICENSE: ${{ "{{ secrets.Telerik_License_Key }}" }} ```` 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.