Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
a512472
Regenerate resources Swagger clients
weidongxu-microsoft Aug 12, 2026
1f4b041
Remove stale resources generated samples
weidongxu-microsoft Aug 12, 2026
33cbbb2
Preserve resources Swagger generated files
weidongxu-microsoft Aug 12, 2026
f5573c3
Generate resources data boundaries from TypeSpec
weidongxu-microsoft Aug 12, 2026
9c21b3c
Document resources TypeSpec migration milestones
weidongxu-microsoft Aug 12, 2026
7a08602
Generate resources deployment stacks from TypeSpec
weidongxu-microsoft Aug 12, 2026
ca94cc2
Preserve deployment stack property flattening
weidongxu-microsoft Aug 12, 2026
a5103cb
Generate resources policy from TypeSpec
weidongxu-microsoft Aug 12, 2026
f7e0298
Customize resources policy exemption access
weidongxu-microsoft Aug 12, 2026
2350275
Fix policy interface customization
weidongxu-microsoft Aug 12, 2026
fa60d91
Restore policy exemption client access
weidongxu-microsoft Aug 12, 2026
74ccf04
Add generated resources policy samples
weidongxu-microsoft Aug 12, 2026
0d83329
Generate resources subscriptions from TypeSpec
weidongxu-microsoft Aug 12, 2026
1ce90d5
Add generated resources subscription samples
weidongxu-microsoft Aug 12, 2026
8cf2661
Customize deployment resource references
weidongxu-microsoft Aug 12, 2026
cfcbb3f
Generate resources deployments from TypeSpec
weidongxu-microsoft Aug 12, 2026
bb3a027
Add generated resources deployment samples
weidongxu-microsoft Aug 12, 2026
52477b5
Generate core resources from TypeSpec
weidongxu-microsoft Aug 12, 2026
6538252
Add generated core resources samples
weidongxu-microsoft Aug 12, 2026
91379fc
Fix resources sample client accessors
weidongxu-microsoft Aug 12, 2026
c6d1936
Update resources test recordings
weidongxu-microsoft Aug 12, 2026
370ad15
Open resources implementation models to azure-core
weidongxu-microsoft Aug 12, 2026
45a0908
Preserve deployment stack delete enum compatibility
weidongxu-microsoft Aug 12, 2026
91b2047
Preserve combined resources package during generation
weidongxu-microsoft Aug 12, 2026
97ea520
Remove redundant policy client modifier
weidongxu-microsoft Aug 12, 2026
98e8c93
Point resources generation to canonical TypeSpec source
weidongxu-microsoft Aug 12, 2026
d62691e
Avoid duplicate policy exemptions customization
weidongxu-microsoft Aug 12, 2026
d6c74b4
Merge remote-tracking branch 'upstream/main' into issue-49803-resourc…
weidongxu-microsoft Aug 12, 2026
c9deac1
Keep migration notes local
weidongxu-microsoft Aug 12, 2026
e52d53a
Use management exceptions for subscription APIs
weidongxu-microsoft Aug 12, 2026
02889fa
Disable VM delete-option playback test
weidongxu-microsoft Aug 12, 2026
9cd9361
Disable generic resources playback test
weidongxu-microsoft Aug 12, 2026
d4450cb
Restore premium management library versions
weidongxu-microsoft Aug 12, 2026
704a011
Disable tagged deployment playback test
weidongxu-microsoft Aug 12, 2026
7442073
Pin policy generation to stable API
weidongxu-microsoft Aug 13, 2026
7fa454e
Fix generated policy sample client access
weidongxu-microsoft Aug 13, 2026
1f2022e
Regenerate resources models from TypeSpec
weidongxu-microsoft Aug 13, 2026
3268ce0
Use full TypeSpec specification commit
weidongxu-microsoft Aug 13, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
17 changes: 16 additions & 1 deletion eng/automation/generate_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@
TSPCONFIG_URL_PATTERN = re.compile(
r"^https://github.com/(?P<repo>Azure/azure-rest-api-specs(-pr)?)/blob/(?P<commit>[0-9a-f]{40})/(?P<path>.*)/tspconfig.yaml$",
)

GENERATED_SOURCE_CLEANUP_EXCLUDED_MODULES = {
"azure-resourcemanager-resources",
}


def should_remove_generated_source_code(module: str) -> bool:
return module not in GENERATED_SOURCE_CLEANUP_EXCLUDED_MODULES


def remove_generated_source_code(sdk_folder: str, namespace: str):
main_source_folder = os.path.join(sdk_folder, "src/main/java")
main_resources_folder = os.path.join(sdk_folder, "src/main/resources")
Expand Down Expand Up @@ -427,7 +437,12 @@ def generate_typespec_project(
)

if remove_before_regen and group_id:
remove_generated_source_code(os.path.join(sdk_root, sdk_folder), f"{group_id}.{service}")
if should_remove_generated_source_code(module):
remove_generated_source_code(os.path.join(sdk_root, sdk_folder), f"{group_id}.{service}")
else:
logging.info(
f"[GENERATE] Skipping generated source cleanup for module {module}."
)
if api_version:
emitter_options.append(f"api-version={api_version}")

