microsoft/semantic-kernel · error · ArgumentException

The option key '{bindingType}.queue_name' is required.

Error message

The option key '{bindingType}.queue_name' is required.

What it means

Thrown by GetAzureFunctionBinding after storage_service_endpoint has been validated. The same binding dictionary must also contain a 'queue_name' key whose value is a string; otherwise ArgumentException is thrown. The queue name is the Storage queue the function binding reads from.

Source

Thrown at dotnet/src/Agents/AzureAI/Extensions/AgentToolDefinitionExtensions.cs:185

                configurations.Add(new VectorStoreConfigurations(storeName, new VectorStoreConfiguration(dataSources)));
            }
        }

        return configurations;
    }

    private static AzureFunctionBinding GetAzureFunctionBinding(this AgentToolDefinition agentToolDefinition, string bindingType)
    {
        Verify.NotNull(agentToolDefinition.Options);

        var binding = agentToolDefinition.GetRequiredOption<Dictionary<object, object>>(bindingType);
        if (!binding.TryGetValue("storage_service_endpoint", out var endpointValue) || endpointValue is not string storageServiceEndpoint)
        {
            throw new ArgumentException($"The option key '{bindingType}.storage_service_endpoint' is required.");
        }
        if (!binding.TryGetValue("queue_name", out var nameValue) || nameValue is not string queueName)
        {
            throw new ArgumentException($"The option key '{bindingType}.queue_name' is required.");
        }

        return new AzureFunctionBinding(new AzureFunctionStorageQueue(storageServiceEndpoint, queueName));
    }

    internal static int? GetTopK(this AgentToolDefinition agentToolDefinition)
    {
        return agentToolDefinition.Options?.TryGetValue("top_k", out var topKValue) ?? false
            ? int.Parse((string)topKValue!)
            : null;
    }

    internal static string? GetFilter(this AgentToolDefinition agentToolDefinition)
    {
        return agentToolDefinition.Options?.TryGetValue("filter", out var filterValue) ?? false
            ? filterValue as string
            : null;
    }

View on GitHub (pinned to c028a0c7dc)

Solutions

  1. Add 'queue_name' (string) under the binding-type key in the tool options.
  2. Ensure it matches an existing Storage queue.

Example fix

// before
storage_queue:
  storage_service_endpoint: https://mystorage.queue.core.windows.net
  # queue_name missing -> throws 166

// after
storage_queue:
  storage_service_endpoint: https://mystorage.queue.core.windows.net
  queue_name: myqueue
Defensive patterns

Strategy: validation

Validate before calling

var binding = tool.GetRequiredOption<Dictionary<object, object>>(bindingType);
if (!binding.TryGetValue("queue_name", out var q) || q is not string)
    throw new ArgumentException($"{bindingType}.queue_name (string) is required.");

Type guard

static bool HasQueueName(Dictionary<object, object> b) =>
    b.TryGetValue("queue_name", out var q) && q is string s && !string.IsNullOrEmpty(s);

Prevention

When it happens

Trigger: An Azure Function tool binding option dictionary has storage_service_endpoint but is missing 'queue_name', or queue_name is non-string.

Common situations: YAML template includes endpoint but omits queue_name; typo 'queuename'.

Related errors


AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13). Data as JSON: /api/errors/a32d1b2163273806. Report an issue: GitHub.