
Azure Resource Manager Playwright
FreeManage Playwright Testing workspaces in Azure.
Free · Opens the source repo
What Azure Resource Manager Playwright does
The Azure Resource Manager Playwright SDK provides a management plane for provisioning and managing Microsoft Playwright Testing workspaces through Azure Resource Manager. This SDK is specifically designed for developers working with Playwright in .NET, allowing them to create, update, and manage testing environments seamlessly. It abstracts the complexities of Azure's infrastructure, enabling users to focus on their testing workflows without getting bogged down by the underlying setup.
With this SDK, you can create new Playwright workspaces, manage quotas, and check name availability for your resources. The workspace management capabilities include defining regional settings, configuring tags for better organization, and retrieving existing workspaces. This makes it particularly useful for teams that require a structured approach to managing their testing environments in the cloud.
The SDK also provides functionality to check the availability of workspace names, ensuring that users can quickly find suitable identifiers for their projects. Additionally, it allows for monitoring subscription-level and workspace-level quotas, which is essential for managing resources effectively and avoiding unexpected limits during testing.
This skill is ideal for developers and teams using Playwright for automated testing who want to leverage Azure's cloud capabilities. It simplifies the process of managing testing resources, enabling faster setup and more efficient workflows. Whether you are working on a small project or scaling up for larger applications, this SDK provides the necessary tools to manage your Playwright testing infrastructure efficiently.
When to use it
Use this skill when you need to create and manage Playwright Testing workspaces in Azure for your .NET applications.
When not to use it
This skill is not suitable for executing Playwright tests; for that, you would need the Test Execution SDK.
What you can build with it
Creating a New Workspace
Easily provision a new Playwright workspace in Azure with specific configurations and tags.
Managing Existing Workspaces
Retrieve and update existing Playwright workspaces to adapt to changing project needs.
Checking Name Availability
Quickly verify if a desired workspace name is available before attempting to create it.
How to install Azure Resource Manager Playwright
View source1. Install with the skills CLI
npx skills add sickn33/agentic-awesome-skills/azure-resource-manager-playwright-dotnet --agent claude-code2. Or install it manually
Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.
Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs
Inside SKILL.md
Written by sickn33Azure.ResourceManager.Playwright (.NET)
Management plane SDK for provisioning and managing Microsoft Playwright Testing workspaces via Azure Resource Manager.
⚠️ Management vs Test Execution
- This SDK (Azure.ResourceManager.Playwright): Create workspaces, manage quotas, check name availability
- Test Execution SDK (Azure.Developer.MicrosoftPlaywrightTesting.NUnit): Run Playwright tests at scale on cloud browsers
Installation
dotnet add package Azure.ResourceManager.Playwright
dotnet add package Azure.Identity
Current Versions: Stable v1.0.0, Preview v1.0.0-beta.1
Environment Variables
AZURE_SUBSCRIPTION_ID=<your-subscription-id>
# For service principal auth (optional)
AZURE_TENANT_ID=<tenant-id>
AZURE_CLIENT_ID=<client-id>
AZURE_CLIENT_SECRET=<client-secret>
Authentication
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Playwright;
// Always use DefaultAzureCredential
var credential = new DefaultAzureCredential();
var armClient = new ArmClient(credential);
// Get subscription
var subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID");
var subscription = armClient.GetSubscriptionResource(
new ResourceIdentifier($"/subscriptions/{subscriptionId}"));
Resource Hierarchy
ArmClient
└── SubscriptionResource
├── PlaywrightQuotaResource (subscription-level quotas)
└── ResourceGroupResource
└── PlaywrightWorkspaceResource
└── PlaywrightWorkspaceQuotaResource (workspace-level quotas)
Core Workflow
1. Create Playwright Workspace
using Azure.ResourceManager.Playwright;
using Azure.ResourceManager.Playwright.Models;
// Get resource group
var resourceGroup = await subscription
.GetResourceGroupAsync("my-resource-group");
// Define workspace
var workspaceData = new PlaywrightWorkspaceData(AzureLocation.WestUS3)
{
// Optional: Configure regional affinity and local auth
RegionalAffinity = PlaywrightRegionalAffinity.Enabled,
LocalAuth = PlaywrightLocalAuth.Enabled,
Tags =
{
["Team"] = "Dev Exp",
["Environment"] = "Production"
}
};
// Create workspace (long-running operation)
var workspaceCollection = resourceGroup.Value.GetPlaywrightWorkspaces();
var operation = await workspaceCollection.CreateOrUpdateAsync(
WaitUntil.Completed,
"my-playwright-workspace",
workspaceData);
PlaywrightWorkspaceResource workspace = operation.Value;
// Get the data plane URI for running tests
Console.WriteLine($"Data Plane URI: {workspace.Data.DataplaneUri}");
Console.WriteLine($"Workspace ID: {workspace.Data.WorkspaceId}");
2. Get Existing Workspace
// Get by name
var workspace = await workspaceCollection.GetAsync("my-playwright-workspace");
// Or check if exists first
bool exists = await workspaceCollection.ExistsAsync("my-playwright-workspace");
if (exists)
{
var existingWorkspace = await workspaceCollection.GetAsync("my-playwright-workspace");
Console.WriteLine($"Workspace found: {existingWorkspace.Value.Data.Name}");
}
3. List Workspaces
// List in resource group
await foreach (var workspace in workspaceCollection.GetAllAsync())
{
Console.WriteLine($"Workspace: {workspace.Data.Name}");
Console.WriteLine($" Location: {workspace.Data.Location}");
Console.WriteLine($" State: {workspace.Data.ProvisioningState}");
Console.WriteLine($" Data Plane URI: {workspace.Data.DataplaneUri}");
}
// List across subscription
await foreach (var workspace in subscription.GetPlaywrightWorkspacesAsync())
{
Console.WriteLine($"Workspace: {workspace.Data.Name}");
}
4. Update Workspace
var patch = new PlaywrightWorkspacePatch
{
Tags =
{
["Team"] = "Dev Exp",
["Environment"] = "Staging",
["UpdatedAt"] = DateTime.UtcNow.ToString("o")
}
};
var updatedWorkspace = await workspace.Value.UpdateAsync(patch);
5. Check Name Availability
using Azure.ResourceManager.Playwright.Models;
var checkRequest = new PlaywrightCheckNameAvailabilityContent
{
Name = "my-new-workspace",
ResourceType = "Microsoft.LoadTestService/playwrightWorkspaces"
};
var result = await subscription.CheckPlaywrightNameAvailabilityAsync(checkRequest);
if (result.Value.IsNameAvailable == true)
{
Console.WriteLine("Name is available!");
}
else
{
Console.WriteLine($"Name unavailable: {result.Value.Message}");
Console.WriteLine($"Reason: {result.Value.Reason}");
}
6. Get Quota Information
// Subscription-level quotas
await foreach (var quota in subscription.GetPlaywrightQuotasAsync(AzureLocation.WestUS3))
{
Console.WriteLine($"Quota: {quota.Data.Name}");
Console.WriteLine($" Limit: {quota.Data.Limit}");
Console.WriteLine($" Used: {quota.Data.Used}");
}
// Workspace-level quotas
var workspaceQuotas = workspace.Value.GetAllPlaywrightWorkspaceQuota();
await foreach (var quota in workspaceQuotas.GetAllAsync())
{
Console.WriteLine($"Workspace Quota: {quota.Data.Name}");
}
7. Delete Workspace
// Delete (long-running operation)
await workspace.Value.DeleteAsync(WaitUntil.Completed);
Key Types Reference
| Type | Purpose |
|---|---|
ArmClient | Entry point for all ARM operations |
PlaywrightWorkspaceResource | Represents a Playwright Testing workspace |
PlaywrightWorkspaceCollection | Collection for workspace CRUD |
PlaywrightWorkspaceData | Workspace creation/response payload |
PlaywrightWorkspacePatch | Workspace update payload |
PlaywrightQuotaResource | Subscription-level quota information |
PlaywrightWorkspaceQuotaResource | Workspace-level quota information |
PlaywrightExtensions | Extension methods for ARM resources |
PlaywrightCheckNameAvailabilityContent | Name availability check request |
Workspace Properties
| Property | Description |
|---|---|
DataplaneUri | URI for running tests (e.g., https://api.dataplane.{guid}.domain.com) |
WorkspaceId | Unique workspace identifier (GUID) |
RegionalAffinity | Enable/disable regional affinity for test execution |
LocalAuth | Enable/disable local authentication (access tokens) |
ProvisioningState | Current provisioning state (Succeeded, Failed, etc.) |
Best Practices
- Use
WaitUntil.Completedfor operations that must finish before proceeding - Use
WaitUntil.Startedwhen you want to poll manually or run operations in parallel - Always use
DefaultAzureCredential— never hardcode keys - Handle
RequestFailedExceptionfor ARM API errors - Use
CreateOrUpdateAsyncfor idempotent operations - Navigate hierarchy via
Get*methods (e.g.,resourceGroup.GetPlaywrightWorkspaces()) - Store the DataplaneUri after workspace creation for test execution configuration
Error Handling
using Azure;
try
{
var operation = await workspaceCollection.CreateOrUpdateAsync(
WaitUntil.Completed, workspaceName, workspaceData);
}
catch (RequestFailedException ex) when (ex.Status == 409)
{
Console.WriteLine("Workspace already exists");
}
catch (RequestFailedException ex) when (ex.Status == 400)
{
Console.WriteLine($"Bad request: {ex.Message}");
}
catch (RequestFailedException ex)
{
Console.WriteLine($"ARM Error: {ex.Status} - {ex.ErrorCode}: {ex.Message}");
}
Integration with Test Execution
After creating a workspace, use the DataplaneUri to configure your Playwright tests:
// 1. Create workspace (this SDK)
var workspace = await workspaceCollection.CreateOrUpdateAsync(
WaitUntil.Completed, "my-workspace", workspaceData);
// 2. Get the service URL
var serviceUrl = workspace.Value.Data.DataplaneUri;
// 3. Set environment variable for test execution
Environment.SetEnvironmentVariable("PLAYWRIGHT_SERVICE_URL", serviceUrl.ToString());
// 4. Run tests using Azure.Developer.MicrosoftPlaywrightTesting.NUnit
// (separate package for test execution)
Related SDKs
| SDK | Purpose | Install |
|---|---|---|
Azure.ResourceManager.Playwright | Management plane (this SDK) | dotnet add package Azure.ResourceManager.Playwright |
Azure.Developer.MicrosoftPlaywrightTesting.NUnit | Run NUnit Playwright tests at scale | dotnet add package Azure.Developer.MicrosoftPlaywrightTesting.NUnit --prerelease |
Azure.Developer.Playwright | Playwright client library | dotnet add package Azure.Developer.Playwright |
API Information
- Resource Provider:
Microsoft.LoadTestService - Default API Version:
2025-09-01 - Resource Type:
Microsoft.LoadTestService/playwrightWorkspaces
Documentation Links
- Azure.ResourceManager.Playwright API Reference
- Microsoft Playwright Testing Overview
- Quickstart: Run Playwright Tests at Scale
When to Use
This skill is applicable to execute the workflow or actions described in the overview.
Limitations
- Use this skill only when the task clearly matches the scope described above.
- Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
- Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Frequently asked questions about Azure Resource Manager Playwright
Similar skills
Turborepo
Optimized build system for JavaScript/TypeScript monorepos.
Azure Pipelines Validation
Streamline your Azure DevOps pipeline changes locally.
Azure Developer CLI
Streamline your Azure project workflows with best practices.
Azure Container Registry CLI
Manage Azure Container Registry resources with ease.
Aspire
Build and orchestrate polyglot distributed applications seamlessly.
Vercel CLI
Manage and deploy Vercel projects from the command line.
