Base solution for your next web application

Activities of "pliaspzero"

We have same issue pls help!

Could it also be done like this?

Clear Cache on Setting Change

ABP Framework uses caching for settings to improve performance. If the cache is not cleared immediately after a setting is updated, one of the instances may continue using the outdated settings.

To ensure the cache is cleared after saving changes, you should explicitly clear the cache after updating the ABP Settings. Here’s how you can handle cache invalidation programmatically after saving settings:

csharp

// Clear cache after settings are saved await _cacheManager.GetCache("AbpSettingsCache").ClearAsync();

This ensures that the cache is cleared and both instances will load the updated settings from the database.

Thank you! so solution would be to setup REdis Cache (in Azure) and ...

Configuration.Caching.UseRedis(options => { options.ConnectionString = _appConfiguration["Abp:RedisCache:ConnectionString"]; options.DatabaseId = _appConfiguration.GetValue<int>("Abp:RedisCache:DatabaseId"); });

Could it be a problem with Instance count 2 in Azure - we are running 2 instances? With some caching issue?

Dear ASPZERO Support,

We are encountering an issue with our Azure deployment - we use Angular + ASPNET Core ASPZERO V12:

In our application, we are using an Angular app with an ASP.NET Core API, along with the ABP Boilerplate and custom user-based settings stored in the AbpSettings table. In our on-premise environment, when we change settings via the UI, the updates are applied immediately.

However, in the Azure environment, where the Angular app and the ASP.NET Core Web API are deployed as separate App Services, changes to the AbpSettings table via the UI do not take effect immediately. We need to confirm the changes multiple times before they are actually reflected in the application.

Both environments are connected to SQL Server — one running locally, and the other using an Azure SQL Managed Instance.

Could this be due to caching, or do you have any insight into why the settings changes in the Azure environment are not immediately applied?

Thank you in advance for your support.

ok - thanks - in ASPZERO - could I do it here?

public static class AppConfigurations
{
    private static readonly ConcurrentDictionary&lt;string, IConfigurationRoot&gt; ConfigurationCache;

    static AppConfigurations()
    {
        ConfigurationCache = new ConcurrentDictionary&lt;string, IConfigurationRoot&gt;();
    }

    public static IConfigurationRoot Get(string path, string environmentName = null, bool addUserSecrets = false)
    {
        var cacheKey = path + "#" + environmentName + "#" + addUserSecrets;
        return ConfigurationCache.GetOrAdd(
            cacheKey,
            _ => BuildConfiguration(path, environmentName, addUserSecrets)
        );
    }

    private static IConfigurationRoot BuildConfiguration(string path, string environmentName = null,
        bool addUserSecrets = false)
    {
        var builder = new ConfigurationBuilder()
            .SetBasePath(path)
            .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true);

        if (!environmentName.IsNullOrWhiteSpace())
        {
            builder = builder.AddJsonFile($"appsettings.{environmentName}.json", optional: true);
        }

        builder = builder.AddEnvironmentVariables();

        if (addUserSecrets)
        {
            builder.AddUserSecrets(typeof(AppConfigurations).GetAssembly(), true);
        }

        var builtConfig = builder.Build();
        new AppAzureKeyVaultConfigurer().Configure(builder, builtConfig);

        return builder.Build();
    }

Dear ASP.NET Zero Support Team,

I hope this message finds you well.

I am currently working on our ASP.NET Core & Angular project and have a couple of questions regarding the configuration of our appsettings.json files for container deployments.

Dynamic Configuration Loading: How can we configure our ASP.NET Core application to load settings from a specific subfolder when the environment variable IsContainer is set to true? We want to ensure that the application correctly uses this configuration in a containerized environment.

New Folder for Configuration Files: For both the ASP.NET Core backend and the Angular frontend, we would like to create a new, dedicated folder solely for appsettings*.json files. Instead of loading these configurations from the /assets folder in the Angular project, we want a separate clean folder. What steps should we follow to implement this structure in both projects?

Thank you for your assistance!

Ok - thanks

How can I exclude appsettings.json & appsettings.Production.json (MVC API)

and for angular: assets/appconfig.json assets/appconfig.json assets/appconfig.k8s.json assets/appconfig.production.json - could this also be done in build-with-ng.ps1?

Ok - thanks

How can I exclude appsettings.json & appsettings.Production.json (MVC API)

and for angular: assets/appconfig.json assets/appconfig.json assets/appconfig.k8s.json assets/appconfig.production.json - could this also be done in build-with-ng.ps1?

Usage of Angular & ASP:NET CORE - V12:

As part of a client project, we need to deliver our solution in containers. Specifically, we have two containers: one containing the Angular application and the other likely containing the ASP.NET Core component.

Our client has requested that we manage environment variables and configuration files outside of the Docker images to enhance security and flexibility. We would like to know if you have any recommendations or best practices for achieving this with ASP Zero-based solutions. Here are some specific points we are considering:

Creating a Dockerfile without including configuration files. Avoiding hard-coded configuration values in the Dockerfile. Building the Docker image.

Showing 61 to 70 of 143 entries