Hi
Thank you very much @Ismcagdas :)
ASP.NET CORE + Angular
Hi,
I have activated HangFire.
I'm able to access to the Hangfire dashboard after login in from MVC page (from http://localhost:22742/ui/login)
Everything works well without identityserver.
But when I activate identityserver, I'm having an issue on UiController : when redirected to Index action, GetCurrentLoginInformationsAsync
returns a null User. Therefore, I'm redirected to Login page...
Here is the code :
[DisableAuditing]
public async Task<IActionResult> Index()
{
var model = new HomePageModel
{
LoginInformation = await _sessionCache.GetCurrentLoginInformationsAsync(),
IsMultiTenancyEnabled = _multiTenancyConfig.IsEnabled
};
if (model.LoginInformation?.User == null)
{
return RedirectToAction("Login");
}
return View(model);
}
When identityserver is deactivated, the User information is not null...
I have configured IdentityServer the same as Zero.
Can you please provide some help ?
Sorry @Ismcagdas, I just saw that Hangfire is able to manage background jobs on multiple instances. I will try it and come back to you if I need some additional help. This ticket can be closed.
Hi @Ismcagdas, thank you for your feedback.
Can you provide an SQL command to do this stuff ? Or something similar ?
Hi @Ismcagdas,
It has been a while since the last time :)
In fact, WEBSITE_INSTANCE_ID is an environment variable available on Azure App Service VM's. So, yes, I can read it.
My problem is that I want to store it somewhere outside the VM, this is why I need your help. I was thinking to store it in cache (I'm using Redis) or in Azure blob storage.
What is your advise about this ? Can I access cache or azure storage before setting Configuration.BackgroundJobs.IsJobExecutionEnabled ?
My goal is to activate background job execution only in the first instance ; the one that will start the app. Therefore, if a new instance is pushed in by Azure (automatic scale), the background job execution will not be started twice.
Hi,
I need to activate two factor auth for one of my tenants. From my tests, if I activate two factor on host side then all tenants are also activated. How can I proceed to activate only one tenant ?
Do I need to run a database command to add a tenant setting to all tenants in order to deactivate two factor auth ?
Cheers
Hi,
I would like to configure my app according to the current instance count. The goal is to activate background jobs on the first instance of the app ; and to avoid to activate it for the next instances.
I'm using Azure App Service and starting the app with 1 instance. The app can switch to 2/3or 4 instances according to the CPU/RAM load.
I will use the environment variable WEBSITE_INSTANCE_ID to manage this : this value gives a unique instance ID.
My idea is to store this value (in cache or somewhere else). When app starts, I need to read this value in the PostInitialize method of WebHostModule class. If the value exists, I don't activate the background jobs for the instance. If no value set, then I start the backgound jobs for current instance (which should be the first).
Can you please help me to achieve this ? Specialy for the read/write data in the postinitialize method ?
This could help a lot of people that is struggling out with multiple instances on ABP.
Thks
I confirm that the issue was coming from Azure SQL database DTU count. I upgraded DTU to a significant amount (from 20 to 200 DTU's). This allowed to run the migrations correctly wihtout timeout. Then, back to original DTU count (20) and everything is working fine.
I close this issue
Hum, I think that the fact of reaching maximum DTU during the migration is causing an abort of the process. I will try to switch to a premium tier with higher DTU count tonight. I will give you a feedback afterwords
Hi @ismcagdas,
Thank you for your fast answer. I don't think it is a firewall issue as I'm still able to connect with SSMS. Just checked right now without any issue. The latest successful migration has been done 20 days ago with the same machine and same IP address. The migrations that are pending are really simple : just addind few properties to existing tables.
Is it possible that the migration process consumes too much resource to such a point that process cannot ends before a timeout ? Could this be linked with a large amount of data in a table ?