nopSolutions/nopCommerce · error · Exception

Azure connection string for Blob is not specified

Error message

Azure connection string for Blob is not specified

What it means

Thrown by AzureThumbService.Init when AzureBlobSettings.ConnectionString is null or empty. Init is the lazy initializer for the blob container; it checks configuration before creating BlobServiceClient. Nothing is initialized when this throws.

Source

Thrown at src/Plugins/Nop.Plugin.Misc.AzureBlob/Services/AzureThumbService.cs:57

        _azureBlobSettings = azureBlobSettings;
        _fileProvider = fileProvider;
        _staticCacheManager = staticCacheManager;
    }

    #endregion

    #region Utilities

    /// <summary>
    /// Initialize cloud container
    /// </summary>
    private void Init()
    {
        if (_isInitialized)
            return;

        if (string.IsNullOrEmpty(_azureBlobSettings.ConnectionString))
            throw new Exception("Azure connection string for Blob is not specified");

        if (string.IsNullOrEmpty(_azureBlobSettings.ContainerName))
            throw new Exception("Azure container name for Blob is not specified");

        if (string.IsNullOrEmpty(_azureBlobSettings.EndPoint))
            throw new Exception("Azure end point for Blob is not specified");

        lock (_locker)
        {
            if (_isInitialized)
                return;

            _azureBlobStorageAppendContainerName = _azureBlobSettings.AppendContainerName;
            _azureBlobStorageConnectionString = _azureBlobSettings.ConnectionString;
            _azureBlobStorageContainerName = _azureBlobSettings.ContainerName.Trim().ToLowerInvariant();
            _azureBlobStorageEndPoint = _azureBlobSettings.EndPoint.Trim().ToLowerInvariant().TrimEnd('/');

            _blobServiceClient = new BlobServiceClient(_azureBlobStorageConnectionString);

View on GitHub (pinned to 64bdf2ff08)

Solutions

  1. Open the Azure Blob plugin configuration and paste a valid storage account connection string (from Azure Portal > Storage account > Access keys), then save.
  2. Ensure the setting is saved for the correct store scope in multi-store setups.
  3. Verify the connection string is not whitespace-only (it must pass !string.IsNullOrEmpty).

Example fix

// before: ConnectionString = ""
// after (Azure Portal value):
settings.ConnectionString = "DefaultEndpointsProtocol=https;AccountName=mystore;AccountKey=<key>;EndpointSuffix=core.windows.net";
await _settingService.SaveSettingAsync(settings, storeScope);
Defensive patterns

Strategy: validation

Validate before calling

if (string.IsNullOrEmpty(_azureBlobSettings.ConnectionString))
    throw new InvalidOperationException("Configure the Azure Blob connection string before use.");

Type guard

static bool IsAzureBlobConfigured(AzureBlobSettings s) =>
    !string.IsNullOrEmpty(s.ConnectionString)
    && !string.IsNullOrEmpty(s.ContainerName)
    && !string.IsNullOrEmpty(s.EndPoint);

Try / catch

try { _azureThumbService.GetThumbUrl(...); }
catch (Exception ex) when (ex.Message.Contains("connection string for Blob"))
{ logger.Error("Azure Blob not configured: connection string missing.", ex); }

Prevention

When it happens

Trigger: The Azure Blob plugin is installed/enabled but no connection string was saved in its configuration. Init runs on first use of the thumb/picture service backed by Azure.

Common situations: Plugin enabled without configuration; connection string cleared; settings saved against a different store scope so the active store sees an empty value.

Related errors


AI-assisted analysis of nopSolutions/nopCommerce@64bdf2ff08 (2026-08-13). Data as JSON: /api/errors/d706921bc302a6b5. Report an issue: GitHub.