sebagomez / azurestorageexplorer

☁💾 Manage your Azure Storage blobs, tables, queues and file shares from this simple and intuitive web application.
https://azurestorage.azurewebsites.net/
MIT License
130 stars 66 forks source link

Cannot log in with storage connection string or pass it through AZURE_STORAGE_CONNECTIONSTRING #173

Closed NiklasEi closed 2 weeks ago

NiklasEi commented 2 weeks ago

This project looks perfect as a frontend for a local dev Azurite setup, thank you for that. I would like to use it in an Aspire project.

With the following, Aspire starts up a local Azurite with blob storage and a storage explorer. Aspire also passes the connection string to the storage explorer:

var builder = DistributedApplication.CreateBuilder(args);

// ....

var documentStorage = builder.AddAzureStorage("documentStorage").RunAsEmulator();
var documentContainer = documentStorage.AddBlobs("documentContainer");

builder.AddContainer("documents-explorer", "sebagomez/azurestorageexplorer")
    .WithHttpEndpoint(targetPort: 8080)
    .WithEnvironment("AZURE_STORAGE_CONNECTIONSTRING", documentContainer)
    .ExcludeFromManifest();

// ...

await builder.Build().RunAsync();

Aspire starts up the container as expected. I can connect to the running Azurite through my code and verified, that the explorer container gets the connection string in the env variable AZURE_STORAGE_CONNECTIONSTRING.

But when opening the explorer webpage, the login screen is shown instead of the application automatically logging in with the provided connection string. Pasting the connection string and clicking the "Sign in" button does nothing (no console messages and nothing in the container output). There seem to be no errors in the container logs.

NiklasEi commented 2 weeks ago

This is likely a general connectivity issue from Aspire on Linux without Docker Desktop (see e.g. https://github.com/dotnet/aspire/issues/5509#issuecomment-2331876263). Sorry for the noise.