You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Syncfusion license key validation in CI services
21
21
22
-
Syncfusion license key validation in CI services ensures that Syncfusion Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. The following section shows how to validate the Syncfusion license key in CI services.
22
+
Syncfusion license key validation in CI services ensures that Syncfusion Essential Studio components are properly licensed during CI processes. Validating the license key at the CI level can prevent licensing errors during deployment. Set up the continuous integration process to fail in case the license key validation fails. Validate the passed parameters and the registered license key again to resolve the issue.
23
+
24
+
The following section shows how to validate the Syncfusion license key in CI services.
23
25
24
26
* Download and extract the LicenseKeyValidator.zip utility from the following link: [LicenseKeyValidator](https://s3.amazonaws.com/files2.syncfusion.com/Installs/LicenseKeyValidation/LicenseKeyValidator.zip).
25
27
26
-
* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor.
28
+
* Open the LicenseKeyValidation.ps1 PowerShell script in a text\code editor as shown in the below example.
29
+
30
+
{% tabs %}
31
+
{% highlight c# tabtitle="PowerShell" %}
32
+
# Replace the parameters with the desired platform, version, and actual license key.
@@ -37,13 +49,14 @@ Syncfusion license key validation in CI services ensures that Syncfusion Essenti
37
49
38
50
## Azure Pipelines (YAML)
39
51
40
-
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
52
+
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
41
53
42
-
* Integrate the PowerShell task in pipeline and execute the script to validate the license key.
54
+
* Integrate the PowerShell task in the pipeline and execute the script to validate the license key.
43
55
44
56
The following example shows the syntax for Windows build agents.
45
57
46
-
```bash
58
+
{% tabs %}
59
+
{% highlight c# tabtitle="YAML" %}
47
60
pool:
48
61
vmImage: 'windows-latest'
49
62
@@ -55,39 +68,43 @@ steps:
55
68
filePath: $(LICENSE_VALIDATION) #Or the actual path to the LicenseKeyValidation.ps1 script.
56
69
57
70
displayName: Syncfusion License Validation
58
-
```
71
+
{% endhighlight %}
72
+
{% endtabs %}
59
73
60
74
## Azure Pipelines (Classic)
61
75
62
-
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
76
+
* Create a new [User-defined Variable](https://learn.microsoft.com/en-us/azure/devops/pipelines/process/variables?view=azure-devops&tabs=yaml%2Cbatch#user-defined-variables) named `LICENSE_VALIDATION` in the Azure Pipeline. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
63
77
64
-
* Include the PowerShell task in pipeline and execute the script to validate the license key.
78
+
* Include the PowerShell task in the pipeline and execute the script to validate the license key.
* To execute the script in PowerShell as part of a GitHub Actions workflow, include a step in the configuration file and update the path of the LicenseKeyValidation.ps1 script file (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
71
85
72
-
The following example shows the syntax for validating Syncfusion license key in GitHub actions.
86
+
The following example shows the syntax for validating the Syncfusion license key in GitHub actions.
* Create a[Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named 'LICENSE_VALIDATION'. Use Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
100
+
* Create an[Environment Variable](https://www.jenkins.io/doc/pipeline/tour/environment) named 'LICENSE_VALIDATION'. Use the path of the LicenseKeyValidation.ps1 script file as a value (e.g., D:\LicenseKeyValidator\LicenseKeyValidation.ps1).
85
101
86
102
* Include a stage in Jenkins to execute the LicenseKeyValidation.ps1 script in PowerShell.
87
103
88
-
The following example shows the syntax for validating Syncfusion license key in Jenkins pipeline.
104
+
The following example shows the syntax for validating the Syncfusion license key in the Jenkins pipeline.
89
105
90
-
```bash
106
+
{% tabs %}
107
+
{% highlight json %}
91
108
pipeline {
92
109
agent any
93
110
environment {
@@ -101,17 +118,30 @@ pipeline {
101
118
}
102
119
}
103
120
}
104
-
```
121
+
{% endhighlight %}
122
+
{% endtabs %}
105
123
106
-
## Validate the License Key Using ValidateLicense() Method
124
+
## Validate the License Key By Using the ValidateLicense() Method
107
125
108
126
* Register the license key properly by calling RegisterLicense("License Key") method with the license key.
109
127
110
-
* Once the license key is registered, it can be validated by using ValidateLicense("Platform.Blazor") method. This ensures that the license key is valid for the platform and version you are using. For reference please check the following example.
128
+
* Once the license key is registered, it can be validated by using the ValidateLicense("Platform.Blazor") method. This ensures that the license key is valid for the platform and version you are using. For reference, please check the following example.
* If ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.
144
+
* If the ValidateLicense() method returns true, registered license key is valid and can proceed with deployment.
115
145
116
-
* If ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion assemblies or NuGet packages are all on the same version as the license key’s version before deployment.
146
+
* If the ValidateLicense() method returns false, there will be invalid license errors in deployment due to either an invalid license key or an incorrect assembly or package version that is referenced in the project. Please ensure that all the referenced Syncfusion assemblies or NuGet packages are all on the same version as the license key’s version before deployment.
N> * Place the license key between double quotes. Also, ensure that Syncfusion.Licensing.dll is referenced in your project where the license key is being registered.
23
23
* Syncfusion license validation is done offline during application execution and does not require internet access. Apps registered with a Syncfusion license key can be deployed on any system that does not have an internet connection.
24
24
25
+
I> Syncfusion license keys can be validated during the Continuous Integration (CI) processes to ensure proper licensing and prevent licensing errors during deployment. Refer to the [CI License Validation](https://blazor.syncfusion.com/documentation/getting-started/license-key/ci-license-validation) section for detailed instructions on how to implement it.
26
+
25
27
## Blazor Web App
26
28
27
29
Open **~/Program.cs** file and register the Syncfusion Blazor license key in the Blazor web app.
0 commit comments