Skip to content

Docs: Azure Blob Storage env vars differ between local emulator and deployed environments #728

Open

Description

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

When using Azure Blob Storage with Aspire (addAzureStorage + addBlobContainer), the environment variables injected into the consuming app differ between local development (Azurite emulator) and deployed (Azure) environments, but this is not documented.

Local (Azurite emulator):

  • PLANTDATA_CONNECTIONSTRING ✅ (full Azurite connection string)
  • PLANTDATA_URI ❌ (not set)
  • PLANTDATA_BLOBCONTAINERNAME ✅

Deployed (Azure):

  • PLANTDATA_CONNECTIONSTRING ❌ (not set)
  • PLANTDATA_URI ✅ (blob endpoint URI)
  • PLANTDATA_BLOBCONTAINERNAME ✅

This means code that works locally with PLANTDATA_CONNECTIONSTRING breaks in production, and vice versa. The app needs to check for both and handle each case differently, but there's no documentation explaining this asymmetry.

Expected Behavior

The docs for Azure Blob Storage integration should clearly document:

  1. Which environment variables are injected in each environment (local vs deployed)
  2. That CONNECTIONSTRING is only available with the emulator
  3. The recommended pattern for writing code that works in both environments (e.g., check URI first, fall back to CONNECTIONSTRING)

Steps To Reproduce

  1. Create an Aspire app with addAzureStorage('storage').runAsEmulator().addBlobContainer('plantdata')
  2. Reference the blob container from a Next.js/Node app
  3. Note PLANTDATA_CONNECTIONSTRING works locally
  4. Deploy to Azure — PLANTDATA_CONNECTIONSTRING is not set, only PLANTDATA_URI

Aspire Version

Latest Aspire CLI + TypeScript AppHost (Node.js)

Additional Context

Found during #AspiriFridays stream while building a Next.js garden journal app. Our workaround is to check for PLANTDATA_URI first (production) and fall back to PLANTDATA_CONNECTIONSTRING (local), using DefaultAzureCredential for the URI path and BlobServiceClient.fromConnectionString() for the connection string path.

Activity

  1. IEvangelist commented on Jun 2, 2026

    @IEvangelist
    Member

    Triage → David Pine (@IEvangelist)

    Reporter documents real env-var differences between Azurite (local) and deployed Azure Blob Storage when using AddAzureStorage().AddBlobContainer(...). Before writing docs we need to capture the canonical mapping by reading the integration's WithEnvironment builder in both dev and publish modes. Worth confirming with Maddy Montaquila (@maddymontaquila) (author) whether this is intended behavior or a bug to fix in the integration. Risk of shipping wrong guidance if Copilot infers it from the current MDX alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

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