Table of Contents

Class ServiceCollectionExtensions

Namespace
Kentico.Xperience.AzureStorage
Assembly
Kentico.Xperience.AzureStorage.dll

Extension methods for configuring Azure services in the dependency injection container.

public static class ServiceCollectionExtensions
Inheritance
object
ServiceCollectionExtensions

Methods

AddAzureStorageCredential(IServiceCollection, Func<IServiceProvider, TokenCredential>)

Configures Azure Storage to use TokenCredential-based authentication (managed identity) instead of shared key authentication.

public static IServiceCollection AddAzureStorageCredential(this IServiceCollection services, Func<IServiceProvider, TokenCredential> credentialFactory)

Parameters

services IServiceCollection

The service collection to add the credential factory to.

credentialFactory Func<IServiceProvider, TokenCredential>

A factory function that receives the service provider and returns a Azure.Core.TokenCredential. The service provider can be used to resolve other services needed for credential configuration.

Returns

IServiceCollection

The service collection for chaining.

Remarks

See official Microsoft documentation on how to configure the managed identity credentials.