@@ -8,6 +8,14 @@ namespace XtremeIdiots.Portal.Web;
88/// </summary>
99public class Program
1010{
11+ private readonly static string [ ] appConfigurationKeyFilters =
12+ [
13+ "XtremeIdiots.Portal.Web:*" ,
14+ "RepositoryApi:*" ,
15+ "ServersIntegrationApi:*" ,
16+ "FeatureManagement:*" ,
17+ ] ;
18+
1119 /// <summary>
1220 /// Main entry point for the application
1321 /// </summary>
@@ -43,11 +51,19 @@ public static IHostBuilder CreateHostBuilder(string[] args)
4351 ManagedIdentityClientId = managedIdentityClientId ,
4452 } ) ;
4553
46- configBuilder . AddAzureAppConfiguration ( options => options
47- . Connect ( new Uri ( appConfigEndpoint ) , credential )
48- . Select ( KeyFilter . Any , environmentLabel )
49- . Select ( KeyFilter . Any , LabelFilter . Null )
50- . ConfigureKeyVault ( kv => kv . SetCredential ( credential ) ) ) ;
54+ configBuilder . AddAzureAppConfiguration ( options =>
55+ {
56+ var appConfig = options
57+ . Connect ( new Uri ( appConfigEndpoint ) , credential )
58+ . ConfigureKeyVault ( kv => kv . SetCredential ( credential ) ) ;
59+
60+ foreach ( var keyFilter in appConfigurationKeyFilters )
61+ {
62+ appConfig . Select ( keyFilter , environmentLabel ) ;
63+ }
64+
65+ appConfig . Select ( KeyFilter . Any , LabelFilter . Null ) ;
66+ } ) ;
5167 } )
5268 . ConfigureWebHostDefaults ( webBuilder => webBuilder . UseStartup < Startup > ( ) ) ;
5369 }
0 commit comments