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

Allow customizing underlying Azure Storage container for EventHubsEmulator #7207

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Jan-Weiss
Copy link

Add an optional parameter to the RunAsEmulator method for the EventHubs resource to allow customizing the underlying azure storage container.

Description

In Aspire 9.0 the EventHubs emulator does not work properly, because the Azure Storage image tag is set to 3.32.0 by default and this tag does not support the API version used by the healthcheck. This Exception is thrown in the AzureBlobStorageHealthCheck class:

The API version 2025-01-05 is not supported by Azurite. Please upgrade Azurite to latest version and retry. If you are using Azurite in Visual Studio, please check you have installed latest Visual Studio patch. Azurite command line parameter "--skipApiVersionCheck" or Visual Studio Code configuration "Skip Api Version Check" can skip this error. 
RequestId:0b388229-42f5-4d34-b929-3ec31af870fe
Time:2025-01-22T08:05:03.664Z
Status: 400 (The API version 2025-01-05 is not supported by Azurite. Please upgrade Azurite to latest version and retry. If you are using Azurite in Visual Studio, please check you have installed latest Visual Studio patch. Azurite command line parameter "--skipApiVersionCheck" or Visual Studio Code configuration "Skip Api Version Check" can skip this error. )
ErrorCode: InvalidHeaderValue

Content:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Error>
  <Code>InvalidHeaderValue</Code>
  <Message>The API version 2025-01-05 is not supported by Azurite. Please upgrade Azurite to latest version and retry. If you are using Azurite in Visual Studio, please check you have installed latest Visual Studio patch. Azurite command line parameter "--skipApiVersionCheck" or Visual Studio Code configuration "Skip Api Version Check" can skip this error. 
RequestId:0b388229-42f5-4d34-b929-3ec31af870fe
Time:2025-01-22T08:05:03.664Z</Message>
</Error>

Headers:
Server: Azurite-Blob/3.32.0
x-ms-error-code: InvalidHeaderValue
x-ms-request-id: 0b388229-42f5-4d34-b929-3ec31af870fe
Date: Wed, 22 Jan 2025 08:05:03 GMT
Connection: keep-alive
Keep-Alive: REDACTED
Transfer-Encoding: chunked
Content-Type: application/xml

Stacktrace:

   at Azure.Storage.Blobs.ServiceRestClient.<ListContainersSegmentAsync>d__17.MoveNext()
   at Azure.Storage.Blobs.BlobServiceClient.<GetBlobContainersInternal>d__43.MoveNext()
   at Azure.Storage.Blobs.Models.GetBlobContainersAsyncCollection.<GetNextPageAsync>d__5.MoveNext()
   at System.Threading.Tasks.ValueTask`1.get_Result()
   at Azure.Storage.StorageCollectionEnumerator`1.StorageAsyncPageable.<AsPages>d__4.MoveNext()
   at Azure.Storage.StorageCollectionEnumerator`1.StorageAsyncPageable.<AsPages>d__4.System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult(Int16 token)
   at HealthChecks.Azure.Storage.Blobs.AzureBlobStorageHealthCheck.<CheckHealthAsync>d__3.MoveNext() in /_/src/HealthChecks.Azure.Storage.Blobs/AzureBlobStorageHealthCheck.cs:line 37

Currently this is already fixed by setting the default tag to 3.33.0. But in order to avoid issues like this in the future one should be able to configure the Azure Storage emulator container for the EventHubs emulator.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • [] Yes
      • If yes, did you have an API Review for it?
        • Yes
        • [] No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • [] Yes
        • No
    • No, optional parameter for existing API
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?

…xtensions to allow customizing the azure storage container.
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jan 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant