Open Closed

License Error After Deploying New Container in Azure Container Apps #9615


User avatar
0
abodur created

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)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • The error [ABP-LIC-0020 - License code not found!] indicates that the application cannot read the AbpLicenseCode from your configuration at runtime, even if it is present in your appsettings.secrets.json.

    To resolve this in Azure Container Apps, follow these steps:

    1. Verify Environment Variable Injection
      Azure Container Apps may not automatically use appsettings.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.
    2. 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.
    3. Configuration Precedence

      • Environment variables take precedence over configuration files. If both are set, the environment variable will be used.
    4. Restart All Containers

      • After updating environment variables or configuration, restart all containers to ensure the new settings are loaded.
    5. Check for Typographical Errors

      • Ensure the key is exactly AbpLicenseCode (case-sensitive).
    6. 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._
    
  • User Avatar
    0
    abodur created

    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?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    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 the Container? Can you try to move the AbpLicenseCode from appsettings.secrets.json to appsettings.json?

    Thanks.

  • User Avatar
    0
    abodur created

    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.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Great

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 01, 2025, 08:37