Hi
How can we specify which service tenant database a microservice should work with (e.g., Microservice_Tenant1_Products, Microservice_Tenant2_Products, etc.)?
Do you use micro-serivce template currently or you'll separate your services later? By default we don't suggest using different databases for tenants in the micro-service template currently, if you wish you can rea the discussion from here: https://abp.io/support/questions/8692/Problems-configuring-a-separate-database-for-each-tenant-in-a-microservices-application
If your template is not micro-service, you can customize MultiTenantConnectionStringResolver in your application
https://github.com/abpframework/abp/blob/74d516829be7f05cfae7d4a67f18591b41e5446a/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs#L76-L79
using System;
using Microsoft.Extensions.Options;
using Volo.Abp.Data;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
namespace AbpSolution1.AuthServer;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(IConnectionStringResolver), typeof(DefaultConnectionStringResolver))]
public class MicroServiceConnectionStringResolver : MultiTenantConnectionStringResolver
{
    private readonly ICurrentTenant _currentTenant;
    private readonly IServiceProvider _serviceProvider;
    public MicroServiceConnectionStringResolver(IOptionsMonitor<AbpDbConnectionOptions> options, ICurrentTenant currentTenant, IServiceProvider serviceProvider) : base(options, currentTenant, serviceProvider)
    {
        _currentTenant = currentTenant;
        _serviceProvider = serviceProvider;
    }
    public override async Task<string> ResolveAsync(string? connectionStringName = null)
    {
        // ⚠️ Implement Your own logic, this is for demonstration
        var prefix = "Microservice";
        var postfix="Products";
        var tenant = _currentTenant.Name;
        // ...
        
        return $"Server=myServerAddress;Database={prefix}_{tenant}_{postfix};Trusted_Connection=True;"
    }
}
When we add new database migrations at the service, how should we handle them considering that each tenant has its own separate service database? how this migration will be applied to all service tenant dbs?
DbMigrator project applies migrations for all the tenants in the host database. So whenever you run DbMigrator, all the databases will be migrated and data seed will be executed
Hi @dzungle
Can you share the problem that you face? Our Angular team will help you on this topic
Thanks for reporting,
I'll deliver this issue to the ABP Suite team
Since it's a bug your ticket is refunded
Hi,
Out angular team will help you on this topic.
Until then, can I ask have you cleaned node_modules and remove yarn.lock/packages.lock file and install all the packages cleanly?
This was just for demonstration but you can get it from the configuration by using RemoteServiceConfigurationProvider
Inject it and use it and use GetConfigurationOrDefaultAsync method on the provider like this:
var remoteServiceConfig = await _remoteServiceConfigurationProvider.GetConfigurationOrDefaultAsync("Default");
                        Hi,
ABP v4.4.2 is not compatible with .NET 8, that why you should update your ABP packages to v8.0 too
Hi,
You need to update migration guides one by one for each version you upgrade: https://abp.io/docs/latest/release-info/migration-guides
Hi,
ABP Framework allows tenants to use separate databases and Saas module has an UI to separate tenant databases manually at runtime. But there is no built-in feature for creating databases dynamically whenever a tenant created or edition changes for a tenant. You have to implement it in your application according to your logic.
Let me show the TenantAppService.cs implementation from the Saas Module:
If you create each tenant with ConnectionStrings property is configured and make sure distributed event is published, you can achieve this logic.
You don't have to write all the codes here, I just wanted to explain the logic. You can easily replace TenantAppService in your application and configure connection string for each tenant dynamically:
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(ITenantAppService))]
public class CustomTenantAppService : TenantAppService
{
    public CustomTenantAppService(ITenantRepository tenantRepository, IEditionRepository editionRepository, ITenantManager tenantManager, IDataSeeder dataSeeder, ILocalEventBus _localEventBus, IDistributedEventBus distributedEventBus, IOptions<AbpDbConnectionOptions> dbConnectionOptions, IConnectionStringChecker connectionStringChecker) : base(tenantRepository, editionRepository, tenantManager, dataSeeder, _localEventBus, distributedEventBus, dbConnectionOptions, connectionStringChecker)
    {
    }
    public override Task<SaasTenantDto> CreateAsync(SaasTenantCreateDto input)
    {
        // 👇 Something similar
        input.ConnectionStrings.Default = $"Server=localhost;Database=MyProjectName_{input.Name.Normalize()};User=root;Password=123456;";
        return base.CreateAsync(input);
    }
}
                        Hi,
It seems there is no any breaking-change while migrating v.9.0 to v9.1. https://abp.io/docs/latest/release-info/migration-guides/abp-9-1
Can you try to remove node_modules folder and yarn.lock/packages.lcok file.
Then try to execute yarn command in a clean directory?
If problem still continues please let us know