Playwright Workspaces, part of Azure App Testing, enables teams to run Playwright tests on cloud-hosted browsers without managing test infrastructure. This Azure-native capability allows you to execute large-scale UI and API tests while integrating with your Azure subscription, security, and governance model. This post walks through setting up a Playwright Workspace in Azure, configuring your Playwright project, and running tests on remote browsers using Visual Studio or VS Code.
Overview
End‑to‑end testing at scale is a common challenge when teams need reliable, cross‑browser validation without managing infrastructure. Azure Playwright Testing Service (Preview) simplifies this by allowing you to run Playwright tests on cloud-hosted browsers directly from your local setup.
In this post, I’ll walk through how to:
- Set up Azure Playwright Testing Service
- Configure your Playwright project
- Run UI and API tests on remote browsers
- View execution logs, HTML reports, and traces
This guide uses Playwright with TypeScript in Visual Studio / VS Code and is based on hands‑on setup steps.
Understanding Playwright Workspaces
Playwright Workspaces is an Azure App Testing capability that provides cloud execution environments for Playwright tests. The entire experience is managed through the Azure Portal, where you create and manage workspace resources, monitor test runs, and access reports.
Important: Playwright Workspaces is different from Microsoft Playwright Testing, which is a standalone offering with its own portal. This guide focuses specifically on the Azure-based Playwright Workspaces experience.
Prerequisites
Before you begin, ensure you have:
- An active Azure subscription
- Node.js installed
- A Playwright project using TypeScript
- Visual Studio or Visual Studio Code
Step 1: Create a Playwright Workspace in Azure
- Sign in to the Azure Portal
- Navigate to Azure App Testing
- Select Playwright Workspaces
- Click Create
- Choose your subscription, resource group, and region
- Create the workspace resource
This workspace acts as the cloud execution environment for your Playwright tests.
Step 2: Create a Playwright Project Locally
Create a Playwright project in Visual Studio or VS Code and add your test cases under the tests folder.
Example structure:
tests/
└── example.spec.ts
Your Playwright tests will be executed from this project using Azure-hosted browsers.
Step 3: Add Playwright Service Configuration
- Open your Playwright Workspace resource in Azure Portal
- In the workspace setup section, download the service configuration file
- Add the file (playwright.service.config.ts) to your project
- Place it alongside your playwright.config.ts
This configuration connects your local Playwright tests to the Azure-hosted browser infrastructure.
Step 4: Generate Access Token and Service URL
Within the Playwright Testing portal:
- Generate a new access token
- Copy:
- Access Token
- Region-specific Service URL
Step 5: Configure Environment Variables
Create a .env file in the same folder as your config files and add:
PLAYWRIGHT_SERVICE_ACCESS_TOKEN={YOUR_ACCESS_TOKEN} PLAYWRIGHT_SERVICE_URL={YOUR_REGION_ENDPOINT}
These values authenticate your test runs with Azure Playwright Testing Service.
Step 6: Install Playwright VS Code Extension (Optional)
For an improved developer experience, install the Playwright Test extension:
- https://marketplace.visualstudio.com/items?itemName=ms-playwright.playwright
Step 7: Run Tests on Remote Browsers
Open a terminal and run:
To execute a specific test file:
npx playwright test example.spec.ts --config=playwright.service.config.ts
To execute the entire test suite in parallel:
npx playwright test --config=playwright.service.config.ts --workers=20
To open the latest HTML report:
npx playwright show-report
Step 8: Monitor Test Execution in Azure Portal
Return to the Azure Portal → Playwright Workspace resource to monitor your test runs.
Within the workspace, you can view:
- Test cases executed
- Test suite runtime
- Execution distribution across browsers
- Activity logs for each run
A test report is generated for every run, providing:
- Passed and failed test cases
- Detailed error logs
- Step-by-step execution insights
Both successful and failed execution data are available for analysis directly in the workspace experience.
Viewing Traces and Debugging Failures
To analyze detailed execution flows:
- Open the test run inside your Playwright Workspace
- Access the trace and test artifacts associated with the run
This allows you to inspect:
- UI actions
- Timing between steps
- DOM state at each step
- Logs and error details
Trace-based debugging helps identify flaky behavior and pinpoint failures faster.
Running API Tests with Playwright
You can execute API test cases alongside UI tests by defining request configurations and assertions within Playwright.
This allows teams to combine UI and API validations into a unified testing workflow within the same execution pipeline.
Playwright Testing with Visual Studio and TypeScript
For Visual Studio users:
- Use the same .env and playwright.service.config.ts
- Install dotenv:
npm install --save-dev dotenv
Run the test suite:
View execution details directly in your Playwright Workspace resource in the Azure Portal.npx playwright test --config=playwright.service.config.ts --workers=20
What’s Next?
- Explore parallel test execution to reduce runtime
- Use trace data for deeper debugging insights
- Extend the setup into CI/CD workflows
- Combine Playwright UI and API tests for end-to-end validation
Have you tried running Playwright tests using Playwright Workspaces in Azure App Testing yet?
Share your experience or questions in the comments!