internal static IServiceCollection AddCustomHealthChecks( this IServiceCollection services, IAzureBlobStorageSettings storageSettings) { services.AddHealthChecks() .AddAzureBlobStorage( storageSettings.ConnectionString, storageSettings.ContainerName, null, "Azure Blob Storage", HealthStatus.Unhealthy, new[] { HealthCheckTags.Ready }, storageSettings.HealthCheck?.Timeout) .AddCheck("self", () => HealthCheckResult.Healthy(), new[] { HealthCheckTags.Live }); return(services); }
internal static BlobContainerClient Create(IAzureBlobStorageSettings settings) { var retrySettings = settings.Retry; var options = retrySettings == null ? new BlobClientOptions() : new BlobClientOptions { Retry = { Mode = retrySettings.Mode, MaxRetries = retrySettings.MaxRetries, Delay = retrySettings.Delay, MaxDelay = retrySettings.MaxDelay }, }; return(new BlobServiceClient(settings.ConnectionString, options) .GetBlobContainerClient(settings.ContainerName)); }
public AzureBlobDocumentRepository(BlobContainerClient client, IAzureBlobStorageSettings blobStorageSettings) { this.client = client; this.blobStorageSettings = blobStorageSettings; }