microsoft / DurableFunctionsMonitor

A monitoring/debugging UI tool for Azure Durable Functions

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[v6.1][VsCode] Unable to start new orchestration instances, if Task Hub name is `TestHubName` (default for local setup). 401 Unauthorized.

Arcan2a opened this issue · comments

Using Vscode extension with local storage that has "TestTaskName" as task hub is throwing 401 non authorized
when launching a new instance of an orchestrator
By looking into vscode output i see the message "Task hub testhubtask is not allowed", i digged into the source code and looks this is related to the fact that the hub name by default "TestHubName" is not in hubName in host.json, adding it to my project does not solve the issue, the only workaround was to add in the extension binary folder host.json file :

"extensions": {
"durableTask": {
"hubName": "TestHubName"
}
}

I think this is a regression, before it was working fine,
Either it should read local host.json file of the project when running in VsCode or bypass the authroization check when running VsCode mode

Hi @Arcan2a ,

Let me try to summarize the steps you were taking (as I understood them):

  • You are using DfMon as VsCode extension (and I assume it is the recent v6.1).
  • You have a Functions project (in whatever programming language), which has a custom Task Hub name configured via its host.json file. That custom Task Hub name is set to TestTaskName.
  • You are using local Azure Storage emulator (presumably, Azurite) as a Storage for your orchestrations.
  • You connect to that Task Hub with DfMon, and the contents of that Task Hub (the list of existing orchestrations) is displayed by DfMon correctly and with no any errors.
  • Then you try to start a new orchestration instance using DfMon. This results in an error containing words like 401 Unauthorized, and when you look into DfMon's output, you observe the Task hub testhubtask is not allowed error.

Did I get you correctly?

All assumptions are good the only thing is initially in didnt have the hub name in my host.json and i got 401 so by digging in the source code i tried also to add the TaskHubName in my host.json but still got 401. Don't hesitate to ask any clarifications. For now my workaround that solved the issue temporarly is to go to the host.json in the binaries of the vscode extension and change its host.json file there and adding "durableTask": {
"hubName": "TestHubName"
}

Thanks for reporting this, I confirm that I just managed to repro.

It is indeed a regression, the code here should create a HashSet with StringComparer.InvariantCultureIgnoreCase (so that Task Hub names are validated case-insensitive), but since v6.1 it doesn't. This collides with this previously introduced workaround and results in that weird behavior.

Will come up with a fix. Until then you can just specify some explicit Task Hub name for your project via host.json:

  "extensions": {
    "durableTask": {
      "hubName": "MyCustomHubName"
    }
  }

-- that allows to bypass the issue.

Yes indeed I noticed when I put lower case in host.json it didn't work and I have to put it case sensitive so that explains it. Ok so the temporary workaround would be to use an explicit task hub name in the local host.json file, right ?

so the temporary workaround would be to use an explicit task hub name in the local host.json file, right ?

Yep :)

Fixed in v6.1.1. Pls, validate.