옵션
집 Skill DevOps 및 CI/CD azure-resource-manager-playwright-dotnet

azure-resource-manager-playwright-dotnet

microsoft/skills microsoft/skills

Azure Resource Manager을 통해 Microsoft Playwright Testing 워크스페이스를 관리합니다: .NET SDK를 사용하여 워크스페이스 생성, 업데이트, 삭제, 이름 사용 가능성 확인 및 할당량 관리를 수행합니다.

...모든 것을 확장하십시오
0
업데이트 된 시간 2026년 9월 19일

Azure.ResourceManager.Playwright (.NET)

Azure Resource Manager을 통해 Microsoft Playwright Testing 워크스페이스를 프로비저닝하고 관리하기 위한 관리平面 SDK입니다.

⚠️ 관리 대 테스트 실행

  • 이 SDK (Azure.ResourceManager.Playwright): 워크스페이스 생성, 할당량 관리, 이름 사용 가능성 확인
  • 테스트 실행 SDK (Azure.Developer.MicrosoftPlaywrightTesting.NUnit): 클라우드 브라우저에서 대규모로 Playwright 테스트 실행

설치

dotnet add package Azure.ResourceManager.Playwright
dotnet add package Azure.Identity

현재 버전: 안정판 v1.0.0, 미리보기판 v1.0.0-beta.1

환경 변수

AZURE_SUBSCRIPTION_ID=<your-subscription-id>  # 필수: Azure 구독 ID
AZURE_TOKEN_CREDENTIALS=prod  # 프로덕션에서 DefaultAzureCredential을 사용할 경우에만 필수
AZURE_TENANT_ID=<tenant-id>  # 서비스principal 인증용 (선택 사항)
AZURE_CLIENT_ID=<client-id>  # 서비스principal 인증용 (선택 사항)
AZURE_CLIENT_SECRET=<client-secret>  # 서비스principal 인증용 (선택 사항)
</client-secret></client-id></tenant-id></your-subscription-id>

인증

using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Playwright;

// 로컬 개발: DefaultAzureCredential. 프로덕션: AZURE_TOKEN_CREDENTIALS=prod 또는 AZURE_TOKEN_CREDENTIALS=<specific_credential> 설정
var credential = new DefaultAzureCredential(
    DefaultAzureCredential.DefaultEnvironmentVariableName
);
// 또는 프로덕션에서 특정 자격 증명을 직접 사용:
// https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes 참조
// var credential = new ManagedIdentityCredential();
var armClient = new ArmClient(credential);

// 구독 가져오기
var subscriptionId = Environment.GetEnvironmentVariable("AZURE_SUBSCRIPTION_ID");
var subscription = armClient.GetSubscriptionResource(
    new ResourceIdentifier($"/subscriptions/{subscriptionId}"));
</specific_credential>

리소스 계층 구조

ArmClient
└── SubscriptionResource
    ├── PlaywrightQuotaResource (구독 수준 할당량)
    └── ResourceGroupResource
        └── PlaywrightWorkspaceResource
            └── PlaywrightWorkspaceQuotaResource (워크스페이스 수준 할당량)

핵심 워크플로우

1. Playwright 워크스페이스 생성

using Azure.ResourceManager.Playwright;
using Azure.ResourceManager.Playwright.Models;

// 리소스 그룹 가져오기
var resourceGroup = await subscription
    .GetResourceGroupAsync("my-resource-group");

// 워크스페이스 정의
var workspaceData = new PlaywrightWorkspaceData(AzureLocation.WestUS3)
{
    // 선택 사항: 지역적 연성 및 로컬 인증 구성
    RegionalAffinity = PlaywrightRegionalAffinity.Enabled,
    LocalAuth = PlaywrightLocalAuth.Enabled,
    Tags =
    {
        ["Team"] = "Dev Exp",
        ["Environment"] = "Production"
    }
};

// 워크스페이스 생성 (장기 실행 작업)
var workspaceCollection = resourceGroup.Value.GetPlaywrightWorkspaces();
var operation = await workspaceCollection.CreateOrUpdateAsync(
    WaitUntil.Completed,
    "my-playwright-workspace",
    workspaceData);

PlaywrightWorkspaceResource workspace = operation.Value;

// 테스트 실행을 위한 데이터平面 URI 가져오기
Console.WriteLine($"Data Plane URI: {workspace.Data.DataplaneUri}");
Console.WriteLine($"Workspace ID: {workspace.Data.WorkspaceId}");

