Skip to content

Misleading 'missing required parameters' error when authentication fails #1463

@sperazza

Description

@sperazza

Description

When authentication fails in the Azure MCP, Service Bus commands return a misleading error message stating "missing required parameters" even when all required parameters are correctly provided. This makes debugging authentication issues very difficult.

Version

  • @azure/mcp@2.0.0-beta.9

Steps to Reproduce

  1. Configure Azure MCP without proper credential configuration (e.g., when DefaultAzureCredential picks up wrong tenant)
  2. Call any Service Bus command with all required parameters:
command: "servicebus_topic_details"
parameters: {
  "namespace": "mynamespace.servicebus.windows.net",
  "topic": "my-topic"
}

Expected Behavior

Should return a clear authentication error like:

  • "Authentication failed: wrong tenant"
  • "InvalidAuthenticationTokenTenant: The access token is from the wrong issuer"

Actual Behavior

Returns:

The 'servicebus_topic_details' command is missing required parameters.

This is confusing because all required parameters ARE provided.

Root Cause

The actual issue was DefaultAzureCredential picking up credentials from a different Azure tenant. The fix was setting AZURE_TOKEN_CREDENTIALS=azureclicredential to force use of Azure CLI credentials.

Impact

Suggestion

Improve error handling to:

  1. Catch authentication failures and return clear auth error messages
  2. Only return "missing parameters" when parameters are actually missing
  3. Include the underlying error details when available

Workaround

Set environment variable: AZURE_TOKEN_CREDENTIALS=azureclicredential

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status

Not Started

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions