Hello,
We are hosting our application in Azure Container Apps. When we deploy a new version of our application, we receive the following error:
[07:27:54 ERR] ABP-LIC-0020 - License code not found! Ensure that your appsettings.json or appsettings.secrets.json has "AbpLicenseCode" key with your license code. [07:27:54 ERR] ABP-LIC-ERROR - License check failed for 'Volo.Abp.Identity.Pro.HttpApi-v9.0.3.0'.
I have already checked the appsettings.secrets.json file, and the AbpLicenseCode key is present with the correct value.
To be sure, I restarted a previously working container (which had no issues before), and now it also gives the same license error. This indicates that the issue is not specific to the new deployment.
Could you please assist in identifying the root cause of this license validation problem?
Thank you.
5 Answer(s)
-
0
- The error
[ABP-LIC-0020 - License code not found!]
indicates that the application cannot read theAbpLicenseCode
from your configuration at runtime, even if it is present in yourappsettings.secrets.json
.
To resolve this in Azure Container Apps, follow these steps:
Verify Environment Variable Injection
Azure Container Apps may not automatically useappsettings.secrets.json
. Instead, ensure the license code is injected as an environment variable:- Set an environment variable named
AbpLicenseCode
with your license value in the Azure Container App configuration.
- Set an environment variable named
Check File Mounting and Build Artifacts
- Confirm that
appsettings.secrets.json
is present in the container at runtime. Sometimes, build or deployment steps may exclude this file. - You can exec into a running container and check the file's presence and content.
- Confirm that
Configuration Precedence
- Environment variables take precedence over configuration files. If both are set, the environment variable will be used.
Restart All Containers
- After updating environment variables or configuration, restart all containers to ensure the new settings are loaded.
Check for Typographical Errors
- Ensure the key is exactly
AbpLicenseCode
(case-sensitive).
- Ensure the key is exactly
Review Application Logs
- Check for any configuration loading errors or warnings in the logs that might indicate why the license code is not being read.
Example: Setting Environment Variable in Azure Portal
- Go to your Azure Container App > Settings > Environment variables.
- Add:
Name: AbpLicenseCode Value:
- Save and restart the container. This approach is recommended and resolves most license code loading issues in containerized ABP deployments. Sources: - https://abp.io/support/questions/6663 - https://abp.io/support/questions/9263 - https://abp.io/QA/Questions/245/ABP-LIC-0008---License-check-failed-for-'XXXXX' --- _This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon._
- The error
-
0
As mentioned in my initial message, I also restarted a previously running container that was working fine before, and it now shows the same license error. This suggests that the issue is not related to the current container’s configuration or contents.
Is there anything else that could be causing this problem, possibly on the ABP license validation service side?
-
0
hi
I have already checked the appsettings.secrets.json file, and the AbpLicenseCode key is present with the correct value.
Does the
appsettings.secrets.json
file exist in theContainer
? Can you try to move theAbpLicenseCode
fromappsettings.secrets.json
toappsettings.json
?Thanks.
-
0
It turns out the root cause was that the JSON configuration files (including appsettings.json and appsettings.secrets.json) were not being copied into the container during deployment. What confused me was that even previously working containers started giving the same license error after a restart. Since it’s not possible to check the container content before it starts, I couldn’t verify whether the appsettings files were present or not.
After adding the license as an environment variable, the container started successfully. This helped me realize the JSON files were missing. Once I fixed the deployment pipeline to include these files, the issue was resolved.
Thank you for your support.
-
0
Great