Add Azure Storage Account Health Checks to Marketing.API
This commit is contained in:
parent
b74a1b6db5
commit
a8ad3edf30
@ -57,6 +57,7 @@
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusRabbitMQ\EventBusRabbitMQ.csproj" />
|
||||
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.AspNetCore.HealthChecks\Microsoft.AspNetCore.HealthChecks.csproj" />
|
||||
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks.AzureStorage\Microsoft.Extensions.HealthChecks.AzureStorage.csproj" />
|
||||
<ProjectReference Include="..\..\..\BuildingBlocks\HealthChecks\src\Microsoft.Extensions.HealthChecks\Microsoft.Extensions.HealthChecks.csproj" />
|
||||
<ProjectReference Include="..\..\..\BuildingBlocks\EventBus\EventBusServiceBus\EventBusServiceBus.csproj" />
|
||||
</ItemGroup>
|
||||
|
@ -66,6 +66,13 @@
|
||||
services.AddHealthChecks(checks =>
|
||||
{
|
||||
checks.AddValueTaskCheck("HTTP Endpoint", () => new ValueTask<IHealthCheckResult>(HealthCheckResult.Healthy("Ok")));
|
||||
|
||||
var accountName = Configuration.GetValue<string>("AzureStorageAccountName");
|
||||
var accountKey = Configuration.GetValue<string>("AzureStorageAccountKey");
|
||||
if (!string.IsNullOrEmpty(accountName) && !string.IsNullOrEmpty(accountKey))
|
||||
{
|
||||
checks.AddAzureBlobStorageCheck(accountName, accountKey);
|
||||
}
|
||||
});
|
||||
|
||||
services.AddDbContext<MarketingContext>(options =>
|
||||
|
Loading…
x
Reference in New Issue
Block a user