Table of Contents

Interface IAzureArtifactStorage

Namespace
Invex.Atom.Module.AzureStorage
Assembly
Invex.Atom.Module.AzureStorage.dll

Provides an interface for configuring Azure Blob Storage as an artifact store.

[ConfigureHostBuilder]
public interface IAzureArtifactStorage : IStoreArtifact, IRetrieveArtifact, IAtomArtifactsParam, ISetupBuildInfo, IBuildInfo, IVariablesHelper, IReportsHelper, IBuildAccessor
Inherited Members

Remarks

This interface extends IStoreArtifact and IRetrieveArtifact, enabling the build to both upload and download artifacts from Azure Blob Storage.

Connect either with AzureArtifactStorageConnectionString, or with AzureArtifactStorageAccountUrl and a Microsoft Entra token credential, selected in this order: a client secret (tenant ID, client ID and client secret); the GitHub Actions OIDC token (tenant ID and client ID, with the id-token: write permission); an Azure Pipelines workload identity federation service connection (tenant ID, client ID and service connection ID, with SYSTEM_ACCESSTOKEN mapped); otherwise DefaultAzureCredential, followed by an interactive browser login when not running headless.

Properties

AzureArtifactStorageAccountUrl

Gets the Blob service URL of the Azure Storage account, for example https://myaccount.blob.core.windows.net.

[ParamDefinition("azurestorage-artifact-account-url", "Blob service URL of the Azure storage account", ParamSource.All, null)]
string? AzureArtifactStorageAccountUrl { get; }

Property Value

string

Remarks

Used with a Microsoft Entra token credential when no connection string is set. The identity needs a data role on the container, such as Storage Blob Data Contributor. See IAzureArtifactStorage for how the credential is selected.

AzureArtifactStorageClientId

Gets the client (application) ID of the app registration or user-assigned managed identity that has access to the storage account.

[ParamDefinition("azurestorage-artifact-client-id", "Client ID of the app registration or managed identity that has access to the Azure storage account", ParamSource.All, null)]
string? AzureArtifactStorageClientId { get; }

Property Value

string

Remarks

Required for client secret and federated (OIDC) authentication with an account URL. With DefaultAzureCredential it is used as the workload identity and managed identity client ID.

AzureArtifactStorageClientSecret

Gets the client secret of the app registration that has access to the storage account.

[SecretDefinition("azurestorage-artifact-client-secret", "Client secret of the app registration that has access to the Azure storage account", ParamSource.All, null)]
string? AzureArtifactStorageClientSecret { get; }

Property Value

string

Remarks

Optional; prefer federated credentials (OIDC) in CI where possible.

AzureArtifactStorageConnectionString

Gets the connection string for the Azure Storage account.

[SecretDefinition("azurestorage-artifact-connectionstring", "Connection string for Azure storage container", ParamSource.All, null)]
string? AzureArtifactStorageConnectionString { get; }

Property Value

string

Remarks

Optional when AzureArtifactStorageAccountUrl is set; takes precedence over it when both are set. Store it securely, for example as a CI secret, in .NET user secrets or in Azure Key Vault.

AzureArtifactStorageContainer

Gets the name of the Azure Blob Storage container to use for artifacts.

[ParamDefinition("azurestorage-artifact-container", "Azure storage container", ParamSource.All, null)]
string AzureArtifactStorageContainer { get; }

Property Value

string

Remarks

This parameter specifies the target container within the Azure Storage account where artifacts will be stored and retrieved.

AzureArtifactStorageServiceConnectionId

Gets the ID of the Azure DevOps service connection (workload identity federation) used to authenticate in Azure Pipelines.

[ParamDefinition("azurestorage-artifact-service-connection-id", "Azure DevOps service connection ID for workload identity federation with Azure storage", ParamSource.All, null)]
string? AzureArtifactStorageServiceConnectionId { get; }

Property Value

string

Remarks

Only used in Azure Pipelines, where SYSTEM_ACCESSTOKEN must also be mapped into the target step's environment.

AzureArtifactStorageTenantId

Gets the Microsoft Entra tenant ID used to authenticate with the storage account.

[ParamDefinition("azurestorage-artifact-tenant-id", "Microsoft Entra tenant ID for Azure storage authentication", ParamSource.All, null)]
string? AzureArtifactStorageTenantId { get; }

Property Value

string

Remarks

Required for client secret and federated (OIDC) authentication with an account URL.

Methods

ConfigureHostBuilderFromIAzureArtifactStorage(IHostApplicationBuilder)

Configures the host builder to add Azure Blob Storage artifact services.

protected static void ConfigureHostBuilderFromIAzureArtifactStorage(IHostApplicationBuilder builder)

Parameters

builder IHostApplicationBuilder

The host application builder.

Remarks

This method registers the module's internal Azure Blob Storage implementation as the singleton IArtifactProvider, making Azure Blob Storage available for artifact management throughout the build.