2525using Microsoft . Azure . WebJobs . Script . WebHost . Security ;
2626using Microsoft . Azure . WebJobs . Script . WebHost . Security . Authorization ;
2727using Microsoft . Azure . WebJobs . Script . WebHost . Security . Authorization . Policies ;
28+ using Microsoft . Extensions . DependencyInjection ;
2829using Microsoft . Extensions . Logging ;
2930using Microsoft . Extensions . Options ;
3031using Newtonsoft . Json ;
@@ -47,7 +48,6 @@ public class HostController : Controller
4748 private readonly IEnvironment _environment ;
4849 private readonly IScriptHostManager _scriptHostManager ;
4950 private readonly IFunctionsSyncManager _functionsSyncManager ;
50- private readonly IExtensionBundleManager _extensionBundleManager ;
5151
5252 public HostController ( IOptions < ScriptApplicationHostOptions > applicationHostOptions ,
5353 IOptions < JobHostOptions > hostOptions ,
@@ -56,8 +56,7 @@ public HostController(IOptions<ScriptApplicationHostOptions> applicationHostOpti
5656 IWebFunctionsManager functionsManager ,
5757 IEnvironment environment ,
5858 IScriptHostManager scriptHostManager ,
59- IFunctionsSyncManager functionsSyncManager ,
60- IExtensionBundleManager extensionBundleManager )
59+ IFunctionsSyncManager functionsSyncManager )
6160 {
6261 _applicationHostOptions = applicationHostOptions ;
6362 _hostOptions = hostOptions ;
@@ -67,14 +66,13 @@ public HostController(IOptions<ScriptApplicationHostOptions> applicationHostOpti
6766 _environment = environment ;
6867 _scriptHostManager = scriptHostManager ;
6968 _functionsSyncManager = functionsSyncManager ;
70- _extensionBundleManager = extensionBundleManager ;
7169 }
7270
7371 [ HttpGet ]
7472 [ Route ( "admin/host/status" ) ]
7573 [ Authorize ( Policy = PolicyNames . AdminAuthLevelOrInternal ) ]
7674 [ TypeFilter ( typeof ( EnableDebugModeFilter ) ) ]
77- public async Task < IActionResult > GetHostStatus ( [ FromServices ] IScriptHostManager scriptHostManager , [ FromServices ] IHostIdProvider hostIdProvider )
75+ public async Task < IActionResult > GetHostStatus ( [ FromServices ] IScriptHostManager scriptHostManager , [ FromServices ] IHostIdProvider hostIdProvider , [ FromServices ] IServiceProvider serviceProvider = null )
7876 {
7977 var status = new HostStatus
8078 {
@@ -85,14 +83,18 @@ public async Task<IActionResult> GetHostStatus([FromServices] IScriptHostManager
8583 ProcessUptime = ( long ) ( DateTime . UtcNow - Process . GetCurrentProcess ( ) . StartTime ) . TotalMilliseconds
8684 } ;
8785
88- var bundleInfo = await _extensionBundleManager . GetExtensionBundleDetails ( ) ;
89- if ( bundleInfo != null )
86+ var bundleManager = serviceProvider . GetService < IExtensionBundleManager > ( ) ;
87+ if ( bundleManager != null )
9088 {
91- status . ExtensionBundle = new Models . ExtensionBundle ( )
89+ var bundleInfo = await bundleManager . GetExtensionBundleDetails ( ) ;
90+ if ( bundleInfo != null )
9291 {
93- Id = bundleInfo . Id ,
94- Version = bundleInfo . Version
95- } ;
92+ status . ExtensionBundle = new Models . ExtensionBundle ( )
93+ {
94+ Id = bundleInfo . Id ,
95+ Version = bundleInfo . Version
96+ } ;
97+ }
9698 }
9799
98100 var lastError = scriptHostManager . LastError ;
0 commit comments