2. 기존 워크스페이스 가져오기

// 이름으로 가져오기
var workspace = await workspaceCollection.GetAsync("my-playwright-workspace");

// 또는 먼저 존재 여부 확인
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. 워크스페이스 나열

// 리소스 그룹에서 나열
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}");
}

// 구독 전체에서 나열
await foreach (var workspace in subscription.GetPlaywrightWorkspacesAsync())
{
    Console.WriteLine($"Workspace: {workspace.Data.Name}");
}

4. 워크스페이스 업데이트

var patch = new PlaywrightWorkspacePatch
{
    Tags =
    {
        ["Team"] = "Dev Exp",
        ["Environment"] = "Staging",
        ["UpdatedAt"] = DateTime.UtcNow.ToString("o")
    }
};

var updatedWorkspace = await workspace.Value.UpdateAsync(patch);

5. 이름 사용 가능성 확인

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. 할당량 정보 가져오기

// 구독 수준 할당량
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}");
}

// 워크스페이스 수준 할당량
var workspaceQuotas = workspace.Value.GetAllPlaywrightWorkspaceQuota();
await foreach (var quota in workspaceQuotas.GetAllAsync())
{
    Console.WriteLine($"Workspace Quota: {quota.Data.Name}");
}

7. 워크스페이스 삭제

// 삭제 (장기 실행 작업)
await workspace.Value.DeleteAsync(WaitUntil.Completed);

주요 유형 참조

유형목적
`ArmClient`모든 ARM 작업의 진입점
`PlaywrightWorkspaceResource`Playwright Testing 워크스페이스를 나타냄
`PlaywrightWorkspaceCollection`워크스페이스 CRUD를 위한 컬렉션
`PlaywrightWorkspaceData`워크스페이스 생성/응답 페이로드
`PlaywrightWorkspacePatch`워크스페이스 업데이트 페이로드
`PlaywrightQuotaResource`구독 수준 할당량 정보
`PlaywrightWorkspaceQuotaResource`워크스페이스 수준 할당량 정보
`PlaywrightExtensions`ARM 리소스를 위한 확장 메서드
`PlaywrightCheckNameAvailabilityContent`이름 사용 가능성 확인 요청

워크스페이스 속성

속성설명
`DataplaneUri`테스트 실행용 URI (예: `https://api.dataplane.{guid}.domain.com`)
`WorkspaceId`고유한 워크스페이스 식별자 (GUID)
`RegionalAffinity`테스트 실행을 위한 지역적 연성 활성화/비활성화
`LocalAuth`로컬 인증(액세스 토큰) 활성화/비활성화
`ProvisioningState`현재 프로비저닝 상태(Succeeded, Failed 등)

모범 사례

  1. 진행 전에 완료되어야 하는 작업에는 WaitUntil.Completed 사용
  2. 수동으로 폴링하거나 병렬로 작업을 실행하려는 경우 WaitUntil.Started 사용
  3. 항상 DefaultAzureCredential 사용 — 키를 하드코딩하지 마십시오
  4. ARM API 오류에 대해 RequestFailedException 처리
  5. 멱등성 작업을 위해 CreateOrUpdateAsync 사용
  6. *`Get메서드를 통해 계층 구조 탐색 (예:resourceGroup.GetPlaywrightWorkspaces()`)**
  7. 테스트 실행 구성을 위해 워크스페이스 생성 후 DataplaneUri 저장

오류 처리

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}");
}

테스트 실행과의 통합

워크스페이스를 생성한 후 DataplaneUri를 사용하여 Playwright 테스트를 구성하십시오:

// 1. 워크스페이스 생성 (이 SDK)
var workspace = await workspaceCollection.CreateOrUpdateAsync(
    WaitUntil.Completed, "my-workspace", workspaceData);

// 2. 서비스 URL 가져오기
var serviceUrl = workspace.Value.Data.DataplaneUri;

// 3. 테스트 실행을 위한 환경 변수 설정
Environment.SetEnvironmentVariable("PLAYWRIGHT_SERVICE_URL", serviceUrl.ToString());

// 4. Azure.Developer.MicrosoftPlaywrightTesting.NUnit을 사용하여 테스트 실행
// (테스트 실행을 위한 별도 패키지)

관련 SDK

