Skip to content

Feature Request: Support specifying task hub when running in shared schema mode #288

@nickwilliams-codynamic

Description

@nickwilliams-codynamic

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 CurrentTaskHub stored 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Priority 2

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions