AspireBlobStorageExtensions Methods
ClassMethods6 members
Provides extension methods for registering
Blobs.BlobServiceClient as a singleton in the services provided by the Hosting.IHostApplicationBuilder. AddAzureBlobClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)Section titled AddAzureBlobClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)extension Registers
Blobs.BlobServiceClient as a singleton in the services provided by the builder. Enables retries, corresponding health check, logging and telemetry. public static class AspireBlobStorageExtensions{ public static void AddAzureBlobClient( this IHostApplicationBuilder builder, string connectionName, Action<AzureStorageBlobsSettings>? configureSettings = null, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>? configureClientBuilder = null) { // ... }}Parameters
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.connectionNamestring A name used to retrieve the connection string from the ConnectionStrings configuration section. configureSettingsAction<AzureStorageBlobsSettings>optional An optional method that can be used for customizing the AzureStorageBlobsSettings. It's invoked after the settings are read from the configuration. configureClientBuilderAction<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2. Exceptions
InvalidOperationException Neither AzureStorageBlobsSettings.ConnectionString nor AzureStorageBlobsSettings.ServiceUri is provided. Remarks
Reads the configuration from "Aspire:Azure:Storage:Blobs" section.
AddAzureBlobContainerClient(IHostApplicationBuilder, string, Action<AzureBlobStorageContainerSettings>, Action<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>)Section titled AddAzureBlobContainerClient(IHostApplicationBuilder, string, Action<AzureBlobStorageContainerSettings>, Action<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>)extension Registers
Blobs.BlobContainerClient as a singleton in the services provided by the builder. Enables retries, corresponding health check, logging and telemetry. public static class AspireBlobStorageExtensions{ public static void AddAzureBlobContainerClient( this IHostApplicationBuilder builder, string connectionName, Action<AzureBlobStorageContainerSettings>? configureSettings = null, Action<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>? configureClientBuilder = null) { // ... }}Parameters
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.connectionNamestringA name used to retrieve the connection string from the ConnectionStrings configuration section.configureSettingsAction<AzureBlobStorageContainerSettings>optional An optional method that can be used for customizing the AzureStorageBlobsSettings. It's invoked after the settings are read from the configuration. configureClientBuilderAction<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2. Exceptions
InvalidOperationException Neither AzureStorageBlobsSettings.ConnectionString nor AzureStorageBlobsSettings.ServiceUri is provided. - or - AzureBlobStorageContainerSettings.BlobContainerName is not provided in the configuration section. Remarks
Reads the configuration from "Aspire:Azure:Storage:Blobs" section.
AddAzureBlobServiceClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)Section titled AddAzureBlobServiceClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)extension Registers
Blobs.BlobServiceClient as a singleton in the services provided by the builder. Enables retries, corresponding health check, logging and telemetry. public static class AspireBlobStorageExtensions{ public static void AddAzureBlobServiceClient( this IHostApplicationBuilder builder, string connectionName, Action<AzureStorageBlobsSettings>? configureSettings = null, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>? configureClientBuilder = null) { // ... }}Parameters
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.connectionNamestring A name used to retrieve the connection string from the ConnectionStrings configuration section. configureSettingsAction<AzureStorageBlobsSettings>optional An optional method that can be used for customizing the AzureStorageBlobsSettings. It's invoked after the settings are read from the configuration. configureClientBuilderAction<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2. Exceptions
InvalidOperationException Neither AzureStorageBlobsSettings.ConnectionString nor AzureStorageBlobsSettings.ServiceUri is provided. Remarks
Reads the configuration from "Aspire:Azure:Storage:Blobs" section.
AddKeyedAzureBlobClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)Section titled AddKeyedAzureBlobClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)extension Registers
Blobs.BlobServiceClient as a singleton for given name in the services provided by the builder. Enables retries, corresponding health check, logging and telemetry. public static class AspireBlobStorageExtensions{ public static void AddKeyedAzureBlobClient( this IHostApplicationBuilder builder, string name, Action<AzureStorageBlobsSettings>? configureSettings = null, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>? configureClientBuilder = null) { // ... }}Parameters
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.namestring The name of the component, which is used as the ServiceDescriptor.ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section. configureSettingsAction<AzureStorageBlobsSettings>optional An optional method that can be used for customizing the AzureStorageBlobsSettings. It's invoked after the settings are read from the configuration. configureClientBuilderAction<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2. Exceptions
InvalidOperationException Neither AzureStorageBlobsSettings.ConnectionString nor AzureStorageBlobsSettings.ServiceUri is provided. Remarks
Reads the configuration from "Aspire:Azure:Storage:Blobs:{name}" section.
AddKeyedAzureBlobContainerClient(IHostApplicationBuilder, string, Action<AzureBlobStorageContainerSettings>, Action<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>)Section titled AddKeyedAzureBlobContainerClient(IHostApplicationBuilder, string, Action<AzureBlobStorageContainerSettings>, Action<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>)extension Registers
Blobs.BlobContainerClient as a singleton in the services provided by the builder. Enables retries, corresponding health check, logging and telemetry. public static class AspireBlobStorageExtensions{ public static void AddKeyedAzureBlobContainerClient( this IHostApplicationBuilder builder, string name, Action<AzureBlobStorageContainerSettings>? configureSettings = null, Action<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>? configureClientBuilder = null) { // ... }}Parameters
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.namestring The name of the component, which is used as the ServiceDescriptor.ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section. configureSettingsAction<AzureBlobStorageContainerSettings>optional An optional method that can be used for customizing the AzureStorageBlobsSettings. It's invoked after the settings are read from the configuration. configureClientBuilderAction<IAzureClientBuilder<BlobContainerClient, BlobClientOptions>>optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2. Exceptions
InvalidOperationException Neither AzureStorageBlobsSettings.ConnectionString nor AzureStorageBlobsSettings.ServiceUri is provided. - or - AzureBlobStorageContainerSettings.BlobContainerName is not provided in the configuration section. Remarks
Reads the configuration from "Aspire:Azure:Storage:Blobs:{name}" section.
AddKeyedAzureBlobServiceClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)Section titled AddKeyedAzureBlobServiceClient(IHostApplicationBuilder, string, Action<AzureStorageBlobsSettings>, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>)extension Registers
Blobs.BlobServiceClient as a singleton for given name in the services provided by the builder. Enables retries, corresponding health check, logging and telemetry. public static class AspireBlobStorageExtensions{ public static void AddKeyedAzureBlobServiceClient( this IHostApplicationBuilder builder, string name, Action<AzureStorageBlobsSettings>? configureSettings = null, Action<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>? configureClientBuilder = null) { // ... }}Parameters
builderIHostApplicationBuilderThe Hosting.IHostApplicationBuilder to read config from and add services to.namestring The name of the component, which is used as the ServiceDescriptor.ServiceKey of the service and also to retrieve the connection string from the ConnectionStrings configuration section. configureSettingsAction<AzureStorageBlobsSettings>optional An optional method that can be used for customizing the AzureStorageBlobsSettings. It's invoked after the settings are read from the configuration. configureClientBuilderAction<IAzureClientBuilder<BlobServiceClient, BlobClientOptions>>optional An optional method that can be used for customizing the Extensions.IAzureClientBuilder`2. Exceptions
InvalidOperationException Neither AzureStorageBlobsSettings.ConnectionString nor AzureStorageBlobsSettings.ServiceUri is provided. Remarks
Reads the configuration from "Aspire:Azure:Storage:Blobs:{name}" section.