Skip to content

WebSearchAgent chat fails: 'Azure credential is required when agents_client is not provided' #441

@Menghua1

Description

@Menghua1

Description:
After deploying WebSearchAgent, chatting in the Agent Playground on the Foundry Portal fails with the error:
"Error Azure credential is required when agents_client is not provided."
Image

In addition, running Pytest also fails with the error "ID cannot be null or empty (Parameter 'id')", as shown below:
Image

Steps to Reproduce:

  1. Initialize the project: azd init --template Azure-Samples/ai-foundry-starter-basic.
  2. Initialize AI agent: azd ai agent init -m https://github.com/azure-ai-foundry/foundry-samples/blob/main/samples/python/hosted-agents/web-search-agent/agent.yaml and select location northcentralus.
  3. Run azd up.
  4. Navigate to agent playground on the Foundry Portal and enter "Can you search for the latest news about AI?" in the chat.
  5. For pytest, copy the folder tests to the root directory.
  6. Create a new .env file and add the following content.
AZURE_AI_PROJECT_ENDPOINT=""https://ai-account-bvmg7v2ge46ec.services.ai.azure.com/api/projects/ai-project-mhweb2""
AGENT_VERSION=1
AGENT_TEST_MESSAGE="Can you search for the latest news about AI?"
AGENT_KIND=hosted
AGENT_NAME="WebSearchAgent"
  1. Run cd tests and pytest test_agent.py -v -s.

Environment:

  • Azd version: azd version 1.23.0-beta.1-daily.5672449 (commit 396ced2ad56e83f813810d14ab709a4035ee1629).
  • AI Agent Extension version: 0.1.4-preview
  • Agent: web-search-agent
  • OS: Windows
  • Location: northcentralus.

Expected Behavior:
Chatting is successful on the agent playground, and pytest also works successfully.

@JeffreyCA and @rajeshkamal5050 for notification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions