{"record":{"id":"c00c47fc98cbc752","repo":"microsoft/aspire","slug":"emulator-currently-does-not-support-data-lake-c00c47","errorCode":null,"errorMessage":"Emulator currently does not support data lake.","messagePattern":"Emulator currently does not support data lake\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Azure.Storage/AzureStorageResource.cs","lineNumber":104,"sourceCode":"\n    /// <summary>\n    /// Gets the connection URI expression for the blob storage service.\n    /// </summary>\n    /// <remarks>\n    /// Format: <c>https://{host}:{port}</c> for emulator or <c>{blobEndpoint}</c> for Azure.\n    /// </remarks>\n    public ReferenceExpression BlobUriExpression => IsEmulator\n        ? ReferenceExpression.Create($\"{EmulatorBlobEndpoint.Property(EndpointProperty.Url)}\")\n        : ReferenceExpression.Create($\"{BlobEndpoint}\");\n\n    /// <summary>\n    /// Gets the connection URI expression for the data lake storage service.\n    /// </summary>\n    /// <remarks>\n    /// Format: <c>{blobEndpoint}</c> for Azure.\n    /// </remarks>\n    public ReferenceExpression DataLakeUriExpression => IsEmulator\n        ? throw new InvalidOperationException(\"Emulator currently does not support data lake.\")\n        : ReferenceExpression.Create($\"{DataLakeEndpoint}\");\n\n    /// <summary>\n    /// Gets the connection URI expression for the queue storage service.\n    /// </summary>\n    /// <remarks>\n    /// Format: <c>https://{host}:{port}</c> for emulator or <c>{queueEndpoint}</c> for Azure.\n    /// </remarks>\n    public ReferenceExpression QueueUriExpression => IsEmulator\n        ? ReferenceExpression.Create($\"{EmulatorQueueEndpoint.Property(EndpointProperty.Url)}\")\n        : ReferenceExpression.Create($\"{QueueEndpoint}\");\n\n    /// <summary>\n    /// Gets the connection URI expression for the table storage service.\n    /// </summary>\n    /// <remarks>\n    /// Format: <c>https://{host}:{port}</c> for emulator or <c>{tableEndpoint}</c> for Azure.\n    /// </remarks>","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.Storage/AzureStorageResource.cs#L86-L122","documentation":"AzureStorageResource.DataLakeUriExpression returns the data lake endpoint URI for real Azure Storage but deliberately refuses when the resource is the Azurite emulator, since Azurite does not implement the Data Lake Storage (ADLS Gen2) API. The throw is an explicit unsupported-operation guard, not a transient failure.","triggerScenarios":"Accessing resource.DataLakeUriExpression (directly or via DataLake connection APIs / GetDataLake...) on a storage resource running with RunAsEmulator(), i.e. IsEmulator == true.","commonSituations":"An app that works against real Azure Storage is pointed at the local Azurite emulator and a component requests the data lake URI; templated code using DataLake endpoints run in local dev.","solutions":["Do not use Data Lake APIs with the emulator — remove DataLake usage from the emulator code path","Run against a real Azure Storage account when data lake access is required","Branch on resource.IsEmulator and provide an alternative (e.g. blob endpoint) for local development"],"exampleFix":"// before\nvar dlUri = storageResource.Resource.DataLakeUriExpression;\n// after\nif (storageResource.Resource.IsEmulator)\n{\n    // Azurite has no data lake support; use blob endpoint instead\n    var uri = storageResource.Resource.BlobUriExpression;\n}\nelse\n{\n    var uri = storageResource.Resource.DataLakeUriExpression;\n}","handlingStrategy":"validation","validationCode":"if (storageResource.IsEmulator)\n    throw new NotSupportedException(\"Data Lake is not supported by the Azurite emulator; use blob endpoints or real Azure Storage.\");","typeGuard":"static bool SupportsDataLake(AzureStorageResource r) => !r.IsEmulator;","tryCatchPattern":"try { uri = resource.DataLakeUriExpression; }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"does not support data lake\")) { uri = resource.BlobUriExpression; }","preventionTips":["Branch on resource.IsEmulator before touching Data Lake APIs","Reserve ADLS Gen2 functionality for deployments against real Azure Storage","Document emulator limitations (no data lake) in local dev setup"],"tags":["azure-storage","emulator","azurite","data-lake","unsupported-feature"],"backgroundTag":"unsupported-operation","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T09:17:21.228Z"}