diff --git a/src/DurableTask.SqlServer.AzureFunctions/SqlDurabilityOptions.cs b/src/DurableTask.SqlServer.AzureFunctions/SqlDurabilityOptions.cs index 3b7fc99..be54aa4 100644 --- a/src/DurableTask.SqlServer.AzureFunctions/SqlDurabilityOptions.cs +++ b/src/DurableTask.SqlServer.AzureFunctions/SqlDurabilityOptions.cs @@ -42,6 +42,16 @@ internal SqlOrchestrationServiceSettings GetOrchestrationServiceSettings( throw new ArgumentNullException(nameof(connectionStringResolver)); } + // If SchemaName is wrapped in `%`, then it is an environment variable to be resolved + if (this.SchemaName != null && this.SchemaName.StartsWith("%") && this.SchemaName.EndsWith("%")) + { + // remove surrounding `%` characters + this.SchemaName = this.SchemaName.Substring(1, this.SchemaName.Length - 2); + + // resolve the environment variable + this.SchemaName = connectionStringResolver.Resolve(this.SchemaName)?.Value; + } + IConfigurationSection connectionStringSection = connectionStringResolver.Resolve(this.ConnectionStringName); if (connectionStringSection == null || string.IsNullOrEmpty(connectionStringSection.Value)) { diff --git a/src/common.props b/src/common.props index ace5c3e..01f2aaf 100644 --- a/src/common.props +++ b/src/common.props @@ -17,7 +17,7 @@ 1 3 - 0 + 1 $(MajorVersion).$(MinorVersion).$(PatchVersion) $(MajorVersion).$(MinorVersion).0.0 diff --git a/test/DurableTask.SqlServer.Tests/Integration/DatabaseManagement.cs b/test/DurableTask.SqlServer.Tests/Integration/DatabaseManagement.cs index 3f4f024..f71d497 100644 --- a/test/DurableTask.SqlServer.Tests/Integration/DatabaseManagement.cs +++ b/test/DurableTask.SqlServer.Tests/Integration/DatabaseManagement.cs @@ -504,7 +504,7 @@ async Task ValidateDatabaseSchemaAsync(TestDatabase database, string schemaName schemaName); Assert.Equal(1, currentSchemaVersion.Major); Assert.Equal(3, currentSchemaVersion.Minor); - Assert.Equal(0, currentSchemaVersion.Patch); + Assert.Equal(1, currentSchemaVersion.Patch); } sealed class TestDatabase : IDisposable