microsoft / microsoft/durabletask-mssql
Feature Request: Support specifying task hub when running in shared schema mode
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 105
- Forks
- 36
- PR merge metrics
- No merged PRs in 30d
Description
I am currently migrating a durable function application from the Azure Storage backend to MSSQL backend. We use Durable Function Monitor to perform visualise and modify our orchestrations. We have a single durable function monitor instance and users can switch between Task Hubs via the UI.
The durable function monitor has some support for the MSSQL backend, however there are several issues when running in the default shared schema mode. All of the issues source back to the task hub name being inferred from the user name. This is great for the durable function applications, but causes issues for the mointor.
I was wondering if it might be possible to add support for specifying the task hub name for a particular session. Perhaps by using AppName (as is currently used in the unshared schema), or by setting CONTEXT_INFO after connecting?
In my case we would have the following setup.
| Database User | Role | Can Manually Specify Task Hub |
|---|---|---|
| monitor-user | dbo | Yes |
| client-app-1 | dt_runtime | No |
| client-app-2 | dt_runtime | No |
I believe the change would require:
- A new global setting that allows a user use the 'Manual Specification' feature
- An update to the
CurrentTaskHubstored procedure to check if the current user matches the global setting - and if so use the APP_NAME instead of the USER_NAME
e.g.
DECLARE @allow_select_user = (SELECT TOP 1 [Value] FROM GlobalSettings WHERE [Name] = 'AllowTaskHubSelect');
IF @taskHubMode = 0
SET @taskHub = APP_NAME()
IF @taskHubMode = 1 AND USE_NAME() = 'allow_select_user'
SET @taskHub = APP_NAME()
ELSE
SET @taskHub = USER_NAME()
If this is something that would be acceptable to add I would be happy to write a more formal RFC and create a pull request.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing the CurrentTaskHub stored procedure and the GlobalSettings table, then trace how shared-schema task hub selection uses USER_NAME and how APP_NAME is used in unshared mode. Done means a documented setting lets an approved user select a task hub without changing the existing behavior for runtime users, with coverage for both modes and user roles.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, sql
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100