Ends in:
2 DAYS
5 HRS
7 MIN
31 SEC
Ends in:
2 D
5 H
7 M
31 S
Open Closed

Tenant Specific Connection String #8418


User avatar
0
viswajwalith created

ABP Framework version: v7.3.2 UI Type:MVC Database System: EF Core (SQL Server, Oracle, MySQL, PostgreSQL, etc..) / MongoDB Tiered (for MVC) or Auth Server Separated (for Angular): yes

We would like to maintain the tenant specific connection for both SQL and MongoDB, but when we go for featurs we are not able to see Mongo Services in the drop down? is it not supported?

Also what if we want to read the connection strings from key valut for each tenant?


9 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can set a different connection string for each microservice. but you can't set two connection strings for one microserve.

  • User Avatar
    0
    viswajwalith created

    hi

    You can set a different connection string for each microservice. but you can't set two connection strings for one microserve.

    even in this case, no option to set a connection string for the micro services which are using MongoDB?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You can configure the AbpDbConnectionOptions to add your connection string name. Then you can change it in the Database Connection Strings modal.

    https://abp.io/docs/latest/framework/fundamentals/connection-strings#configuring-the-database-structures

  • User Avatar
    0
    viswajwalith created

    hi

    You can configure the AbpDbConnectionOptions to add your connection string name. Then you can change it in the Database Connection Strings modal.

    https://abp.io/docs/latest/framework/fundamentals/connection-strings#configuring-the-database-structures

    Thanks for the update, do you think overrsing any of the file can work to have tenant specific DB connection string or using the connection string name something like "AbpIdentityServer_<<TENANTNAME>>" ?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    You must set the tenant connection string under the Database Connection Strings modal.

    The ProductService can't use SQL server and MongoDB at the same time. eg: Host and tenants can use different SQL server connection strings. but can't use MongoDB.

    The values are stored in the SaasTenantConnectionStrings table of the host database.

  • User Avatar
    0
    viswajwalith created

    hi

    You must set the tenant connection string under the Database Connection Strings modal.

    The ProductService can't use SQL server and MongoDB at the same time. eg: Host and tenants can use different SQL server connection strings. but can't use MongoDB.

    The values are stored in the SaasTenantConnectionStrings table of the host database.

    Ya ya, we dont want to use both at the time, we will be using eaither of that but just trying to use different servers for the same.

    how about picking the connection string key at run time like "AbpIdentityServer_<<TENANTNAME>>"

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    how about picking the connection string key at run time like "AbpIdentityServer_<<TENANTNAME>>"

    If you don't want to use Database Connection Strings

    You can override and replace the MultiTenantConnectionStringResolver service.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs#L27-L82

    https://github.com/abpframework/abp/blob/dev/framework/test/Volo.Abp.MultiTenancy.Tests/Volo/Abp/Data/MultiTenancy/MultiTenantConnectionStringResolver_Tests.cs

  • User Avatar
    0
    viswajwalith created

    hi

    how about picking the connection string key at run time like "AbpIdentityServer_<<TENANTNAME>>"

    If you don't want to use Database Connection Strings

    You can override and replace the MultiTenantConnectionStringResolver service.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/MultiTenantConnectionStringResolver.cs#L27-L82

    https://github.com/abpframework/abp/blob/dev/framework/test/Volo.Abp.MultiTenancy.Tests/Volo/Abp/Data/MultiTenancy/MultiTenantConnectionStringResolver_Tests.cs

    Thanks, we will try

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    : )

Made with ❤️ on ABP v9.1.0-preview. Updated on December 02, 2024, 12:35