Skip to content

"Add Azure Blob Storage resource" Incorrectly using AddBlobs instead of AddBlobContainer #674

@vyrotek

Description

@vyrotek

The Add Azure Blob Storage resource section states:

... how to add an Azure Blob Storage resource named storage and a blob container named blobs

With a code example of:

var builder = DistributedApplication.CreateBuilder(args);

var blobs = builder.AddAzureStorage("storage")
    .RunAsEmulator(azurite => { /* optional azurite configuration */ })
    .AddBlobs("blobs");

builder.AddProject<Projects.ExampleProject>()
    .WithReference(blobs)
    .WaitFor(blobs);

// After adding all resources, run the app...

This line does not create a container named blobs.

.AddBlobs("blobs");

Instead, it may have intended to use:

.AddBlobContainer("blobs");

Lines that may need to be addressed:

In your AppHost project, register the Azure Blob Storage integration by chaining a call to `AddBlobs` on the `IResourceBuilder<IAzureStorageResource>` instance returned by `AddAzureStorage`. The following example demonstrates how to add an Azure Blob Storage resource named `storage` and a blob container named `blobs`:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions