{"record":{"id":"ce1f4790914a66bb","repo":"microsoft/aspire","slug":"the-connection-string-connectionname-does-not-exist-or-is-ce1f47","errorCode":null,"errorMessage":"The connection string '{connectionName}' does not exist or is missing the file system name.","messagePattern":"The connection string '(.+?)' does not exist or is missing the file system name\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Aspire.Azure.Storage.Files.DataLake/AspireDataLakeExtensions.DataLakeFileSystemComponent.cs","lineNumber":31,"sourceCode":"namespace Microsoft.Extensions.Hosting;\n\npublic static partial class AspireDataLakeExtensions\n{\n    private sealed class DataLakeFileSystemComponent\n        : AzureComponent<AzureDataLakeFileSystemSettings, DataLakeFileSystemClient, DataLakeClientOptions>\n    {\n        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;","sourceCodeStart":13,"sourceCodeEnd":49,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Components/Aspire.Azure.Storage.Files.DataLake/AspireDataLakeExtensions.DataLakeFileSystemComponent.cs#L13-L49","documentation":"Aspire's DataLakeFileSystemClient component throws this when settings.FileSystemName is null or empty. A file-system-scoped client must know which file system (container in ADLS terms) to target; the library validates this before constructing the client.","triggerScenarios":"Calling builder.AddAzureDataLakeFileSystemClient(...) where the config section lacks FileSystemName and no configureSettings callback supplied it.","commonSituations":"File system declared in the AppHost but name not propagated to the consuming project; appsettings missing the FileSystemName key; renamed resource not reflected in config.","solutions":["Set \"Aspire:Azure:Storage:Files:DataLake\": { \"FileSystemName\": \"myfs\" } in appsettings","Pass in code: .AddAzureDataLakeFileSystemClient(\"datalake\", s => s.FileSystemName = \"myfs\")","Ensure the file system resource exists in the AppHost: dataLake.AddFileSystem(\"myfs\")"],"exampleFix":"// before\nbuilder.AddAzureDataLakeFileSystemClient(\"datalake\"); // FileSystemName missing\n// after\nbuilder.AddAzureDataLakeFileSystemClient(\"datalake\", s => s.FileSystemName = \"myfs\");","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(builder.Configuration[\"Aspire:Azure:Storage:Files:DataLake:FileSystemName\"]))\n    throw new InvalidOperationException(\"FileSystemName must be set before adding the file system client.\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set FileSystemName via config or configureSettings","Create the file system resource in the AppHost with the same name","Add startup validation for ADLS keys"],"tags":["azure","data-lake","configuration","filesystem"],"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-21T09:17:21.228Z"}