Or you can specify a different database number to isolate the staging and production environment
appsettings.staging.json
"Redis": {
"Configuration": "redis.mindmill.co.uk,defaultDatabase=1"
}
appsettings.production.json
"Redis": {
"Configuration": "redis.mindmill.co.uk,defaultDatabase=2"
}
How to get access token while call App Services;
You can check this: https://github.com/abpframework/abp/blob/554960d596/templates/module/aspnet-core/test/MyCompanyName.MyProjectName.HttpApi.Client.ConsoleTestApp/ClientDemoService.cs
Hi,
You can try this:
https://learn.microsoft.com/en-us/azure/azure-functions/functions-dotnet-dependency-injection https://github.com/junalmeida/autofac-azurefunctions
Here is an example code:
public class Startup: FunctionsStartup
{
public override void Configure(IFunctionsHostBuilder builder)
{
builder.UseAutofacServiceProviderFactory(ConfigureContainer);
builder.Services.AddApplication<MyProjectModule>(options =>
{
});
var serviceProvider = builder.Services.BuildServiceProvider();
serviceProvider.GetRequiredService<IAbpApplicationWithExternalServiceProvider>().Initialize(serviceProvider);
}
private IContainer ConfigureContainer(ContainerBuilder builder)
{
// Register all functions that resides in a given namespace
// The function class itself will be created using autofac
builder
.RegisterAssemblyTypes(typeof(Startup).Assembly)
.InNamespace("MyNamespace.Functions")
.AsSelf() // Azure Functions core code resolves a function class by itself.
.InstancePerTriggerRequest(); // This will scope nested dependencies to each function execution
builder
.RegisterAssemblyTypes(typeof(Startup).Assembly)
.InNamespace("MyNamespace.Services")
.AsImplementedInterfaces()
.InstancePerTriggerRequest();
var appContainer = builder.Build();
return appContainer;
}
}
public class MyProjectModule : AbpModule
{
}
Hi, Is this working for you?
Go to IIS Manager.
The problem is caused by Redis, you can use the local Redis server for development.
Hi,
You can use the object extensions system to add a new property to table: https://docs.abp.io/en/abp/latest/Module-Entity-Extensions
And I want to add "LicienceId property" CurrentUser objet
You can add LicienceId to claims:
https://docs.abp.io/en/abp/latest/Modules/OpenIddict#updating-claims-in-access_token-and-id_token
https://docs.abp.io/en/abp/latest/Authorization#claims-principal-factory
And add an extension method to currentuser:
public static string LicienceId(this ICurrentUser currentUser)
{
return currentUser.FindClaim(“LicienceId”)?.Value;
}
Can you share a project that can reproduce the problem? thanks, shiwei.liang@volosoft.com
You need to configure every project that uses Redis (AuthServer,Web, HttpApi.Host)