66string botDelay = builder . Configuration . GetSection ( "Bot" ) [ "Delay" ] ?? "1000" ;
77
88var redis = builder . AddRedis ( "redis" )
9- . WithRedisCommander ( )
9+ . WithRedisInsight ( )
1010 . PublishAsContainer ( ) ;
1111
1212if ( startupMode == "OnPremises" )
7070 var gatewayKeyvault = builder . AddAzureKeyVault ( "gateway-keyvault" ) ;
7171 var userServiceKeyvault = builder . AddAzureKeyVault ( "users-keyvault" ) ;
7272
73- builder . AddProject < Projects . Codebreaker_CosmosCreate > ( "cosmoscreate" )
73+ var cosmoscreate = builder . AddProject < Projects . Codebreaker_CosmosCreate > ( "cosmoscreate" )
7474 . WithReference ( cosmos )
75- . WithReference ( insights ) ;
75+ . WithReference ( insights )
76+ . WaitFor ( cosmos )
77+ . WaitFor ( insights ) ;
7678
7779 var gameAPIs = builder . AddProject < Projects . Codebreaker_GameAPIs > ( "gameapis" )
7880 . WithReference ( cosmos )
7981 . WithReference ( redis )
8082 . WithReference ( insights )
8183 . WithReference ( eventHub )
8284 . WithEnvironment ( "DataStore" , dataStore )
83- . WithEnvironment ( "StartupMode" , startupMode ) ;
85+ . WithEnvironment ( "StartupMode" , startupMode )
86+ . WaitForCompletion ( cosmoscreate ) ; // we use cosmos with the Azure option
8487
8588 // TODO: change to use BotQ with Container App Jobs
86- builder . AddProject < Projects . Codebreaker_BotQ > ( "botq" )
89+ var botq = builder . AddProject < Projects . Codebreaker_BotQ > ( "botq" )
8790 . WithReference ( insights )
8891 . WithReference ( botQueue )
8992 . WithReference ( gameAPIs )
9093 . WithEnvironment ( "Bot__Loop" , botLoop )
91- . WithEnvironment ( "Bot__Delay" , botDelay ) ;
94+ . WithEnvironment ( "Bot__Delay" , botDelay )
95+ . WaitFor ( gameAPIs ) ;
9296
9397 var live = builder . AddProject < Projects . Codebreaker_Live > ( "live" )
9498 . WithReference ( insights )
9599 . WithReference ( eventHub )
96- . WithReference ( signalR ) ;
100+ . WithReference ( signalR )
101+ . WaitFor ( eventHub )
102+ . WaitFor ( gameAPIs ) ;
97103
98104 var ranking = builder . AddProject < Projects . Codebreaker_Ranking > ( "ranking" )
99105 . WithReference ( cosmos )
100106 . WithReference ( insights )
101107 . WithReference ( eventHub )
102- . WithReference ( blob ) ;
108+ . WithReference ( blob )
109+ . WaitFor ( eventHub )
110+ . WaitFor ( insights )
111+ . WaitFor ( gameAPIs ) ;
103112
104113 var users = builder . AddProject < Projects . CodeBreaker_UserService > ( "users" )
105114 . WithReference ( insights )
106- . WithReference ( userServiceKeyvault ) ;
115+ . WithReference ( userServiceKeyvault )
116+ . WaitFor ( insights )
117+ . WaitFor ( userServiceKeyvault ) ;
107118
108119 var gateway = builder . AddProject < Projects . Codebreaker_ApiGateway > ( "gateway" )
109120 . WithExternalHttpEndpoints ( )
112123 . WithReference ( ranking )
113124 . WithReference ( users )
114125 . WithReference ( gatewayKeyvault )
115- . WithReference ( insights ) ;
126+ . WithReference ( insights )
127+ . WaitFor ( gameAPIs )
128+ . WaitFor ( live )
129+ . WaitFor ( ranking )
130+ . WaitFor ( users )
131+ . WaitFor ( gatewayKeyvault )
132+ . WaitFor ( insights ) ;
133+
116134
117135 builder . AddProject < Projects . CodeBreaker_Blazor > ( "blazor" )
118136 . WithExternalHttpEndpoints ( )
119137 . WithReference ( gateway )
120- . WithReference ( insights ) ;
138+ . WithReference ( insights )
139+ . WaitFor ( gateway )
140+ . WaitFor ( insights ) ;
121141}
122142
123143builder . Build ( ) . Run ( ) ;
0 commit comments