Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,15 @@

### Other Changes

- Migrated handwritten scenarios to the ARM recording/playback framework with deterministic names and signed-URL sanitization.
- Added the SDK provider-registration policy to the live-test client.
- Added an optional regional ARM endpoint override for live tests, preserving public-cloud authentication.
- Bounded live-test cleanup retries for transient parent-deletion conflicts after child removal.

## 1.0.0-beta.1 (2026-09-28)

- Azure Resource Manager Platform Validation client library for Java. This package contains Microsoft Azure SDK for Platform Validation Management SDK. Microsoft.PlatformValidation Resource Provider management API. Package api-version 2026-08-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

- Initial release for the azure-resourcemanager-platformvalidation Java SDK.

Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,99 @@ See [API design][design] for general introduction on design and key concepts on

For details on contributing to this repository, see the [contributing guide][cg].

### Recorded scenario tests

The handwritten `PlatformValidationLiveTests` use `ResourceManagerTestProxyTestBase`
for RECORD, PLAYBACK, and LIVE modes, following the
[management-plane test framework guide](https://github.com/Azure/azure-sdk-for-java/tree/main/sdk/resourcemanager/azure-resourcemanager-test).
Despite the historical class name, these scenarios are no longer marked `@LiveOnly`.
Normal Maven tests use PLAYBACK and do not require Azure credentials or a live subscription.
Recordings must be captured and published before playback can pass; missing recordings
are failures, not successful coverage.

For RECORD or LIVE, authenticate with Azure CLI and set `AZURE_TENANT_ID`,
`AZURE_SUBSCRIPTION_ID`, and `AZURE_RESOURCE_GROUP_NAME` to a dedicated test resource group.
Set `PLATFORMVALIDATION_LOCATION=eastus2euap` for Canary.
When this setting is absent, tests default to `southcentralusstg` (South Central US Stage).
This is a configuration default, not automatic failover after a service or test failure.
Use a subscription where the provider is registered and the requested region is enabled.
For regional Canary ARM routing, also set
`PLATFORMVALIDATION_ARM_ENDPOINT=https://eastus2euap.management.azure.com`.
This overrides only the resource-manager endpoint, preserving public-cloud authentication.
Leave `PLATFORMVALIDATION_CREATE_MANAGED_GROUP` unset for the current Canary deployment:
the service provisions and deletes the managed group; no manual group or role assignment is needed.
Resource names and non-secret environment settings are recorded through the framework's
resource namer, so playback does not depend on local settings. Both the service client and
the Resource Manager client share the proxy-aware HTTP pipeline.

```powershell
$env:AZURE_TEST_MODE = "RECORD"
$env:AZURE_TEST_LOG_LEVEL = "BASIC"
mvn -f sdk\platformvalidation\azure-resourcemanager-platformvalidation\pom.xml "-Djunit.jupiter.execution.parallel.enabled=false" "-Dtest=PlatformValidationLiveTests" test
```

After recording, clear credentials and service-specific environment settings and verify playback:

```powershell
$env:AZURE_TEST_MODE = "PLAYBACK"
mvn -f sdk\platformvalidation\azure-resourcemanager-platformvalidation\pom.xml "-Djunit.jupiter.execution.parallel.enabled=false" test
```

Inspect recordings for secrets before publishing. Custom body sanitizers redact signed URLs,
including the VHD SAS embedded inside `planConfigurationJson`, and subscription IDs in
service-specific fields and operation headers. Playback uses a non-secret image placeholder,
never a real SAS or its wall-clock expiry.
Publish recordings to `Azure/azure-sdk-assets` and commit the updated `assets.json` pointer,
following [Update test recordings](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-test/README.md#update-test-recordings).
From the repository root, with the test-proxy CLI installed:

```powershell
test-proxy push -a sdk\platformvalidation\azure-resourcemanager-platformvalidation\assets.json
```

Refresh recordings for each new API-version SDK PR, then verify playback before submitting.
Playback validates the SDK against recorded responses, not the current health of the service.

CloudValidation tests cover create, GET, both LIST scopes, PATCH, PUT update, and DELETE.
The operation-status client is checked against the completed PATCH operation.
Catalog checks assert real discovery and GET results; service errors fail rather than skip.
Plan tests require `PLATFORMVALIDATION_SOURCE_VHD_URI`, an approved Linux Gen1 X64 VHD
HTTPS URL, supplied as a secret environment variable. They check plan create, GET, LIST,
metadata PATCH, and DELETE. Boot execution additionally requires
`PLATFORMVALIDATION_RUN_EXECUTION=true` and checks execution results, VTR GET/LIST, and
child absence after execution deletion. In RECORD/LIVE, plan-only tests without an image fixture are
reported as skipped, not successful execution coverage. Explicitly enabling boot execution
without a valid image fixture fails rather than silently skipping the workload.
In PLAYBACK, both image-dependent scenarios use their recordings without fixture credentials
or boot opt-in. Do not publish an incomplete recording set as full scenario coverage.
Both plan creation and boot execution require the referenced boot test to be available in
the target environment's TestStore. Wait for its deployment and publishing before running
these scenarios; disabling boot execution alone does not bypass plan-time TestStore resolution.
If the image URL has a SAS expiry, the tests require more than 25 hours of remaining
validity before creating resources (the service requires at least one day).

Each scenario creates unique Java-owned names; no existing CV or plan is accepted as input.
Failures retain resources and log their IDs for investigation. Parent deletion stops if a
child remains. The supplied parent resource group is never deleted by the tests.
After child deletion, CloudValidation cleanup retries only HTTP 409
`CannotDeleteResource`, at most 30 attempts ten seconds apart, verifying the plan
list is empty before every attempt. Other failures remain failures.
For an explicitly approved environment without automatic managed-group provisioning,
`PLATFORMVALIDATION_CREATE_MANAGED_GROUP=true` creates a new, tagged `<CV>-mrg` and
deletes it only when empty after successful child cleanup. It never adopts existing groups
or grants roles; arrange service permissions separately. Do not enable this setting in
environments that automatically provision managed groups.

Standard PR CI runs playback
using published recordings; it does not need the SDK test subscription to host the service.

For RECORD/LIVE, the test client uses the SDK's `ProviderRegistrationPolicy` to register the resource
provider when ARM returns `MissingSubscriptionRegistration`. This requires the test
identity to have subscription-level provider registration permission; otherwise, arrange
registration separately. The policy does not handle `SubscriptionNotRegistered` or
`LocationNotAvailableForResourceType`; verify registration and regional availability
separately if those errors persist.

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.microsoft.com>.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/platformvalidation/azure-resourcemanager-platformvalidation",
"Tag": "java/platformvalidation/azure-resourcemanager-platformvalidation_81dc07912e"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,18 @@
<revapi.skip>true</revapi.skip>
</properties>
Comment thread
XiaofeiCao marked this conversation as resolved.
Resolved
<dependencies>
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-resources</artifactId>
<version>2.55.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-resources;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-test</artifactId>
<version>2.0.0-beta.4</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-test;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
Expand Down
Loading
Loading