Azure Blob

Description

Azure Blob Storage can be used as the backing implementation for Flex file operations. Your application code should depend on IFlexFileStore, while Flex provides the Azure Blob implementation and wiring.

Important concepts

  • IFlexFileStore is the contract: uploads/downloads are done through a shared abstraction.

  • Streaming: uploads use a Stream; downloads return a Stream? (handle null if the file doesn’t exist).

  • Container scoping: the provider typically writes into a configured container.

Configuration in DI

Add the provider in your DI composition root (commonly in EndPoints/...CommonConfigs/OtherApplicationServicesConfig.cs).

public static class OtherApplicationServicesConfig
{
	public static IServiceCollection AddOtherApplicationServices(
		this IServiceCollection services,
		IConfiguration configuration)
	{
		// Registers Azure Blob as the IFlexFileStore bridge.
		services.AddFlexAzureBlobFileStore(configuration);
		return services;
	}
}

appsettings.json

Configuration is read from FlexBase:DataStores:File:AzureBlob.

Examples (template-based)

These examples mirror the generated Query and PostBusHandler templates. You do not register these types manually—Flex discovers and wires generated Queries/Handlers automatically.

Upload file (PostBusHandler)

Download file (Query)

Library-specific considerations

  • Connection string: store it in a secret manager and inject via configuration.

  • Container creation: CreateContainerIfNotExists=true is convenient for dev; production setups often pre-provision containers.

Last updated