Expand Down
10 changes: 10 additions & 0 deletions eng/automation/test_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import unittest

from generate import update_revapi_skip
from generate_utils import should_remove_generated_source_code
from utils import is_first_release

POM_WITH_REVAPI_TRUE = """\
Expand Down Expand Up @@ -134,5 +135,14 @@ def test_missing_file_returns_false(self):
self.assertFalse(is_first_release(sdk_root, self.GROUP, self.MODULE))


class TestGeneratedSourceCleanup(unittest.TestCase):

def test_resources_module_cleanup_is_disabled(self):
self.assertFalse(should_remove_generated_source_code("azure-resourcemanager-resources"))

def test_other_module_cleanup_is_enabled(self):
self.assertTrue(should_remove_generated_source_code("azure-resourcemanager-compute"))


if __name__ == "__main__":
unittest.main()
45 changes: 45 additions & 0 deletions eng/lintingconfigs/revapi/track2/revapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1038,6 +1038,51 @@
"old": "method com.azure.resourcemanager.compute.models.ExecutedValidation com.azure.resourcemanager.compute.models.ExecutedValidation::withStatus(com.azure.resourcemanager.compute.models.ValidationStatus)",
"justification": "ExecutedValidation is output-only; fluent setter removed as part of immutable model cleanup."
},
{
"code": "java.method.removed",
"old": {
"matcher": "regex",
"match": "method .* com\\.azure\\.resourcemanager\\.resources\\.models\\..*\\:\\:with.*\\(.*\\).*"
},
"justification": "Output-only immutable models' setters are removed."
},
{
"code": "java.method.removed",
"old": {
"matcher": "regex",
"match": "method .* com\\.azure\\.resourcemanager\\.resources\\.models\\.PolicyLogInfo\\:\\:(ancestors|complianceReasonCode|policyAssignmentDisplayName|policyDefinitionDisplayName|policyDefinitionGroupNames|policyExemptionIds|policySetDefinitionCategory|policySetDefinitionDisplayName|resourceLocation)\\(\\)"

@weidongxu-microsoft Weidong Xu (weidongxu-microsoft) Aug 12, 2026

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

},
"justification": "PolicyLogInfo properties were removed because they are not supported by the Policy service."
},
{
"code": "java.method.visibilityReduced",
"old": {
"matcher": "regex",
"match": "method void com\\.azure\\.resourcemanager\\.resources\\.models\\..*\\:\\:\\<init\\>\\(\\)"
},
"justification": "Output-only immutable models' constructors are now private."
},
{
"code": "java.class.removed",
"old": {
"matcher": "regex",
"match": "class com\\.azure\\.resourcemanager\\.resources\\.models\\..*ListResult"
},
"justification": "Pageable models moved to implementation package. Unlikely used by user."
},
{
"code": "java.class.removed",
"old": "class com.azure.resourcemanager.resources.models.AzureResourceBase",
"justification": "Unused legacy base model removed during TypeSpec migration."
},
{
"code": "java.class.noLongerInheritsFromClass",
"old": {
"matcher": "regex",
"match": "class com\\.azure\\.resourcemanager\\.resources\\.models\\.ResourceReferenceExtended"
},
"justification": "TypeSpec composition flattens ResourceReference properties instead of generating Java inheritance."
},
{
"code" : "java.class.removed",
"old" : "class com.azure.resourcemanager.containerregistry.models.AutoGeneratedDomainNameLabelScope",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1019,6 +1019,7 @@ public void canForceDeleteVirtualMachine() {
}

@Test
@Disabled("TODO: restore the test after resources lib release. Playback URI casing changed from resourceGroups to resourcegroups.")
public void canCreateVirtualMachineWithDeleteOption() throws Exception {
Region region = Region.US_WEST3;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import com.azure.resourcemanager.resources.samples.ManageResource;
import com.azure.resourcemanager.resources.samples.ManageResourceGroup;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;

import java.io.IOException;
Expand Down Expand Up @@ -47,6 +48,7 @@ public void testDeployUsingARMTemplateWithDeploymentOperations() throws Interrup
}

@Test
@Disabled("TODO: restore the test after resources lib release. Playback URI casing changed from resourceGroups to resourcegroups.")
public void testDeployUsingARMTemplateWithTags() throws IOException, IllegalAccessException {
Assertions.assertTrue(DeployUsingARMTemplateWithTags.runSample(azureResourceManager));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ public void testDeployments() {
*
*/
@Test
@Disabled("TODO: restore the test after resources lib release. Playback URI casing changed from resourceGroups to resourcegroups.")
public void testGenericResources() {
// Create some resources
NetworkSecurityGroup nsg = azureResourceManager.networkSecurityGroups()
Expand Down
6 changes: 6 additions & 0 deletions sdk/resources/azure-resourcemanager-resources/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@

## 2.55.0-beta.1 (Unreleased)

- Package api-version 2026-07-01.

### Features Added

### Breaking Changes

- Removed properties `ancestors`, `complianceReasonCode`, `policyAssignmentDisplayName`, `policyDefinitionDisplayName`,
`policyDefinitionGroupNames`, `policyExemptionIds`, `policySetDefinitionCategory`, `policySetDefinitionDisplayName`, and
`resourceLocation` from `PolicyLogInfo`, as they are not supported by the Policy service.

### Bugs Fixed

### Other Changes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/resources/azure-resourcemanager-resources",
"Tag": "java/resources/azure-resourcemanager-resources_5e481be4bc"
"Tag": "java/resources/azure-resourcemanager-resources_5d894004de"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>com.azure</groupId>
<artifactId>azure-code-customization-parent</artifactId>
<version>1.0.0-beta.1</version>
<relativePath>../../../parents/azure-code-customization-parent</relativePath>
</parent>

<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-resources-customization</artifactId>
<version>1.0.0-beta.1</version>
<modelVersion>4.0.0</modelVersion>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import com.azure.autorest.customization.ClassCustomization;
import com.azure.autorest.customization.Customization;
import com.azure.autorest.customization.LibraryCustomization;
import com.github.javaparser.ast.Modifier;
import org.slf4j.Logger;

/**
* Code customization after deployments code generation.
*/
public class DeploymentsCustomization extends Customization {
@Override
public void customize(LibraryCustomization customization, Logger logger) {
customizeResourceReference(
customization.getPackage("com.azure.resourcemanager.resources.models").getClass("ResourceReference"));
}

private static void customizeResourceReference(ClassCustomization customization) {
customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> {
clazz.removeModifier(Modifier.Keyword.FINAL);
clazz.getConstructors()
.stream()
.filter(constructor -> constructor.getParameters().isEmpty())
.forEach(constructor -> constructor.setModifiers(Modifier.Keyword.PROTECTED));
}));
}
}

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is to handle the mistake we made a long time ago -- we release GA on a tag that includes PolicyExemptions that still is preview.

The client/model class was converted as handwritten. The MangementClient would need a customizatoin.

Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

import com.azure.autorest.customization.ClassCustomization;
import com.azure.autorest.customization.Customization;
import com.azure.autorest.customization.LibraryCustomization;
import com.azure.autorest.customization.PackageCustomization;
import com.github.javaparser.StaticJavaParser;
import com.github.javaparser.ast.Modifier;
import com.github.javaparser.ast.body.MethodDeclaration;
import org.slf4j.Logger;

/**
* Code customization after code generation.
*/
public class PolicyCustomization extends Customization {
@Override
public void customize(LibraryCustomization customization, Logger logger) {
customizePolicyClient(
customization.getPackage("com.azure.resourcemanager.resources.fluent").getClass("PolicyClient"));
customizePolicyClientImpl(
customization.getPackage("com.azure.resourcemanager.resources.implementation")
.getClass("PolicyClientImpl"));
}

private static void customizePolicyClient(ClassCustomization customization) {
customization.customizeAst(ast -> ast.getInterfaceByName(customization.getClassName()).ifPresent(clazz -> {
if (clazz.getMethodsByName("getPolicyExemptions").isEmpty()) {
MethodDeclaration method = clazz.addMethod("getPolicyExemptions");
method.setType("PolicyExemptionsClient");
method.removeBody();
method.setJavadocComment("Gets the PolicyExemptionsClient object to access its operations.\n\n"
+ "@return the PolicyExemptionsClient object.");
}
}));
}

private static void customizePolicyClientImpl(ClassCustomization customization) {
customization.customizeAst(ast -> ast.getClassByName(customization.getClassName()).ifPresent(clazz -> {
if (clazz.getMethodsByName("getPolicyExemptions").isEmpty()) {
ast.addImport("com.azure.resourcemanager.resources.fluent.PolicyExemptionsClient");
clazz.addField("PolicyExemptionsClient", "policyExemptions", Modifier.Keyword.PRIVATE,
Modifier.Keyword.FINAL);

MethodDeclaration method = clazz.addMethod("getPolicyExemptions", Modifier.Keyword.PUBLIC);
method.addMarkerAnnotation("Override");
method.setType("PolicyExemptionsClient");
method.setBody(StaticJavaParser.parseBlock("{ return this.policyExemptions; }"));
method.setJavadocComment("Gets the PolicyExemptionsClient object to access its operations.\n\n"
+ "@return the PolicyExemptionsClient object.");

clazz.getConstructors()
.forEach(constructor -> constructor.getBody()
.addStatement("this.policyExemptions = new PolicyExemptionsClientImpl(this);"));
}
}));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Generated code

package com.azure.resourcemanager.resources.fluent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Generated code

package com.azure.resourcemanager.resources.fluent;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Generated code

package com.azure.resourcemanager.resources.fluent;

Expand Down
Loading
Loading