Skip to content

Commit 55f2f09

Browse files
committed
Enabling use of ASP.NET health check hosted service
1 parent 5176a5e commit 55f2f09

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

release_notes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<!-- Please add your release notes in the following format:
33
- My change description (#PR)
44
-->
5+
- Enabled the use of ASP.NET Health Check hosted service
56
- Update Python Worker to 1.1.6 [Release Note](https://github.com/Azure/azure-functions-python-worker/releases/tag/1.1.6)
67
- Update Python Library to 1.4.0 [Release Note](https://github.com/Azure/azure-functions-python-library/releases/tag/1.4.0)
78
- Update PowerShell Worker to 3.0.552 (PS6) [Release Note](https://github.com/Azure/azure-functions-powershell-worker/releases/tag/v3.0.552) and 3.0.549 (PS7) [Release Note](https://github.com/Azure/azure-functions-powershell-worker/releases/tag/v3.0.549)

src/WebJobs.Script.WebHost/DependencyInjection/DependencyValidator/DependencyValidator.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,8 @@ private static ExpectedDependencyBuilder CreateExpectedDependencies()
5353
.Optional<FuncAppFileProvisioningService>() // Used by powershell.
5454
.Optional<JobHostService>() // Missing when host is offline.
5555
.Optional<FunctionsSyncService>() // Conditionally registered.
56-
.OptionalExternal("Microsoft.AspNetCore.DataProtection.Internal.DataProtectionHostedService", "Microsoft.AspNetCore.DataProtection", "adb9793829ddae60"); // Popularly-registered by DataProtection.
56+
.OptionalExternal("Microsoft.AspNetCore.DataProtection.Internal.DataProtectionHostedService", "Microsoft.AspNetCore.DataProtection", "adb9793829ddae60") // Popularly-registered by DataProtection.
57+
.OptionalExternal("Microsoft.Extensions.Diagnostics.HealthChecks.HealthCheckPublisherHostedService", "Microsoft.Extensions.Diagnostics.HealthChecks", "adb9793829ddae60"); // Popularly-registered by Health Check Monitor.
5758

5859
expected.ExpectSubcollection<ILoggerProvider>()
5960
.Expect<AzureMonitorDiagnosticLoggerProvider>()
@@ -92,12 +93,12 @@ private static string FormatServiceDescriptor(ServiceDescriptor descriptor)
9293

9394
if (descriptor.ImplementationInstance != null)
9495
{
95-
format += $", {nameof(descriptor.ImplementationInstance)}: {descriptor.ImplementationInstance.GetType()}";
96+
format += $", {nameof(descriptor.ImplementationInstance)}: {descriptor.ImplementationInstance.GetType().AssemblyQualifiedName}";
9697
}
9798

9899
if (descriptor.ImplementationType != null)
99100
{
100-
format += $", {nameof(descriptor.ImplementationType)}: {descriptor.ImplementationType}";
101+
format += $", {nameof(descriptor.ImplementationType)}: {descriptor.ImplementationType.AssemblyQualifiedName}";
101102
}
102103

103104
return format;

test/WebJobs.Script.Tests/Configuration/DefaultDependencyValidatorTests.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ public async Task Validator_InvalidServices_LogsError()
5151

5252
IEnumerable<string> messageLines = invalidServicesMessage.Exception.Message.Split(Environment.NewLine, StringSplitOptions.RemoveEmptyEntries).Select(p => p.Trim());
5353
Assert.Equal(5, messageLines.Count());
54-
Assert.Contains(messageLines, p => p.StartsWith("[Invalid]") && p.EndsWith(nameof(MyHostedService)));
55-
Assert.Contains(messageLines, p => p.StartsWith("[Invalid]") && p.EndsWith(nameof(MyScriptEventManager)));
56-
Assert.Contains(messageLines, p => p.StartsWith("[Invalid]") && p.EndsWith(nameof(MyMetricsLogger)));
57-
Assert.Contains(messageLines, p => p.StartsWith("[Missing]") && p.EndsWith(nameof(SystemLoggerProvider)));
54+
Assert.Contains(messageLines, p => p.StartsWith("[Invalid]") && p.EndsWith(typeof(MyHostedService).AssemblyQualifiedName));
55+
Assert.Contains(messageLines, p => p.StartsWith("[Invalid]") && p.EndsWith(typeof(MyScriptEventManager).AssemblyQualifiedName));
56+
Assert.Contains(messageLines, p => p.StartsWith("[Invalid]") && p.EndsWith(typeof(MyMetricsLogger).AssemblyQualifiedName));
57+
Assert.Contains(messageLines, p => p.StartsWith("[Missing]") && p.EndsWith(typeof(SystemLoggerProvider).AssemblyQualifiedName));
5858
}
5959

6060
[Fact]

0 commit comments

Comments
 (0)