Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Isolated Mode - Support non-AzureWebJobsStorage storage #217

Open
lanni-energinet opened this issue Nov 1, 2024 · 7 comments
Open

Isolated Mode - Support non-AzureWebJobsStorage storage #217

lanni-energinet opened this issue Nov 1, 2024 · 7 comments
Assignees
Labels
bug Something isn't working P2 Priority 2

Comments

@lanni-energinet
Copy link

Our organization follows azure functions recommendations from https://learn.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-azure-storage-provider#storage-account-selection

If not specified, the default AzureWebJobsStorage storage account is used. For performance-sensitive workloads, however, configuring a non-default storage account is recommended. Durable Functions uses Azure Storage heavily, and using a dedicated storage account isolates Durable Functions storage usage from the internal usage by the Azure Functions host.

When using Storage Account as provider type, this is done by configuring host.json in the following way

{
  "extensions": {
    "durableTask": {
      "storageProvider": {
        "connectionStringName": "MyStorageAccountAppSetting"
      }
    }
  }
}

The issue:

When DurableTaskClient is parameter bound in DfmGetOrchestrationsFunction(Orchestrations.cs), the correct connectionString and storage type for MyStorageAccountAppSetting is resolved, as this is done through DTFx and durableClient.ListAllInstances(...) successfully queries the storage.

Later steps uses Globals.GetFullConnectionStringEnvVariableName(...) which has an deficient implementation of connectionString resolution as it either returns AzureWebJobsStorage, which differs from what DurableTaskClient has resolved, or returns a DFM_ALTERNATIVE_CONNECTION_STRING which is currently unsupported in "Isolated" mode.

Due to isolation requirements it is not feasible for us to deploy in "standalone" mode

Can you advise on how to move forward?

@scale-tone
Copy link
Contributor

Hi @lanni-energinet , just to clarify: what exact scenario(s) do not work in your setup?
Are you able to see the (correct) list of instances?
Do you see instance details/history?
Are you getting any errors?

@lanni-energinet
Copy link
Author

lanni-energinet commented Nov 1, 2024

@scale-tone

Yes the list of instances are mostly correct but the column customStatus is populated with the value null due to the TableClient querying the wrong storae. Clicking on a instance results in a System.NullReferenceException

Image

@scale-tone
Copy link
Contributor

That's not good indeed, and needs to be fixed.
Thanks for reporting, @lanni-energinet !

@scale-tone scale-tone added bug Something isn't working P2 Priority 2 and removed Needs: Triage 🔍 labels Nov 1, 2024
@lanni-energinet
Copy link
Author

@scale-tone

Thank you for your quick response.

I know its not an optimal fix, but would it be possible to change Globals.GetFullConnectionStringEnvVariableName to the following implementation in a beta release. I am quite confident that this implementation would fix the issue for now, the more permanent solution would be to remove connName, and figure out a mechanism to retrieve the connection from DurableTaskClient

        public static string GetFullConnectionStringEnvVariableName(string connName)
        {
            string hostJsonFileName = GetHostJsonPath();
            dynamic hostJson = JObject.Parse(File.ReadAllText(hostJsonFileName));

            return hostJson?.extensions?.durableTask?.storageProvider?.connectionStringName?.ToString() ?? EnvVariableNames.AzureWebJobsStorage;
        }

@scale-tone scale-tone self-assigned this Nov 1, 2024
scale-tone added a commit that referenced this issue Nov 2, 2024
scale-tone added a commit that referenced this issue Nov 2, 2024
scale-tone added a commit that referenced this issue Nov 2, 2024
scale-tone added a commit that referenced this issue Nov 2, 2024
* #217, implementation for inproc

* #217, implementation for isolated

* #217, implementation for vscode ext
@scale-tone
Copy link
Contributor

@lanni-energinet
Copy link
Author

@scale-tone

We just checked and 6.5.2-beta1 works for us.

Thank you for the quick reponse

@lanni-energinet
Copy link
Author

@scale-tone

Can you give a timeframe for a new "stable" release, our organization follows a policy of avoiding prerelease packages

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 Priority 2
Projects
None yet
Development

No branches or pull requests

2 participants