Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Aspire.Hosting.Azure.Storage/AzureStorageExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,11 +251,12 @@ public static IResourceBuilder<AzureStorageResource> RunAsEmulator(this IResourc

// The default arguments list is coming from https://github.com/Azure/Azurite/blob/c3f93445fbd8fd54d380eb265a5665166c460d2b/Dockerfile#L47C6-L47C106
// They need to be repeated in order to be able to add --skipApiVersionCheck
// --disableProductStyleUrl is required to ensure the emulator uses path-style URLs, and not “product-style” URLs which have the account name in the host name of the URL.

var surrogate = new AzureStorageEmulatorResource(builder.Resource);
var surrogateBuilder = builder.ApplicationBuilder
.CreateResourceBuilder(surrogate)
.WithArgs("azurite", "-l", "/data", "--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0", SkipApiVersionCheckArgument);
.WithArgs("azurite", "-l", "/data", "--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0", "--disableProductStyleUrl", SkipApiVersionCheckArgument);

configureContainer?.Invoke(surrogateBuilder);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public async Task AddAzureStorage_WithApiVersionCheck_ShouldSetSkipApiVersionChe

var args = await ArgumentEvaluator.GetArgumentListAsync(storage.Resource);

Assert.All(["azurite", "-l", "/data", "--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0"], x => args.Contains(x));
Assert.All(["azurite", "-l", "/data", "--blobHost", "0.0.0.0", "--queueHost", "0.0.0.0", "--tableHost", "0.0.0.0", "--disableProductStyleUrl"], x => args.Contains(x));

if (enableApiVersionCheck)
{
Expand All @@ -167,6 +167,7 @@ public async Task AddAzureStorage_RunAsEmulator_SetSkipApiVersionCheck()
var args = await ArgumentEvaluator.GetArgumentListAsync(storage.Resource);

Assert.Contains("--skipApiVersionCheck", args);
Assert.Contains("--disableProductStyleUrl", args);
}

[Fact]
Expand Down
Loading