File tree Expand file tree Collapse file tree 3 files changed +9
-5
lines changed
Autofac.Extensions.DependencyInjection.AzureFunctions Expand file tree Collapse file tree 3 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 72
72
73
73
- name : Publish Package
74
74
id : " publish"
75
+ env :
76
+ NUGET_KEY : ${{ secrets.NUGET_KEY }} # Environment token
75
77
run : |
76
78
for f in $(find ./ -name '*.nupkg'); do
77
79
echo "Pushing $f...";
Original file line number Diff line number Diff line change 4
4
using Microsoft . Extensions . DependencyInjection . Extensions ;
5
5
using System ;
6
6
using System . IO ;
7
- using System . Linq ;
8
7
using System . Reflection ;
9
8
10
9
namespace Autofac . Extensions . DependencyInjection . AzureFunctions
@@ -51,10 +50,13 @@ public static IFunctionsHostBuilder UseAppSettings(this IFunctionsHostBuilder ho
51
50
{
52
51
var configurationBuilder = new ConfigurationBuilder ( ) as IConfigurationBuilder ;
53
52
54
- var descriptor = hostBuilder . Services . FirstOrDefault ( d => d . ServiceType == typeof ( IConfiguration ) ) ;
55
- if ( descriptor ? . ImplementationInstance is IConfiguration configRoot )
53
+ using ( var temporaryServiceProvider = hostBuilder . Services . BuildServiceProvider ( ) )
56
54
{
57
- configurationBuilder . AddConfiguration ( configRoot ) ;
55
+ var configRoot = temporaryServiceProvider . GetService < IConfiguration > ( ) ;
56
+ if ( configRoot != null )
57
+ {
58
+ configurationBuilder . AddConfiguration ( configRoot ) ;
59
+ }
58
60
}
59
61
60
62
configurationAction ? . Invoke ( configurationBuilder ) ;
Original file line number Diff line number Diff line change 4
4
"applicationInsights" : {
5
5
"samplingExcludedTypes" : " Request" ,
6
6
"samplingSettings" : {
7
- "isEnabled" : true
7
+ "isEnabled" : false
8
8
}
9
9
}
10
10
},
You can’t perform that action at this time.
0 commit comments