Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure EventHubs Emulator WithDataBindMount doesn't do anything #8008

Open
eerhardt opened this issue Mar 11, 2025 · 0 comments
Open

Azure EventHubs Emulator WithDataBindMount doesn't do anything #8008

eerhardt opened this issue Mar 11, 2025 · 0 comments
Assignees
Labels
area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure azure-eventhubs Issues related to Azure Event Hubs integration
Milestone

Comments

@eerhardt
Copy link
Member

We have WithDataBindMount and WithDataVolume on the EventHubs emulator:

/// <summary>
/// Adds a bind mount for the data folder to an Azure Event Hubs emulator resource.
/// </summary>
/// <param name="builder">The builder for the <see cref="AzureEventHubsEmulatorResource"/>.</param>
/// <param name="path">Relative path to the AppHost where emulator storage is persisted between runs. Defaults to the path '.eventhubs/{builder.Resource.Name}'</param>
/// <returns>A builder for the <see cref="AzureEventHubsEmulatorResource"/>.</returns>
public static IResourceBuilder<AzureEventHubsEmulatorResource> WithDataBindMount(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string? path = null)
{
ArgumentNullException.ThrowIfNull(builder);
return builder.WithBindMount(path ?? $".eventhubs/{builder.Resource.Name}", "/data", isReadOnly: false);
}
/// <summary>
/// Adds a named volume for the data folder to an Azure Event Hubs emulator resource.
/// </summary>
/// <param name="builder">The builder for the <see cref="AzureEventHubsEmulatorResource"/>.</param>
/// <param name="name">The name of the volume. Defaults to an auto-generated name based on the application and resource names.</param>
/// <returns>A builder for the <see cref="AzureEventHubsEmulatorResource"/>.</returns>
public static IResourceBuilder<AzureEventHubsEmulatorResource> WithDataVolume(this IResourceBuilder<AzureEventHubsEmulatorResource> builder, string? name = null)
{
ArgumentNullException.ThrowIfNull(builder);
return builder.WithVolume(name ?? VolumeNameGenerator.Generate(builder, "data"), "/data", isReadOnly: false);
}

However, it appears that this folder isn't where the EventHubs emulator writes persistent data to. Looking at the docs:

https://learn.microsoft.com/en-us/azure/event-hubs/overview-emulator#known-limitations

Note
After a container restart, data and entities don't persist in the emulator.

We should obsolete these methods if they don't enable a scenario.

See https://github.com/dotnet/aspire/pull/4209/files#r1619294488 for some discussion on this topic.

cc @sebastienros @oising

@github-actions github-actions bot added the area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication label Mar 11, 2025
@eerhardt eerhardt added area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure azure-eventhubs Issues related to Azure Event Hubs integration and removed area-app-model Issues pertaining to the APIs in Aspire.Hosting, e.g. DistributedApplication labels Mar 12, 2025
@eerhardt eerhardt added this to the 9.2 milestone Mar 12, 2025
@eerhardt eerhardt self-assigned this Mar 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-integrations Issues pertaining to Aspire Integrations packages azure Issues associated specifically with scenarios tied to using Azure azure-eventhubs Issues related to Azure Event Hubs integration
Projects
None yet
Development

No branches or pull requests

1 participant