microsoft/aspire · error · InvalidOperationException
Emulator currently does not support data lake.
Error message
Emulator currently does not support data lake.
What it means
AzureDataLakeStorageResource.GetConnectionString throws InvalidOperationException when the parent Azure Storage resource is running against the local emulator, because no emulator supports the Data Lake Storage (Gen2) API. Connection strings for data lake access can only be resolved against a real Azure Storage account.
Solutions
- Run against a real Azure Storage account instead of the emulator (remove RunAsEmulator)
- Avoid requesting a data lake connection string in emulator mode; use blob endpoints only
- Gate the data lake resource behind a flag so it is only added when not using the emulator
Example fix
// before
var storage = builder.AddAzureStorage("storage").RunAsEmulator();
var lake = storage.AddDataLakeStorage("lake"); // throws when connection string resolved
// after
var storage = builder.AddAzureStorage("storage"); // real account; no RunAsEmulator
var lake = storage.AddDataLakeStorage("lake"); Defensive patterns
Strategy: validation
Validate before calling
if (storage.Resource.IsEmulator)
throw new InvalidOperationException("Data lake requires a real Azure Storage account; the emulator is in use."); Try / catch
try { var cs = lake.GetConnectionString(); }
catch (InvalidOperationException) { // fall back to blob-only usage under emulator
useBlobOnly = true;
} Prevention
- Check Parent.IsEmulator before adding or consuming data lake resources
- Use RunAsEmulator only for blob/queue workloads
- Provision a real storage account for data lake scenarios even in local dev
When it happens
Trigger: Calling GetConnectionString (directly or via ConnectionStringExpression) on an AzureDataLakeStorageResource whose Parent.IsEmulator is true, e.g. after RunAsEmulator on the storage resource.
Common situations: Local development with azurite/Azurite emulator while the app also requests data lake (HNS) access; integration tests using the emulator but wiring a data lake resource.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- Emulator currently does not support data lake.
- is not initialized.
- was published for the ' ' resource but the connection…
- Dashboard endpoint is only available when running as an…
- Endpoint ' ' on resource ' ' uses transport ' '. Azure…
AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16).
Data as JSON: /api/errors/aacbe0d22d38d66d.
Report an issue: GitHub.
Appendix: source
Thrown at src/Aspire.Hosting.Azure.Storage/AzureDataLakeStorageResource.cs:41
/// <summary>
/// Gets the connection URI expression for the data lake storage service.
/// </summary>
/// <remarks>
/// Format: <c>{blobEndpoint}</c> for Azure.
/// </remarks>
public ReferenceExpression UriExpression => Parent.DataLakeUriExpression;
/// <summary>
/// Gets the connection string template for the manifest for the Azure DataLake Storage resource.
/// </summary>
public ReferenceExpression ConnectionStringExpression => Parent.GetDataLakeConnectionString();
internal ReferenceExpression GetConnectionString(string? fileSystemName)
{
if (Parent.IsEmulator)
{
throw new InvalidOperationException("Emulator currently does not support data lake.");
}
if (string.IsNullOrEmpty(fileSystemName))
{
return ConnectionStringExpression;
}
ReferenceExpressionBuilder builder = new();
builder.Append($"Endpoint={ConnectionStringExpression}");
builder.Append($";FileSystemName={fileSystemName}");
return builder.Build();
}
void IResourceWithAzureFunctionsConfig.ApplyAzureFunctionsConfiguration(
IDictionary<string, object> target,View on GitHub (pinned to 25830f84bd)