Multi tenancy setup

Hi!

I'm trying to follow the setup using the following URL:

How/Where do I select the relative database to use when the tenant logs in ?

Thanks!

Xarion

Radzen multi tenants is a feature of application security. All tables are part of the database selected in security settings.

Is it possible to use different databases depending on the URL accessed?

No, it’s not possible to use different databases.

I have come across this blog:

Is this still implemented?

The info about actual implementation is here:

Hi @enchev

The URL you posted is the original URL I posted which does not have any mention of database. You followed by saying different databases/connectionstrings cannot be used.

If I follow my second URL the blog shows how to have different connection strings

I am a little confused what should be used to implement what I want?
ie, the tenant and database depends on the hostname that the customer has put in the URL.
This is necessarily a multi-tenant as described in the URL in my first post?

I already described in my first reply how the multi tenants are implemented and I don’t have any other information to add. The blog post you’ve posted is different implementation using data isolation (different database per tenant) however this is not how Radzen works.

You cannot select the database to login however you can specify separate databases for separate users in appsettings.json. Database is selected automatically based on the URL entered in browser.

"Multitenancy": {
    "Tenants": [
      {
        "Name": "Tenant1",
        "Hostnames": [
          "localhost:5001",
          "tenant1.radzen-rocks.com"
        ],
        "ConnectionString": "Server=vinod-pc\\sql2016;Initial Catalog=Sample-Tenant1;Persist Security Info=False;User ID=sa;Password=abc12345;MultipleActiveResultSets=False;Encrypt=false;TrustServerCertificate=true;Connection Timeout=30"
      },
      {
        "Name": "Tenant2",
        "Hostnames": [
          "localhost:5002",
          "tenant2.radzen-rocks.com"
        ],
        "ConnectionString": "Server=vinod-pc\\sql2016;Initial Catalog=Sample-Tenant2;Persist Security Info=False;User ID=sa;Password=abc12345;MultipleActiveResultSets=False;Encrypt=false;TrustServerCertificate=true;Connection Timeout=30"
      }
    ]
  }

Here if you login using "localhost:5001" Sample-Tenant1 database is connected and if you login using "localhost:5002" Sample-Tenant2 database is connected