azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Browser Automation Tool Doesn't work with azure-ai-projects==2.0.0b2

Open kuljotSB opened this issue 3 weeks ago • 5 comments

  • Package Name: azure-ai-projects
  • Package Version: 2.0.0b2
  • Operating System: Windows
  • Python Version: 3.13.4

Describe the bug I have been trying out the new Microsoft Foundry expereince post Microsoft Ignite and was keen in trying out the browser automation capability. the agent gets created with the browser automation tool but doesnt execute both in code first environment and the foundry portal too.

This is how i have been using azure-ai-projects==2.0.0b2 to create agent with browser automation tool:

tool = BrowserAutomationAgentTool(
    browser_automation_preview=BrowserAutomationToolConnectionParameters(
        project_connection_id=connection_id
    )
)
agent = project_client.agents.create_version(
    agent_name = "browser-automation-agent",
    definition=PromptAgentDefinition(
        model=model_deployment_name,
        tools=[tool],
        instructions="You are a helpful assistant that can automate web browser tasks using the Browser Automation Tool.",
    )
)
response = openai_client.responses.create(
    conversation=conversation.id,
    extra_body = {
        "agent": {
            "name": "browser-automation-agent",
            "type": "agent_reference"
        }
    },
    input=user_query
)

print(f"Agent Response: {response.output_text}")

Unfortunately, after the agent run, I get this error: BadRequestError: Error code: 400 - {'error': {'message': "Invalid value: 'bro...iew'. Supported values are: 'code_interpreter', 'function', 'file_search', 'web_search_preview', 'web_search_preview_2025_03_11', 'image_generation', 'mcp', and 'computer_use_preview'.", 'type': 'invalid_request_error', 'param': 'tools[0].type', 'code': 'invalid_value'}}

Attaching a screenshot of the error in foundry portal too:

Image

Any help would be highly appreciated!

kuljotSB avatar Dec 01 '25 07:12 kuljotSB

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @dargilco @glharper @howieleung @kingernupur @nick863 @trangevi @trrwilson.

github-actions[bot] avatar Dec 01 '25 17:12 github-actions[bot]

@kuljotSB If tools are not configured with the proper objects and properties, you will get this error message. I know it is misleading and I have already notified the backend team.

    tool = BrowserAutomationAgentTool(
        browser_automation_preview=BrowserAutomationToolParameters(
            connection=BrowserAutomationToolConnectionParameters(
                project_connection_id=os.environ["BROWSER_AUTOMATION_PROJECT_CONNECTION_ID"],
            )
        )
    )

Please refer to the samples

https://github.com/Azure/azure-sdk-for-python/blob/main/sdk/ai/azure-ai-projects/samples/agents/tools/sample_agent_browser_automation.py

howieleung avatar Dec 05 '25 17:12 howieleung

@howieleung Thanks for the help....this works via code. But when you create an agent from the portal directly, there's still an issue - this is something you guys might wanna fix 😊 (wouldn't look great in demos otherwise)

kuljotSB avatar Dec 11 '25 05:12 kuljotSB

@kuljotSB Thanks for the update. I am not able to see issues on UI. I just created a browser automation tools on UI and use by agents. Works fine. There was a network issue because I just created the tool and not consumable at that moment. But it did work for me a minute later.

Image

My guess is, you created the browser automation tool inappropriately by code above and then try to use it on UI. But if you can't use a browser automation tool created by UI. Let me know.

howieleung avatar Dec 11 '25 20:12 howieleung

@howieleung I tried the tool again via the GUI and it works after some time for the changes to take into effect. So it definitely works (although not immediately).

kuljotSB avatar Dec 12 '25 03:12 kuljotSB

Thanks for confirm. I will mark the case resolved.

howieleung avatar Dec 15 '25 18:12 howieleung

Hi @kuljotSB. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text "/unresolve" to remove the "issue-addressed" label and continue the conversation.

github-actions[bot] avatar Dec 15 '25 18:12 github-actions[bot]