{"record":{"id":"132a5eefe998d0ac","repo":"microsoft/aspire","slug":"a-datalakeserviceclient-could-not-be-configured-ensure-valid-132a5e","errorCode":null,"errorMessage":"A DataLakeServiceClient could not be configured. Ensure valid connection information was provided in 'ConnectionStrings:{connectionName}' or specify a 'ConnectionString' or 'ServiceUri' in the '{configurationSectionName}' configuration section.","messagePattern":"A DataLakeServiceClient could not be configured\\. Ensure valid connection information was provided in 'ConnectionStrings:(.+?)' or specify a 'ConnectionString' or 'ServiceUri' in the '(.+?)' configuration section\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Aspire.Azure.Storage.Files.DataLake/AspireDataLakeExtensions.DataLakeFileSystemComponent.cs","lineNumber":38,"sourceCode":"        protected override IAzureClientBuilder<DataLakeFileSystemClient, DataLakeClientOptions> AddClient(\n            AzureClientFactoryBuilder azureFactoryBuilder,\n            AzureDataLakeFileSystemSettings settings,\n            string connectionName,\n            string configurationSectionName)\n            => ((IAzureClientFactoryBuilderWithCredential)azureFactoryBuilder)\n                .RegisterClientFactory<DataLakeFileSystemClient, DataLakeClientOptions>(\n                    (options, cred) =>\n                    {\n                        if (string.IsNullOrEmpty(settings.FileSystemName))\n                        {\n                            throw new InvalidOperationException(\n                                $\"The connection string '{connectionName}' does not exist or is missing the file system name.\");\n                        }\n\n                        var connectionString = settings.ConnectionString;\n                        if (string.IsNullOrEmpty(connectionString) && settings.ServiceUri is null)\n                        {\n                            throw new InvalidOperationException(\n                                $\"A DataLakeServiceClient could not be configured. Ensure valid connection information was provided in 'ConnectionStrings:{connectionName}' or specify a 'ConnectionString' or 'ServiceUri' in the '{configurationSectionName}' configuration section.\");\n                        }\n\n                        var dataLakeServiceClient = !string.IsNullOrEmpty(connectionString) ?\n                            new DataLakeServiceClient(connectionString, options) :\n                            cred is not null ? new DataLakeServiceClient(settings.ServiceUri, cred, options) :\n                                new DataLakeServiceClient(settings.ServiceUri, options);\n\n                        var fileSystemClient = dataLakeServiceClient.GetFileSystemClient(settings.FileSystemName);\n\n                        return fileSystemClient;\n                    },\n                    requiresCredential: false);\n\n        protected override bool GetHealthCheckEnabled(AzureDataLakeFileSystemSettings settings)\n            => !settings.DisableHealthChecks;\n\n        protected override bool GetMetricsEnabled(AzureDataLakeFileSystemSettings settings) => false;","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Components/Aspire.Azure.Storage.Files.DataLake/AspireDataLakeExtensions.DataLakeFileSystemComponent.cs#L20-L56","documentation":"Same validation family as the DataLakeServiceClient error: the DataLakeFileSystemComponent builds an underlying DataLakeServiceClient after checking FileSystemName, and throws when neither ConnectionString nor ServiceUri is configured, since the parent client cannot be created without connection info.","triggerScenarios":"Calling AddAzureDataLakeFileSystemClient with FileSystemName set but no 'ConnectionStrings:<connectionName>' entry and no ConnectionString/ServiceUri in 'Aspire:Azure:Storage:Files:DataLake'.","commonSituations":"File system name configured but connection info absent; missing WithReference wiring so no connection string injected; connection string renamed or removed.","solutions":["Add \"ConnectionStrings\": { \"<connectionName>\": \"https://<account>.dfs.core.windows.net/\" }","Set \"ServiceUri\" in the Aspire:Azure:Storage:Files:DataLake section","Add .WithReference(adls) in the AppHost so connection info is injected","Confirm the connectionName argument matches the ConnectionStrings key"],"exampleFix":"// before\n\"Aspire:Azure:Storage:Files:DataLake\": { \"FileSystemName\": \"myfs\" } // no connection info\n// after\n\"ConnectionStrings\": { \"datalake\": \"https://acct.dfs.core.windows.net/\" },\n\"Aspire:Azure:Storage:Files:DataLake\": { \"FileSystemName\": \"myfs\" }","handlingStrategy":"validation","validationCode":"if (builder.Configuration.GetConnectionString(connectionName) is null &&\n    builder.Configuration[\"Aspire:Azure:Storage:Files:DataLake:ServiceUri\"] is null)\n    throw new InvalidOperationException(\"Provide connection info before adding the Data Lake file system client.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure FileSystemName and connection info as a pair","Ensure WithReference wiring injects the connection string","Run a fail-fast config check before building clients"],"tags":["azure","data-lake","configuration","connection-string"],"backgroundTag":"missing-required-config-field","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"}