Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
bc7c315
Add arm-resource-required-operations rule and extend arm-resource-patch
Copilot May 5, 2026
23115c4
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 5, 2026
fa7e218
Remove Rule 2 changes (arm-resource-patch extension)
Copilot May 5, 2026
56007b2
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 5, 2026
5b963c9
Use resolveArmResources, unify list-by-parent semantics, add list-by-…
Copilot May 5, 2026
38144d7
Iterate ResolvedResources via root listener; aggregate per-model
Copilot May 6, 2026
ede43a4
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 7, 2026
ab565f1
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 7, 2026
545ef74
Merge main; refine list-categorization heuristic; update samples; add…
Copilot May 7, 2026
ec87b6b
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 7, 2026
df78d91
Exempt NSPs, PrivateLinks, and PrivateEndpointConnections from requir…
Copilot May 7, 2026
ae3107e
Regenerate ARM linter docs after rule registration
Copilot May 8, 2026
822a5e0
Merge main; resolve conflicts and regenerate ARM linter docs
Copilot May 8, 2026
4b375a2
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 8, 2026
b5cfec6
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 11, 2026
10fafc3
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 13, 2026
aebb3fa
Narrow rule: tracked resources keep full set; others only need read (…
Copilot May 13, 2026
6defe8d
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 13, 2026
2fc6eb9
Drop PUT-requires-delete check from new rule; defer to no-resource-de…
Copilot May 13, 2026
13246b4
Merge remote-tracking branch 'origin/main' into copilot/add-arm-resou…
Copilot May 14, 2026
b6ee6db
Apply suggested rule changes: no model grouping, target interface, up…
Copilot May 14, 2026
aaefb2e
Remove model-keyed extraPresent merging; key by specific canonical an…
Copilot May 20, 2026
1b6e013
Merge branch 'main' into copilot/add-arm-resource-required-operations…
markcowl May 26, 2026
d2ab95e
Suppress arm-resource-required-operations on legacy static-routes sample
Copilot May 27, 2026
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
@@ -0,0 +1,8 @@
---
changeKind: feature
packages:
- "@azure-tools/typespec-azure-resource-manager"
- "@azure-tools/typespec-azure-rulesets"
---

Add new `arm-resource-required-operations` linting rule that ensures every ARM resource declares the complete set of required lifecycle and list operations (singleton-aware; complements`no-resource-delete-operation`).
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ interface Widgets {
>;
delete is ArmResourceDeleteWithoutOkAsync<Widget>;
list is ArmResourceListByParent<Widget>;
listBySubscription is ArmListBySubscription<Widget>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,5 @@ interface Widgets {
@Azure.ResourceManager.Legacy.renamePathParameter("widgetName", "resourceGroupName")
delete is ArmResourceDeleteWithoutOkAsync<Widget>;
list is ArmResourceListByParent<Widget>;
listBySubscription is ArmListBySubscription<Widget>;
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ alias BaseParams2 = {
};

/** Subscription operations */
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-required-operations" "Legacy static-routes sample uses custom operation templates not recognized by the standard required-operations check."
@armResourceOperations(#{ allowStaticRoutes: true })
interface EmployeeSubscriptions {
get is EmplOps.Read<Employee>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,40 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.OptionalBody/widgets": {
"get": {
"operationId": "Widgets_ListBySubscription",
"tags": [
"Widgets"
],
"description": "List Widget resources by subscription ID",
"parameters": [
{
"$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "Azure operation completed successfully.",
"schema": {
"$ref": "#/definitions/WidgetListResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OptionalBody/widgets": {
"get": {
"operationId": "Widgets_List",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,40 @@
}
}
},
"/subscriptions/{subscriptionId}/providers/Microsoft.RenamedOperations/widgets": {
"get": {
"operationId": "Widgets_ListBySubscription",
"tags": [
"Widgets"
],
"description": "List Widget resources by subscription ID",
"parameters": [
{
"$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/ApiVersionParameter"
},
{
"$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/parameters/SubscriptionIdParameter"
}
],
"responses": {
"200": {
"description": "Azure operation completed successfully.",
"schema": {
"$ref": "#/definitions/WidgetListResult"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "../../../../../../../../../specs/resource-manager/common-types/v5/types.json#/definitions/ErrorResponse"
}
}
},
"x-ms-pageable": {
"nextLinkName": "nextLink"
}
}
},
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.RenamedOperations/widgets": {
"get": {
"operationId": "Widgets_List",
Expand Down
1 change: 1 addition & 0 deletions packages/typespec-azure-resource-manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ Available ruleSets:
| [`@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-resource-operation-response) | [RPC 008]: PUT, GET, PATCH & LIST must return the same resource schema. |
| [`@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-resource-path-segment-invalid-chars) | Arm resource name must contain only alphanumeric characters. |
| [`@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-resource-provisioning-state) | Check for properly configured provisioningState property. |
| [`@azure-tools/typespec-azure-resource-manager/arm-resource-required-operations`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-resource-required-operations) | ARM resources must define their required operations: tracked resources need the full lifecycle and list set, other resources need a read, and any resource defining createOrUpdate must also define delete. |
| [`@azure-tools/typespec-azure-resource-manager/version-progression`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/version-progression) | Validate that ARM service versions all use unique dates and are declared in strictly increasing chronological order. |
| [`@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-custom-resource-no-key) | Validate that custom resource contains a key property. |
| [`@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage`](https://azure.github.io/typespec-azure/docs/libraries/azure-resource-manager/rules/arm-custom-resource-usage-discourage) | Verify the usage of @customAzureResource decorator. |
Expand Down
2 changes: 2 additions & 0 deletions packages/typespec-azure-resource-manager/src/linter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { armResourceOperationsRule } from "./rules/arm-resource-operation-respon
import { patchOperationsRule } from "./rules/arm-resource-patch.js";
import { armResourcePathInvalidCharsRule } from "./rules/arm-resource-path-invalid-chars.js";
import { armResourceProvisioningStateRule } from "./rules/arm-resource-provisioning-state-rule.js";
import { armResourceRequiredOperationsRule } from "./rules/arm-resource-required-operations.js";
import { beyondNestingRule } from "./rules/beyond-nesting-levels.js";
import { coreOperationsRule } from "./rules/core-operations.js";
import { envelopePropertiesRules } from "./rules/envelope-properties.js";
Expand Down Expand Up @@ -52,6 +53,7 @@ const rules = [
armResourceOperationsRule,
armResourcePathInvalidCharsRule,
armResourceProvisioningStateRule,
armResourceRequiredOperationsRule,
versionProgressionRule,
armCustomResourceNoKey,
armCustomResourceUsageDiscourage,
Expand Down
Loading