and did you implement the
IMultiTenant
interface for your new entities. https://docs.abp.io/en/abp/latest/Multi-Tenancy#imultitenant
Thank you albert. Implementing IMultiTenant resolved the issue. We had thought that since every tenant will have it's own separate tenant database, a TenantId column was not needed and therefore IMultiTenant would not need to be implemented.
We've created a solution using abp suite and chose to separate host and tenant db's. Each tenant is configured to have its own separate database. Everything is working as expected using the base abp modules when logging in and out of the host and tenant databases.
The problem we are running into is that, when we create a new entity, the entity is always being accessed from the host database, even when we are logged into a specific tenant database.
There are two database contexts that were created from the project template (AppNameDbContext and AppNameTenantDbContext). Our entity’s custom repository is referencing the TenantDbContext as follows:
public class EfCorePayPeriodRepository : EfCoreRepository<TimepieceTenantDbContext, PayPeriod, int>, IPayPeriodRepository{...}
We also made sure to include the following in the ConfigureServices method of the EnittyFrameworkCore Module:
context.Services.AddAbpDbContext<TimepieceTenantDbContext>(options => { options.AddDefaultRepositories(includeAllEntities: true); options.AddRepository<PayPeriod, EfCorePayPeriodRepository>(); });
The DbSet and Model building was also done in the TenantDbContext.
When using the repository, however, the framework always attempts to access the host database instead of the tenant database. Is there something we are missing with regards to entities that should only be created and accessed from the tenant database?
Guidance is much appreciated. Thanks.
For anyone running into this issue... the following link provided the resolution. Websockets in your Azure App Service need to be turned on
https://stackoverflow.com/questions/47652865/azure-webapps-404-error
We just created our first abp commercial app using abp suite (Blazor Server/EF Core). We introdoced no code to the templated application. After running the DB migrations, we were able to sucessfully run the application locally through Visual Studio - everything woked as expected.
We then published the app to Azure Web Services through a Visual Studio right click and publish. After launching the app hosted in azure, we found UI issues that I hope someone can help me with. When logging in as the default admin, the user avatar image and user name is missing on the menu on the upper right of the application. Additionally, the Saas and Administrationmenu items on the left nav menu are not visible. When clicking into any item under the user drop down on the upper right of the app, the Saas and Administration items then apper on the left nav menu. But, when we click on a Saas or Administration item we receive an abp message "Authorization failed! Given policy has not granted.".
The same DB was used when running locally and when running in azure.
Any help would be greatly appreciated.
Hello, We are new to ABP Commercial and have the following requirements with regards to multi-tenancy. Any information on whether these requirements can be accommodated by the framework would be appreciated. We have read through quite a few resources online, but haven't seen anyone implement our exact scenario. Any implementation details/resources that you can direct me too would be much appreciated.
Requirements:
Thank you in advance. balessi75