SDK목적설치
`Azure.ResourceManager.Playwright`管理平面 (이 SDK)`dotnet add package Azure.ResourceManager.Playwright`
`Azure.Developer.MicrosoftPlaywrightTesting.NUnit`대규모로 NUnit Playwright 테스트 실행`dotnet add package Azure.Developer.MicrosoftPlaywrightTesting.NUnit --prerelease`
`Azure.Developer.Playwright`Playwright 클라이언트 라이브러리`dotnet add package Azure.Developer.Playwright`

API 정보

  • 리소스 공급자: Microsoft.LoadTestService
  • 기본 API 버전: 2025-09-01
  • 리소스 유형: Microsoft.LoadTestService/playwrightWorkspaces

문서 링크

  • Azure.ResourceManager.Playwright API 참조
  • Microsoft Playwright Testing 개요
  • 빠른 시작: 대규모로 Playwright 테스트 실행
GitHub에서 보기
---
name: azure-resource-manager-playwright-dotnet
description: Manage Microsoft Playwright Testing workspaces via Azure Resource Manager: create, update, delete workspaces, check name availability, and manage quotas using the .NET SDK.
license: MIT
---

# Azure.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

```bash
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

```bash
AZURE_SUBSCRIPTION_ID=<your-subscription-id>  # Required: Azure subscription ID
AZURE_TOKEN_CREDENTIALS=prod  # Required only if DefaultAzureCredential is used in production
AZURE_TENANT_ID=<tenant-id>  # For service principal auth (optional)
AZURE_CLIENT_ID=<client-id>  # For service principal auth (optional)
AZURE_CLIENT_SECRET=<client-secret>  # For service principal auth (optional)
```

## Authentication

```csharp
using Azure.Identity;
using Azure.ResourceManager;
using Azure.ResourceManager.Playwright;

// Local dev: DefaultAzureCredential. Production: set AZURE_TOKEN_CREDENTIALS=prod or AZURE_TOKEN_CREDENTIALS=<specific_credential>
var credential = new DefaultAzureCredential(
    DefaultAzureCredential.DefaultEnvironmentVariableName
);
// Or use a specific credential directly in production:
// See https://learn.microsoft.com/dotnet/api/overview/azure/identity-readme?view=azure-dotnet#credential-classes
// var credential = new ManagedIdentityCredential();
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

```csharp
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

```csharp
// 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

```csharp
// 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

```csharp
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

```csharp
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

```csharp
// 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

```csharp
// 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

1. **Use `WaitUntil.Completed`** for operations that must finish before proceeding
2. **Use `WaitUntil.Started`** when you want to poll manually or run operations in parallel
3. **Always use `DefaultAzureCredential`** — never hardcode keys
4. **Handle `RequestFailedException`** for ARM API errors
5. **Use `CreateOrUpdateAsync`** for idempotent operations
6. **Navigate hierarchy** via `Get*` methods (e.g., `resourceGroup.GetPlaywrightWorkspaces()`)
7. **Store the DataplaneUri** after workspace creation for test execution configuration

## Error Handling

```csharp
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:

```csharp
// 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](https://learn.microsoft.com/en-us/dotnet/api/azure.resourcemanager.playwright)
- [Microsoft Playwright Testing Overview](https://learn.microsoft.com/en-us/azure/playwright-testing/overview-what-is-microsoft-playwright-testing)
- [Quickstart: Run Playwright Tests at Scale](https://learn.microsoft.com/en-us/azure/playwright-testing/quickstart-run-end-to-end-tests)

모든 파일

0개 파일

azure-resource-manager-playwright-dotnet 설치

스킬 파일을 다운로드하여 .claude/skills/ 디렉토리에 추출하세요.

ZIP 다운로드

저장소를 클론하고 스킬 파일을 프로젝트에 복사하세요.

git clone https://github.com/microsoft/skills/tree/main/.github/plugins/azure-sdk-dotnet/skills/azure-resource-manager-playwright-dotnet # Copy SKILL.md to your .claude/skills/ directory

복사 복사
빠른 설정: 스킬 폴더를 .claude/skills/에 복사하세요. Claude가 자동으로 감지하고 사용합니다.
저장소 microsoft/skills

관련 스킬

Verification &amp; Quality Assurance
업데이트 된 시간 2026년 6월 29일
base44-cli
업데이트 된 시간 2026년 6월 29일
klingai-upgrade-migration
업데이트 된 시간 2026년 7월 3일
Railway CLI Management
업데이트 된 시간 2026년 7월 2일
OR