Base solution for your next web application
Open Closed

Tenant Creation #2120


User avatar
0
hugol created

Hi,

I've created everything in my local environment without a problem and now I'm trying to replicate this scenario in a live environment using Winhost (despite the fact that this is just a test).

So the steps that I did till now are:

  1. Created the Databases and the users using the Winhost Cpanel
  2. Created the directory for the new Web app and the proper DNS
  3. Used the Migrator tool to create the Host DB
  4. Published the Web Project (My webconfig.release has the proper configurations)

Now so far so good, everything is working properly. I can log in to the host and update the settings (emails are being sent) etc.

The problem is I can't create a tenant. For example if I try to create a tenant with the following parameters I get an error:

Tenancy Name: SomeExample Tenant: SomeExample Ltd Use Host Database: No

Data Source=?? Now this is the first question/problem, WinHost connections strings are like this: "Data Source=tcp:[servernumber].winhost.com;Initial Catalog=DB_[customeraccountnumber][databasename];User ID=DB[customeraccountnumber]_[databasename]_user;Password=password;Integrated Security=False;"

1st Question:<ins>What should I type in the Data Source box?</ins>

2nd Question:<ins>When creating a tenant does ABP tries to create the tenant database and apply the migrations or do we need to run the Migrator for the tenants?</ins>

Thanks in advance for further help, HugoL

tcp:s12.winhost.com;Initial Catalog=DB_wpropterhlmt;User ID=DB_80397_user;Password=*****;Integrated Security=False;


4 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    1. Data source should be the name of SQL instance I think.
    2. Yes, AspNet Zero creates the database and applies the migrations.
  • User Avatar
    0
    hugol created

    The migration tool and the default host works well when using this connection string on the app.config and the web.config like this:
    <add name="Default" connectionString="Data Source=tcp:s12.winhost.com;Initial Catalog=DB_######main;User ID=DB##_main_user;Password=***;Integrated Security=False;" providerName="System.Data.SqlClient"

    The questions are:

    • What parameters are supported in the connection string on the tenant page? or the connection is used as is?
    • If I need to create the database first (which I did) can the Tenant creation page cope with that?

    Thanks, Hugo

  • User Avatar
    0
    ismcagdas created
    Support Team
    • ASP.NET Zero does not require anyting special for connection string. You can use whatever your DB Server accepts.
    • If you already have a database, the migrations will be applied. It shouldn't be a problem.
  • User Avatar
    0
    hugol created

    Ok. I will do some research and some tests later on. I will share here what I can find out.

    Thanks for the reply. HugoL