Azure / Azure/azure-functions-host
WebJobsStorageHealthCheck causing warnings (unhealthy container) when a AzureWebJobsStorage is not configured
- Dominant language
- C#
- Stars
- 2k
- Forks
- 482
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 37
Description
I have a single Azure Function running in a container in AKS. The function is a Service Bus Trigger and doesn't require any connection to an Azure Storage account. Today I needed to rebuild my images, which probably has a newer version of the Azure Function Host, because suddenly I get health check errors like:
> [Tag=''] Process reporting unhealthy: Unhealthy. Health check entries are {"azure.functions.web_host.lifecycle":{"status":"Healthy","description":null},"azure.functions.script_host.lifecycle":{"status":"Healthy","description":null},"azure.functions.webjobs.storage":{"status":"Unhealthy","description":"Unable to create client for AzureWebJobsStorage"}}
The issue is cause by the the new health checks in the Azure Function Host. More specific in [WebJobsStorageHealthCheck ](https://github.com/Azure/azure-functions-host/blob/dev/src/WebJobs.Script/Diagnostics/HealthChecks/WebJobsStorageHealthCheck.cs).
In my case I don't have AzureWebJobsStorage configured, because it's not a durable function and I don't need any Azure Storage Account.
C# Binding code.
```csharp
public async Task RunAsync(
[ServiceBusTrigger(ServiceBusTopicNames.Events, ServiceBusSubscriptionNames.Audit, Connection = "AttestServiceBusConnectionString")] string sbMessage,
string label,
string correlationId)
```
Docker image being used: mcr.microsoft.com/azure-functions/dotnet-isolated:4-dotnet-isolated8.0
#### Repro steps
Just create a Azure Function using the ServiceBusTrigger attribute, and only configure the required settings for the ServiceBusTrigger (so don't configure AzureWebJobsStorage)
Contributor guide
Research direction
Start with src/WebJobs.Script/Diagnostics/HealthChecks/WebJobsStorageHealthCheck.cs, then reproduce the reported ServiceBusTrigger container setup with AzureWebJobsStorage unset. Verify whether a function that does not use Azure Storage still reports an unhealthy storage check, and confirm the health output no longer produces the warning in that configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, csharp
- Domain
- backend, cloud, observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100