dotnet / aspire

An opinionated, cloud ready stack for building observable, production ready, distributed applications in .NET
https://learn.microsoft.com/dotnet/aspire
MIT License
3.37k stars 348 forks source link

The API version 2024-05-04 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. #4646

Open varndellwagglebee opened 1 week ago

varndellwagglebee commented 1 week ago

Getting the following azurite error. I upgrade Azurite and still the same message: The API version 2024-05-04 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.

JordanZaerr commented 5 days ago

Ran into this today and had to poke around in their sample app to figure out why it worked and my code didn't.

If you target Azure.Storage.Blobs version 12.19.1 instead of 12.20.0 then it avoids this error. That package is a dependency of Aspire.Azure.Storage.Blobs. That is my workaround for now at least.

zbarrier commented 1 day ago

This work around only works for the previous version of Aspire. The latest (8.0.2) requires Azure.Storage.Blobs >= 12.20.0. Is there another work around for 8.0.2?

for-shariq commented 22 hours ago

Facing the same issue.

JordanZaerr commented 22 hours ago

They released 8.0.2 after my previous comment. I'm sure this will be updated eventually as well but they released a new version of Azurite that supports this API version(3.30.0).

The RunAsEmulator call hardcodes version 3.29.0 inside that extension method. That is suppose to be fixed though.

    storage.RunAsEmulator(c => c.WithImageTag("3.30.0"));

That should download the new azurite container and start it up as usual.

VasilisPlavos commented 21 hours ago

As @JordanZaerr said, just use Azure.Storage.Blobs version 12.19.1 and it will work. 😊

zbarrier commented 21 hours ago

They released 8.0.2 after my previous comment. I'm sure this will be updated eventually as well but they released a new version of Azurite that supports this API version(3.3.0).

The RunAsEmulator call hardcodes version 3.29.0 inside that extension method. So I just call that function again with the new version...

storage.RunAsEmulator()
    .WithAnnotation(new ContainerImageAnnotation
    {
        Registry = "mcr.microsoft.com",
        Image = "azure-storage/azurite",
        Tag = "3.30.0"
    });

That should download the new azurite container and start it up as usual.

This worked with 8.0.2. Thank you!

JordanZaerr commented 21 hours ago

@zbarrier I edited my comment because in the PR I linked I found a cleaner way to do the same thing.