{"record":{"id":"aacbe0d22d38d66d","repo":"microsoft/aspire","slug":"emulator-currently-does-not-support-data-lake","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/AzureDataLakeStorageResource.cs","lineNumber":41,"sourceCode":"\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 UriExpression => Parent.DataLakeUriExpression;\n\n    /// <summary>\n    /// Gets the connection string template for the manifest for the Azure DataLake Storage resource.\n    /// </summary>\n    public ReferenceExpression ConnectionStringExpression => Parent.GetDataLakeConnectionString();\n\n    internal ReferenceExpression GetConnectionString(string? fileSystemName)\n    {\n        if (Parent.IsEmulator)\n        {\n            throw new InvalidOperationException(\"Emulator currently does not support data lake.\");\n        }\n\n        if (string.IsNullOrEmpty(fileSystemName))\n        {\n            return ConnectionStringExpression;\n        }\n\n        ReferenceExpressionBuilder builder = new();\n\n        builder.Append($\"Endpoint={ConnectionStringExpression}\");\n\n        builder.Append($\";FileSystemName={fileSystemName}\");\n\n        return builder.Build();\n    }\n\n    void IResourceWithAzureFunctionsConfig.ApplyAzureFunctionsConfiguration(\n        IDictionary<string, object> target,","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Azure.Storage/AzureDataLakeStorageResource.cs#L23-L59","documentation":"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.","triggerScenarios":"Calling GetConnectionString (directly or via ConnectionStringExpression) on an AzureDataLakeStorageResource whose Parent.IsEmulator is true, e.g. after RunAsEmulator on the storage resource.","commonSituations":"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.","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"],"exampleFix":"// before\nvar storage = builder.AddAzureStorage(\"storage\").RunAsEmulator();\nvar lake = storage.AddDataLakeStorage(\"lake\"); // throws when connection string resolved\n// after\nvar storage = builder.AddAzureStorage(\"storage\"); // real account; no RunAsEmulator\nvar lake = storage.AddDataLakeStorage(\"lake\");","handlingStrategy":"validation","validationCode":"if (storage.Resource.IsEmulator)\n    throw new InvalidOperationException(\"Data lake requires a real Azure Storage account; the emulator is in use.\");","typeGuard":null,"tryCatchPattern":"try { var cs = lake.GetConnectionString(); }\ncatch (InvalidOperationException) { // fall back to blob-only usage under emulator\n    useBlobOnly = true;\n}","preventionTips":["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"],"tags":["azure","storage","datalake","emulator","unsupported"],"backgroundTag":"unsupported-operation","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}