I'm trying to develop a workable CI/deployment process for an existing database and web application that uses SignalR. The application architecture is very complicated, with multiple components watching for changes on the database.
I want to be able to use the Data-tier Application Framework (DACFx) to deploy DACPAC files and use the registration process to detect out-of-process changes to the database schema. At the moment, because SignalR modifies the database, this is not possible.
I'm trying to determine if it is possible to successfully use SignalR with a Data-tier application, without having to resort to manually adding the SignalR tables to the Schema.
I have in the Startup.cs in each component that uses SignalR code similar to:
[assembly: OwinStartup(typeof(MyNamespace.Startup))]
namespace MyNamespace
{
public partial class Startup
{
public void Configuration(IAppBuilder app)
{
var connectionStringName = ConfigurationManager.AppSettings["SignalR.DatabaseInstanceName"] ?? "MyApp";
var connectionstring = ConfigurationManager.ConnectionStrings[connectionStringName].ConnectionString;
var sqlScaleOutConfiguration = new SqlScaleoutConfiguration(connectionstring);
GlobalHost.DependencyResolver.UseSqlServer(sqlScaleOutConfiguration);
app.MapSignalR();
}
}
}
And in my Web.config or app.config, I have a "SignalR" connection string that points to a different database to the main application. E.g. "MyApp" for the application data and "SignalR" for the SignalR data.
My understanding is that when configuring SignalR in this way it will create:
- Database tables used for tracking connections.
- A service subscription to the database and associated cleanup SP.
The problem I have is that the database tables are being created in my main application database and it appears that SignalR doesn't provide an API for de-registering the service.
Have I got this right - Is SignalR creating the service subscription or is it something else?
What's going on - why is my configuration being ignored?
Is it possible to clean this up in an elegant way or do I need to resort to manually removing the service subscriptions during deployment?