Skip to content

Add DiskRP resource name patterns#43895

Open
aimuhire wants to merge 3 commits into
Azure:mainfrom
aimuhire:dev/arsenemuhire/task37884532-diskrp-name-pattern
Open

Add DiskRP resource name patterns#43895
aimuhire wants to merge 3 commits into
Azure:mainfrom
aimuhire:dev/arsenemuhire/task37884532-diskrp-name-pattern

Conversation

@aimuhire

@aimuhire aimuhire commented Jun 10, 2026

Copy link
Copy Markdown

ARM (Control Plane) API Specification Update Pull Request

Purpose of this PR

  • New resource provider.
  • New API version for an existing resource provider.
  • Update existing version for a new feature. (This is applicable only when you are revising a private preview API version.)
  • Update existing version to fix OpenAPI spec quality issues in S360.
  • Convert existing OpenAPI spec to TypeSpec spec (do not combine this with implementing changes for a new API version).
  • Other, please clarify:

This PR fills in missing ResourceNameParameter.NamePattern values for DiskRP resources in the ComputeDisk TypeSpec source and regenerates the affected DiskRP.json Swagger files. The patterns are aligned with DiskRP service-side resource name validation and improve generated OpenAPI path-parameter schema quality without changing service behavior.

Due diligence checklist

  • I confirm this PR is modifying Azure Resource Manager (ARM) related specifications, and not data plane related specifications.
  • I have reviewed following Resource Provider guidelines, including ARM resource provider contract and REST guidelines.
  • A release plan has been created. If not, please create one as it will help guide you through the REST API and SDK creation process.

Release plan note: This PR does not introduce a new API version, operation, model, property, or service behavior. It only fills missing path-parameter pattern metadata in existing DiskRP Swagger generated from TypeSpec. Please advise if a release plan is still required for this S360/spec-quality cleanup.

Summary

Adds explicit NamePattern metadata for DiskRP resource name parameters in TypeSpec and regenerates the affected DiskRP Swagger files.

The patterns are intentionally scoped to the public top-level DiskRP resources in this PR. Each uses the documented 80-character public resource-name shape.

Pattern Summary

Parameter Pattern Max length Reason
diskName ^[^_\W][\w-._]{0,79}(?<![-.])$ 80 Matches the public managed disk name contract and generated Swagger description.
snapshotName ^[^_\W][\w-._]{0,79}(?<![-.])$ 80 Matches the public snapshot name contract and generated Swagger description.
diskAccessName ^[^_\W][\w-._]{0,79}(?<![-.])$ 80 Matches service validation for public DiskAccess resource names.
diskEncryptionSetName ^[^_\W][\w-._]{0,79}(?<![-.])$ 80 Matches service validation for public disk encryption set resource names.

Notes

Area Explanation
Character set The pattern allows word characters, hyphen, dot, and underscore after the first character, and rejects names ending in hyphen or dot.
Dot support DiskRP service validation already permits dot, so the TypeSpec descriptions and generated Swagger descriptions now say dot is supported.
Disk/snapshot length The public Swagger path parameters use 80 so pattern and description agree.
Deferred resources diskRestorePointName and privateEndpointConnectionName are intentionally left out for now.

@microsoft-github-policy-service microsoft-github-policy-service Bot added customer-reported Issues that are reported by GitHub users external to the Azure organization. Compute labels Jun 10, 2026
@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ This PR targets either the main branch of the public specs repo or the RPSaaSMaster branch of the private specs repo. These branches are not intended for iterative development. Therefore, you must acknowledge you understand that after this PR is merged, the APIs are considered shipped to Azure customers. Any further attempts at in-place modifications to the APIs will be subject to Azure's versioning and breaking change policies. Additionally, for control plane APIs, you must acknowledge that you are following all the best practices documented by ARM at aka.ms/armapibestpractices. If you do intend to release the APIs to your customers by merging this PR, add the PublishToCustomers label to your PR in acknowledgement of the above. Otherwise, retarget this PR onto a feature branch, i.e. with prefix release- (see aka.ms/azsdk/api-versions#release--branches).


Comment generated by summarize-checks workflow run.

@github-actions

github-actions Bot commented Jun 10, 2026

Copy link
Copy Markdown

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Language API Review for Package
Swagger Microsoft.Compute-Compute
TypeSpec ComputeDisk
Java com.azure.resourcemanager:azure-resourcemanager-compute
Python azure-mgmt-compute
Go sdk/resourcemanager/compute/armcompute
JavaScript @azure/arm-compute

Comment generated by After APIView workflow run.

@github-actions github-actions Bot added ARMReview resource-manager TypeSpec Authored with TypeSpec WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required NotReadyForARMReview and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Jun 14, 2026
@mikekistler mikekistler added the BreakingChange-Approved-Benign Changes are not breaking at the REST API level and have at most minor impact to generated SDKs. label Jun 15, 2026
@github-actions github-actions Bot added WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required and removed NotReadyForARMReview labels Jun 15, 2026
KeyName = "diskName",
SegmentName = "disks",
NamePattern = ""
NamePattern = "^[^_\\W][\\w-._]{0,89}(?<![-.])$"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[NEW] 🟡 Warning [Self-consistency / Breaking-changes §"Resource naming rules"]

Description and NamePattern disagree on the maximum diskName length:

  • The @@doc on line 134 of this file says: "The maximum name length is 80 characters."
  • The NamePattern above (^[^_\W][\w-._]{0,89}(?<![-.])$) allows 1 + 89 = 90 characters.

