File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 66using Microsoft . DurableTask . ScheduledTasks ;
77using Microsoft . DurableTask . Worker ;
88using Microsoft . DurableTask . Worker . AzureManaged ;
9+ using Microsoft . Extensions . Configuration ;
910using Microsoft . Extensions . DependencyInjection ;
1011using Microsoft . Extensions . Hosting ;
1112using Microsoft . Extensions . Logging ;
1213
1314HostApplicationBuilder builder = Host . CreateApplicationBuilder ( args ) ;
1415
15- string connectionString = Environment . GetEnvironmentVariable ( "DURABLE_TASK_SCHEDULER_CONNECTION_STRING" )
16- ?? throw new InvalidOperationException ( "Missing required environment variable 'DURABLE_TASK_SCHEDULER_CONNECTION_STRING'" ) ;
16+ // Get configuration
17+ string connectionString = builder . Configuration . GetValue < string > ( "DURABLE_TASK_SCHEDULER_CONNECTION_STRING" )
18+ ?? throw new InvalidOperationException ( "Missing required configuration 'DURABLE_TASK_SCHEDULER_CONNECTION_STRING'" ) ;
1719
1820// Configure the worker
1921builder . Services . AddDurableTaskWorker ( builder =>
Original file line number Diff line number Diff line change 1111
1212WebApplicationBuilder builder = WebApplication . CreateBuilder ( args ) ;
1313
14- string connectionString = builder . Configuration [ "DURABLE_TASK_SCHEDULER_CONNECTION_STRING" ]
14+ string connectionString = builder . Configuration . GetValue < string > ( "DURABLE_TASK_SCHEDULER_CONNECTION_STRING" )
1515 ?? throw new InvalidOperationException ( "Missing required configuration 'DURABLE_TASK_SCHEDULER_CONNECTION_STRING'" ) ;
1616
1717// Add all the generated orchestrations and activities automatically
You can’t perform that action at this time.
0 commit comments