{"record":{"id":"fd1500abc6dfa2a4","repo":"nopSolutions/nopCommerce","slug":"azure-container-name-for-blob-is-not-specified","errorCode":null,"errorMessage":"Azure container name for Blob is not specified","messagePattern":"Azure container name for Blob is not specified","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Plugins/Nop.Plugin.Misc.AzureBlob/Services/AzureThumbService.cs","lineNumber":60,"sourceCode":"    }\n\n    #endregion\n\n    #region Utilities\n\n    /// <summary>\n    /// Initialize cloud container\n    /// </summary>\n    private void Init()\n    {\n        if (_isInitialized)\n            return;\n\n        if (string.IsNullOrEmpty(_azureBlobSettings.ConnectionString))\n            throw new Exception(\"Azure connection string for Blob is not specified\");\n\n        if (string.IsNullOrEmpty(_azureBlobSettings.ContainerName))\n            throw new Exception(\"Azure container name for Blob is not specified\");\n\n        if (string.IsNullOrEmpty(_azureBlobSettings.EndPoint))\n            throw new Exception(\"Azure end point for Blob is not specified\");\n\n        lock (_locker)\n        {\n            if (_isInitialized)\n                return;\n\n            _azureBlobStorageAppendContainerName = _azureBlobSettings.AppendContainerName;\n            _azureBlobStorageConnectionString = _azureBlobSettings.ConnectionString;\n            _azureBlobStorageContainerName = _azureBlobSettings.ContainerName.Trim().ToLowerInvariant();\n            _azureBlobStorageEndPoint = _azureBlobSettings.EndPoint.Trim().ToLowerInvariant().TrimEnd('/');\n\n            _blobServiceClient = new BlobServiceClient(_azureBlobStorageConnectionString);\n            _blobContainerClient = _blobServiceClient.GetBlobContainerClient(_azureBlobStorageContainerName);\n\n            _blobContainerClient.CreateIfNotExistsAsync(PublicAccessType.Blob).Wait();","sourceCodeStart":42,"sourceCodeEnd":78,"githubUrl":"https://github.com/nopSolutions/nopCommerce/blob/64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2/src/Plugins/Nop.Plugin.Misc.AzureBlob/Services/AzureThumbService.cs#L42-L78","documentation":"Thrown by AzureThumbService.Init when AzureBlobSettings.ContainerName is null or empty. It is checked immediately after the connection string, before the container client is created.","triggerScenarios":"The Azure Blob plugin is configured with a connection string but the container name field was left blank. Init runs on first picture/thumb operation routed to the Azure service.","commonSituations":"Admin saved only the connection string; container name typed with only spaces; settings saved to the wrong store scope.","solutions":["Enter the blob container name in the plugin configuration and save (the container must exist in the storage account).","Confirm the container name uses valid Azure naming (lowercase, etc.) — the code later does .Trim().ToLowerInvariant().","Save settings for the correct store scope."],"exampleFix":"// before: ContainerName = \"\"\n// after:\nsettings.ContainerName = \"media\"; // existing container in the storage account\nawait _settingService.SaveSettingAsync(settings, storeScope);","handlingStrategy":"validation","validationCode":"if (string.IsNullOrEmpty(_azureBlobSettings.ContainerName))\n    throw new InvalidOperationException(\"Configure the Azure Blob container name before use.\");","typeGuard":"static bool HasContainerName(AzureBlobSettings s) => !string.IsNullOrWhiteSpace(s.ContainerName);","tryCatchPattern":"try { _azureThumbService.GetThumbUrl(...); }\ncatch (Exception ex) when (ex.Message.Contains(\"container name for Blob\"))\n{ logger.Error(\"Azure Blob container name missing.\", ex); }","preventionTips":["Validate all three Azure settings together on save.","Create the container in Azure before referencing it.","Use lowercase container names per Azure rules."],"tags":["azure","plugins","blob-storage","config","media"],"backgroundTag":null,"analyzedSha":"64bdf2ff08c8b39e65717bcf974fb43dc2ef68f2","analyzedAt":"2026-08-13T21:19:38.062Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}