{"record":{"id":"e5c44d113bf4205c","repo":"microsoft/aspire","slug":"the-connection-string-connectionname-does-not-exist-or-is-e5c44d","errorCode":null,"errorMessage":"The connection string '{connectionName}' does not exist or is missing the queue name.","messagePattern":"The connection string '(.+?)' does not exist or is missing the queue name\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Aspire.Azure.Storage.Queues/AspireQueueStorageExtensions.cs","lineNumber":240,"sourceCode":"            => settings.Credential;\n\n        protected override bool GetMetricsEnabled(AzureStorageQueuesSettings settings)\n            => false;\n\n        protected override bool GetTracingEnabled(AzureStorageQueuesSettings settings)\n            => !settings.DisableTracing;\n    }\n\n    private sealed partial class StorageQueueComponent : AzureComponent<AzureStorageQueueSettings, QueueClient, QueueClientOptions>\n    {\n        protected override IAzureClientBuilder<QueueClient, QueueClientOptions> AddClient(\n            AzureClientFactoryBuilder azureFactoryBuilder, AzureStorageQueueSettings settings, string connectionName, string configurationSectionName)\n        {\n            return ((IAzureClientFactoryBuilderWithCredential)azureFactoryBuilder).RegisterClientFactory<QueueClient, QueueClientOptions>((options, cred) =>\n            {\n                if (string.IsNullOrEmpty(settings.QueueName))\n                {\n                    throw new InvalidOperationException($\"The connection string '{connectionName}' does not exist or is missing the queue name.\");\n                }\n\n                var connectionString = settings.ConnectionString;\n                if (string.IsNullOrEmpty(connectionString) && settings.ServiceUri is null)\n                {\n                    throw new InvalidOperationException($\"A QueueClient 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 queueServiceClient = !string.IsNullOrEmpty(connectionString) ? new QueueServiceClient(connectionString, options) :\n                    cred is not null ? new QueueServiceClient(settings.ServiceUri, cred, options) :\n                    new QueueServiceClient(settings.ServiceUri, options);\n\n                var client = queueServiceClient.GetQueueClient(settings.QueueName);\n                return client;\n            }, requiresCredential: false);\n        }\n\n        protected override void BindClientOptionsToConfiguration(IAzureClientBuilder<QueueClient, QueueClientOptions> clientBuilder, IConfiguration configuration)","sourceCodeStart":222,"sourceCodeEnd":258,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Components/Aspire.Azure.Storage.Queues/AspireQueueStorageExtensions.cs#L222-L258","documentation":"The QueueClient overload requires a queue name in addition to connection information. Aspire throws this when settings.QueueName is empty, meaning the connection string (if it exists) did not supply a queue name and no queue name was configured.","triggerScenarios":"Calling AddAzureQueueClient where the 'ConnectionStrings:{connectionName}' value is missing entirely, or present but lacking a 'QueueName' component, and settings.QueueName was not set via configuration or the configureSettings callback.","commonSituations":"Connection string in config contains only the account endpoint without the queue path (e.g. a plain service URI instead of a full queue URL); developer used the QueueServiceClient connection string with the QueueClient API; QueueName key misspelled in config section.","solutions":["Ensure the connection string includes the queue name, e.g. a full queue URL 'https://account.queue.core.windows.net/myqueue' or set 'QueueName' in the 'Aspire:Azure:Storage:Queues:{connectionName}' config section.","Set the queue name explicitly via the configureSettings callback: settings.QueueName = \"myqueue\".","Confirm the connection named '{connectionName}' actually exists under ConnectionStrings.","If you don't have a specific queue, use AddAzureQueues (QueueServiceClient) instead of AddAzureQueueClient."],"exampleFix":"// before\nbuilder.AddAzureQueueClient(\"queues\"); // ConnectionStrings:queues = \"https://acct.queue.core.windows.net/\"\n// after\n// ConnectionStrings:queues = \"https://acct.queue.core.windows.net/myqueue\"\n// or in appsettings: \"Aspire:Azure:Storage:Queues:queues\": { \"QueueName\": \"myqueue\" }\nbuilder.AddAzureQueueClient(\"queues\");","handlingStrategy":"validation","validationCode":"var settings = builder.Configuration.GetSection(\"Aspire:Azure:Storage:Queues\");\nvar cs = builder.Configuration.GetConnectionString(\"queues\");\nvar queueName = settings[\"QueueName\"] ?? (cs?.Contains(\"myqueue\") == true ? \"myqueue\" : null);\nif (string.IsNullOrEmpty(queueName))\n    throw new InvalidOperationException(\"QueueClient requires a queue name; set QueueName in config or use a full queue URL connection string.\");","typeGuard":null,"tryCatchPattern":"try { queueClient.SendMessageAsync(\"ping\"); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"missing the queue name\"))\n{\n    logger.LogError(ex, \"Queue name missing for connection 'queues'.\");\n    throw;\n}","preventionTips":["Use full queue URL connection strings (https://acct.queue.core.windows.net/myqueue) for AddAzureQueueClient.","Prefer AddAzureQueues when you need account-level access rather than a single queue.","Document required config keys per component in your service template.","Validate QueueName presence in integration tests before first send/receive."],"tags":["azure","configuration","connection-string","queue"],"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"}