This contradiction propagates verbatim into:

  • specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2024-03-02/DiskRP.json — lines 1255, 1300, 1448, 1551, 1616, 1694
  • specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2025-01-02/DiskRP.json — lines 1255, 1300, 1454, 1557, 1622, 1703

Since the explicit goal of this PR is to align the spec with DiskRP service-side validation, the value chosen here has to be exactly right — an over-strict pattern breaks legitimate names, an under-strict one mis-documents the service. Note that the four other resources in this PR use {0,79} (1–80 chars) matching their "80 characters" descriptions, so the 89 looks like an off-by-one typo.

Classification: NEW. The previous stable revisions of these path parameters had no pattern at all, so this is not pre-existing technical debt — it is introduced by this PR.

Suggested fix (if the 80-character description is correct):

-    NamePattern = "^[^_\\W][\\w-._]{0,89}(?<![-.])$"
+    NamePattern = "^[^_\\W][\\w-._]{0,79}(?<![-.])$"

If the service truly accepts 90 characters, please update the @@doc on line 134 (and the matching description text in both DiskRP.json files) to read "The maximum name length is 90 characters." Either way, please confirm with the DiskRP service team before merging.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, good catch. I had initially used the 90-character pattern because DiskRP has special VMSS disk handling and privileged snapshot validation paths that can allow longer names, and I wanted to avoid blocking any valid service scenarios.

For public Swagger metadata though, I agree NamePattern should match the documented public contract. I updated diskName to {0,79} so it aligns with the 80-character description, regenerated both DiskRP.json files, and applied the same correction to snapshotName.

I left diskRestorePointName and privateEndpointConnectionName out of scope because they are nested/child resource names, not the public top-level DiskRP resource names covered here. Their public validation contracts should be confirmed separately before adding NamePattern.

KeyName = "snapshotName",
SegmentName = "snapshots",
NamePattern = ""
NamePattern = "^[^_\\W][\\w-._]{0,89}(?<![-.])$"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

[NEW] 🟡 Warning [Self-consistency / Breaking-changes §"Resource naming rules"]

Description and NamePattern disagree on the maximum snapshotName length:

  • The @@doc on line 128 of this file says: "The max name length is 80 characters."
  • The NamePattern above (^[^_\W][\w-._]{0,89}(?<![-.])$) allows 1 + 89 = 90 characters.

This contradiction propagates verbatim into:

  • specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2024-03-02/DiskRP.json — lines 2083, 2131, 2222, 2301, 2366, 2441
  • specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2025-01-02/DiskRP.json — same six operations (analogous lines)

Same issue as Disk.tsp (diskName). The other resources in this PR (diskAccessName, diskEncryptionSetName) use {0,79} (1–80 chars) matching their "80 characters" descriptions, so the 89 here looks like a typo.

Classification: NEW. The previous stable revisions of these path parameters had no pattern at all, so this is not pre-existing technical debt — it is introduced by this PR.

Suggested fix (if the 80-character description is correct):

-    NamePattern = "^[^_\\W][\\w-._]{0,89}(?<![-.])$"
+    NamePattern = "^[^_\\W][\\w-._]{0,79}(?<![-.])$"

If the service truly accepts 90 characters, please update the @@doc on line 128 (and the matching description text in both DiskRP.json files) to read "The max name length is 90 characters." Either way, please confirm with the DiskRP service team before merging.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Thanks, good catch. I had initially used the 90-character pattern because DiskRP has special VMSS disk handling and privileged snapshot validation paths that can allow longer names, and I wanted to avoid blocking any valid service scenarios.

For public Swagger metadata though, I agree NamePattern should match the documented public contract. I updated diskName to {0,79} so it aligns with the 80-character description, regenerated both DiskRP.json files, and applied the same correction to snapshotName.

I left diskRestorePointName and privateEndpointConnectionName out of scope because they are nested/child resource names, not the public top-level DiskRP resource names covered here. Their public validation contracts should be confirmed separately before adding NamePattern.

@gary-x-li gary-x-li added ARMChangesRequested and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Jun 15, 2026
@aimuhire aimuhire requested a review from gary-x-li June 17, 2026 00:11
@audreyttt audreyttt added WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required and removed ARMChangesRequested labels Jun 17, 2026
@gary-x-li gary-x-li added Approved-Avocado ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Jun 17, 2026
@aimuhire aimuhire force-pushed the dev/arsenemuhire/task37884532-diskrp-name-pattern branch from 3ffc93f to e571430 Compare June 17, 2026 18:56
@github-actions github-actions Bot added WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required ARMAutoSignedOff-IncrementalTSP ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed ARMAutoSignedOff-IncrementalTSP ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review labels Jun 17, 2026
@audreyttt audreyttt removed the WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required label Jun 17, 2026
@aimuhire aimuhire force-pushed the dev/arsenemuhire/task37884532-diskrp-name-pattern branch from e571430 to dc9eeeb Compare July 1, 2026 06:50
@github-actions github-actions Bot added BreakingChange-JavaScript-Sdk WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required ARMAutoSignedOff-IncrementalTSP ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review and removed ARMAutoSignedOff-IncrementalTSP ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved-Avocado ARMAutoSignedOff-IncrementalTSP ARMReview ARMSignedOff <valid label in PR review process>add this label when ARM approve updates after review BreakingChange-Approved-Benign Changes are not breaking at the REST API level and have at most minor impact to generated SDKs. BreakingChange-JavaScript-Sdk BreakingChange-JavaScript-Sdk-Approved BreakingChangeReviewRequired <valid label in PR review process>add this label when breaking change review is required Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. resource-manager TypeSpec Authored with TypeSpec

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants