DurableFunctionsMonitor
DurableFunctionsMonitor copied to clipboard
DfMon Isolated: Support 'connectionName' in 'host.json'
Hi all,
For the durablefunctionsmonitor.dotnetisolated.core project.
Would it be possible to extend the code in ExtensionMethods.UseDurableFunctionsMonitor so it also allows use of the newer documented connection string configuration (connectionString supported from 2.7.0 or later)?
New code where I added connectionName:
// Checking host.json for a custom dedicated Storage account
string hostJsonFileName = Globals.GetHostJsonPath();
if (File.Exists(hostJsonFileName))
{
dynamic hostJson = JObject.Parse(File.ReadAllText(hostJsonFileName));
string connStringNameFromHostJson =
hostJson?.extensions?.durableTask?.storageProvider?.azureStorageConnectionStringName ??
hostJson?.extensions?.durableTask?.storageProvider?.connectionStringName ??
hostJson?.extensions?.durableTask?.storageProvider?.connectionName;
if (!string.IsNullOrEmpty(connStringNameFromHostJson))
{
Globals.StorageConnStringEnvVarName = connStringNameFromHostJson;
}
}
I can prepare a PR if the change can be accepted. Just didn't want to do it if I'm missing something and the change could not be accepted. :)