This sample demonstrates how to build an AI-powered web browsing agent that can be integrated into Microsoft Teams. The agent can perform web browsing tasks on behalf of users, providing real-time visual feedback and interactive responses. It uses Browser-Use to navigate the web.
Check out the LinkedIn post for a video of the sample in action.
- 🌐 Autonomous Web Navigation: Uses AI to understand and execute web browsing tasks
- 📸 Real-time Visual Feedback: Shows screenshots of browsing progress via adaptive cards in Adaptive Cards
- 🔄 Interruptable: Allows users to stop the browsing session at any time
- 🚢 Dockerized: Docker file ready to be deployed to an Azure App Service
- Teams Toolkit CLI
- uv
- Open AI or Azure Open AI keys
- Run
uv sync
in this folder. - Activate the virtual environment (run
source .venv/bin/activate
in the root folder or.venv\Scripts\activate
in the root folder if on Windows) - Run
playwright install
to install the browser - Copy the samples.env file and rename it to .env
- Update the .env file with your own values. You only really need to update either Azure Open AI or Open AI values.
- Use Teams-Toolkit to run the app locally - Check out these on how to run the sample using teams-toolkit.
- Open a 1:1 chat with the agent or include it in a group chat.
- Send the agent a query, e.g. "What is the weather in Tokyo?" or "What are the latest headlines?"
- The agent will navigate to the web, take screenshots and display them in adaptive cards.
- Once the agent finishes, it will display the results in a different adaptive card.
There is a Dockerfile in the root of this repo. You can use this to build a container and deploy it to Azure App Service or a local Docker container. The azure.bicep files have been updated to use Azure Container Registry.
If you want to avoid downloading playwright dependencies, you can run the app in Docker locally. As expected, this requires you to have Docker installed. You'll also need to have Teams Toolkit installed which will help us with the provisioning and deployment of the bot. Teams Toolkit isn't built to run Docker, so we'll need to do this manually. Roughly, this translates to the following steps:
- Provision the bot manually (if you've already done this using Teams Toolkit, then you can skip this step)
- Set up a devtunnel to expose the app to the internet (See Setting up dev tunnels for more details)
- Run the tunnel with
devtunnel host <tunnel-name>
- Go to
.env.local
and set theBOT_ENDPOINT
to the URL of your tunnel, andBOT_DOMAIN
to the domain of your tunnel (without the https://). - Provision the bot by either:
- Running
teamsapp provision --env=local
, or - Using the Teams Toolkit extension
- Deploy the bot by either:
- Running
teamsapp deploy --env=local
, or - Using the Teams Toolkit extension
- Build the Docker image
- Run
docker build -t web-browsing-agent .
- Run
- Run the Docker container
- Run
docker run -p 3978:3978 --env-file .env web-browsing-agent
- Run
- Now build the app package (
teamsapp package --env local
) This will show up in theappPackage
folder - Now upload the app package to Teams. See instructions
- Make sure devtunnel is installed.
- Run
devtunnel create <tunnel-name>
to create a new tunnel. - Run
devtunnel port create <tunnel-name> -p <port-number>
to create a new port for the tunnel. - Run
devtunnel access create <tunnel-name> -p <port-number> --anonymous
to set up anonymous access to the tunnel.