{"record":{"id":"e5f3bc3f581da1c6","repo":"microsoft/aspire","slug":"the-configured-container-name-of-settings-blobcontainername","errorCode":null,"errorMessage":"The configured container name of '{settings.BlobContainerName}' does not exist, so an attempt was made to create it automatically and this operation failed. Please ensure the container exists and is specified in the connection string, or if you have provided a BlobContainerName in settings, please ensure it exists. If you don't supply a container name, Aspire will attempt to create one with the name 'namespace-hub-consumergroup'.","messagePattern":"The configured container name of '(.+?)' does not exist, so an attempt was made to create it automatically and this operation failed\\. Please ensure the container exists and is specified in the connection string, or if you have provided a BlobContainerName in settings, please ensure it exists\\. If you don't supply a container name, Aspire will attempt to create one with the name 'namespace-hub-consumergroup'\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Components/Aspire.Azure.Messaging.EventHubs/EventProcessorClientComponent.cs","lineNumber":120,"sourceCode":"        {\n            // If not, we'll create a container name based on the namespace, event hub name and consumer group\n            var ns = GetNamespaceFromSettings(settings);\n\n            settings.BlobContainerName = $\"{ns}-{settings.EventHubName}-{consumerGroup}\";\n            shouldTryCreateIfNotExists = true;\n        }\n\n        var containerClient = blobClient.GetBlobContainerClient(settings.BlobContainerName);\n\n        if (shouldTryCreateIfNotExists)\n        {\n            try\n            {\n                containerClient.CreateIfNotExists();\n            }\n            catch (RequestFailedException ex)\n            {\n                throw new InvalidOperationException(\n                    $\"The configured container name of '{settings.BlobContainerName}' does not exist, \" +\n                    \"so an attempt was made to create it automatically and this operation failed. Please ensure the container \" +\n                    \"exists and is specified in the connection string, or if you have provided a BlobContainerName in settings, please \" +\n                    \"ensure it exists. If you don't supply a container name, Aspire will attempt to create one with the name 'namespace-hub-consumergroup'.\",\n                    ex);\n            }\n        }\n\n        return containerClient;\n    }\n}\n","sourceCodeStart":102,"sourceCodeEnd":132,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Components/Aspire.Azure.Messaging.EventHubs/EventProcessorClientComponent.cs#L102-L132","documentation":"Aspire auto-creates the checkpoint blob container via containerClient.CreateIfNotExists() when processing checkpoints with EventProcessorClient. If the Azure Storage service returns a RequestFailedException (container name invalid, storage account unreachable, auth failure), Aspire wraps it in this InvalidOperationException explaining that the configured container name doesn't exist and automatic creation failed.","triggerScenarios":"GetBlobContainerClient's call to containerClient.CreateIfNotExists() throwing RequestFailedException — e.g. container name violates naming rules, storage account/connection string invalid, no network access, or insufficient permissions (no 'Microsoft.Storage/storageAccounts/blobServices/containers/write').","commonSituations":"BlobContainerName set with uppercase characters or invalid characters (container names must be lowercase alphanumeric plus hyphen, 3-63 chars); storage emulator (Azurite) not running; firewall blocking storage account; SAS/account key lacking create permission; private endpoint DNS failures.","solutions":["Create the blob container manually in the storage account (portal/CLI/Storage Explorer) so CreateIfNotExists only needs read access.","Verify BlobContainerName is valid: lowercase, 3-63 characters, letters/digits/hyphens only.","Check the BlobServiceClient's credentials/connection target — confirm the storage account exists, is reachable, and the credential has write permission.","Inspect the inner RequestFailedException for the actual storage error code (AuthorizationFailure, AccountNotFound, etc.) and fix that root cause.","If auto-create is undesired in production, pre-provision the container via IaC (Bicep/Terraform)."],"exampleFix":"// before\nsettings.BlobContainerName = \"Checkpoints\"; // uppercase — invalid container name, create fails\n// after\nsettings.BlobContainerName = \"checkpoints\"; // valid, or pre-create container and grant read access","handlingStrategy":"try-catch","validationCode":"// Validate container name format before wiring (lowercase, 3-63 chars, a-z0-9-hyphen)\nif (settings.BlobContainerName is not null &&\n    !System.Text.RegularExpressions.Regex.IsMatch(settings.BlobContainerName, \"^[a-z0-9][a-z0-9-]{1,61}[a-z0-9]$\"))\n    throw new ArgumentException(\"Invalid blob container name.\");","typeGuard":null,"tryCatchPattern":"try { await processor.StartProcessingAsync(); } catch (InvalidOperationException ex) when (ex.InnerException is RequestFailedException rf) { logger.LogError(rf, \"Blob container create failed: {Code}\", rf.ErrorCode); throw; }","preventionTips":["Pre-provision the checkpoint container via IaC and grant only read/list to the app","Enforce lowercase container names in code review or an options validator","Verify storage account network rules/firewall allow your app in each environment","Check the inner RequestFailedException ErrorCode to distinguish permissions vs connectivity","Ensure Azurite is running when using the emulator locally"],"tags":["azure","event-hubs","blob-storage","network","permissions"],"backgroundTag":"http-error-response","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"}