Skip to content

[Compute] Add VM protection resource and VM disk restore action to 2026-09-01 - #47292

Open
nehalR12 wants to merge 5 commits into
Azure:compute-2026-09-01from
nehalR12:dev/nehalreshu/vm-protection-2026-09-01
Open

nehalR12 wants to merge 5 commits into
Azure:compute-2026-09-01from
nehalR12:dev/nehalreshu/vm-protection-2026-09-01

Conversation

@nehalR12

Copy link
Copy Markdown
Contributor

ARM (Control Plane) API Specification Update Pull Request

Tip

Overwhelmed by all this guidance? See the Getting help section at the bottom of this PR description.

PR review workflow diagram

Please understand this diagram before proceeding. It explains how to get your PR approved & merged.

spec_pr_review_workflow_diagram

Purpose of this PR

What's the purpose of this PR? Check the specific option that applies. This is mandatory!

  • New resource provider.
  • New API version for an existing resource provider. (If API spec is not defined in TypeSpec, the PR should have been created in adherence to OpenAPI specs PR creation guidance).
  • 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 targets the compute-2026-09-01 release branch, not main. The 2026-09-01 API version is still unreleased and is being assembled on that branch, so this change adds a feature to a version that has not shipped yet.

Due diligence checklist

To merge this PR, you must go through the following checklist and confirm you understood
and followed the instructions by checking all the boxes:

  • 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 (estimated time: 4 hours).
    I understand this is required before I can proceed to the diagram Step 2, "ARM API changes review", for this PR.
  • 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.

Summary of changes

Adds the Basic VM Protection feature to Microsoft.Compute, API version 2026-09-01.

Change Detail
New singleton proxy resource .../virtualMachines/{vmName}/vmProtection/default with VirtualMachineProtections_Get and VirtualMachineProtections_CreateOrUpdate
New LRO action POST .../virtualMachines/{vmName}/restore (VirtualMachines_Restore) to restore a VM's disks from a platform restore point
New property vmProtection on ResiliencyProfile
New definitions VirtualMachineProtection, VirtualMachineProtectionProperties, VirtualMachineProtectionConfiguration, VirtualMachineProtectionProfile, VirtualMachineProtectionType, VirtualMachineRestoreParameters

Source of truth is TypeSpec; ComputeRP.json was regenerated with tsp compile . using the toolchain versions pinned in pnpm-workspace.yaml on this branch (compiler 1.16.0, Azure emitters 0.72.x). Compilation completed with no diagnostics, and the only regenerated file is Compute/stable/2026-09-01/ComputeRP.json — no other API version folder is touched.

The change is purely additive: 16 files changed, 841 insertions, 0 deletions. All new TypeSpec declarations are gated with @added(Versions.v2026_09_01).

Two suppressions are added in readme.md:

  • NestedResourcesMustHaveListOperation on VirtualMachineProtection — it is a singleton (default), so a list operation is not meaningful.
  • PostResponseCodes on the /restore path — the action is a long-running operation returning 202.

Additional information

Viewing API changes

For convenient view of the API changes made by this PR, refer to the URLs provided in the table
in the Generated ApiView comment added to this PR. You can use ApiView to show API versions diff.

Suppressing failures

If one or multiple validation error/warning suppression(s) is detected in your PR, please follow the
suppressions guide to get approval.

Getting help

  • First, please carefully read through this PR description, from top to bottom. Please fill out the Purpose of this PR and Due diligence checklist.
  • If you don't have permissions to remove or add labels to the PR, request write access per aka.ms/azsdk/access#request-access-to-rest-api-or-sdk-repositories
  • To understand what you must do next to merge this PR, see the Next Steps to Merge comment. It will appear within few minutes of submitting this PR and will continue to be up-to-date with current PR state.
  • For guidance on fixing this PR CI check failures, see the hyperlinks provided in given failure
    and https://aka.ms/ci-fix.
  • For help with ARM review (PR workflow diagram Step 2), see https://aka.ms/azsdk/pr-arm-review.
  • If the PR CI checks appear to be stuck in queued state, please add a comment with contents /azp run.
    This should result in a new comment denoting a PR validation pipeline has started and the checks should be updated after few minutes.
  • If the help provided by the previous points is not enough, post to https://aka.ms/azsdk/support/specreview-channel and link to this PR.
  • For guidance on SDK breaking change review, refer to https://aka.ms/ci-fix.

Adds the Basic VM Protection feature to the Microsoft.Compute 2026-09-01
API version:

- New singleton proxy resource `virtualMachines/{vmName}/vmProtection/default`
  (VirtualMachineProtections_Get / _CreateOrUpdate) describing the protection
  type configured for a virtual machine.
- New `vmProtection` property on ResiliencyProfile.
- New long-running POST action `virtualMachines/{vmName}/restore` to restore
  a virtual machine's disks from a platform restore point.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@microsoft-github-policy-service microsoft-github-policy-service Bot added Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. labels Oct 14, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution nehalR12! We will review the pull request and get back to you soon.

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 7 pipeline(s).
8 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ The suppressions added to the AutoRest config files (README.mds) require review. Refer to step 1 in the PR workflow diagram, or to step 3, depending on the kind of suppression you did.
  • ❌ This PR introduced or changed TypeSpec suppressions that require review.
    Check the TypeSpec suppressions requiring review comment on this PR for the list of suppressions, their justifications, and source locations.
    Reviewers: apply the typespec-suppressions-approved label after confirming every justification is acceptable.


Comment generated by summarize-checks workflow run.

@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Contributor readiness: required access

Warning

Access issues can block approvals, Azure DevOps pipelines, or labeling.

User / area Access issue PR impact
🔴 nehalR12 Azure membership not public.
No repository write access.
Cannot run Azure DevOps pipelines.
Cannot add PR labels.
🔴 nehalreshu Azure membership not public.
No repository write access.
Not determined.

Internal contributors: set up / renew access. Recheck: /azsdk check-access.

Non-blocking check; fix access issues to unblock affected actions.

Last updated: 2026-11-02T20:41:25.729Z

@github-actions github-actions Bot added the typespec-suppressions-review-required PR reviewer must review all reported typespec suppressions label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

TypeSpec suppressions requiring review

Status: ❌ Approval required — 3 suppressions

This PR adds or updates the TypeSpec suppressions listed below. Suppressions are strongly discouraged — they bypass linter rules that protect API quality and consistency. Authors should avoid adding new suppressions and prefer fixing the underlying issue; reviewers should approve only when there is a clear, compelling justification and no reasonable alternative. Review each linked rule and source location, then apply typespec-suppressions-approved only if every justification is acceptable. The Status column shows ✅ once the label is applied and ❌ while approval is pending.

New suppressions (3)

StatusRuleSourceJustification
❌@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes
Ensure put operations have the appropriate status codes.
VirtualMachineProtection.tsp#L51CRP returns 200 for synchronous updates and 202 for asynchronous updates to the always-addressable protection singleton.
❌@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state
Check for properly configured provisioningState property.
models.tsp#L5735CRP never returns Canceled for the VirtualMachineProtection singleton, so only the states the service returns are listed.
❌@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation
Check for resources that must have a delete operation.
VirtualMachineProtection.tsp#L37The singleton protection resource is always addressable. Protection is disabled by updating protectionType to None rather than deleting the resource.

For an overview of TypeSpec linting rules click here.
For a mapping from ARM lintdiff rules to corresponding TypeSpec linting rules click here.

💬 Have feedback on the TypeSpec suppression flow? Let us know.

@github-actions

github-actions Bot commented Oct 14, 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
Go sdk/resourcemanager/compute/armcompute
JavaScript @azure/arm-compute
Python azure-mgmt-compute
Java com.azure.resourcemanager:azure-resourcemanager-compute
C# Azure.ResourceManager.Compute

Comment generated by After APIView workflow run.

"properties": {
"protectionType": "Basic",
"provisioningState": "Succeeded",
"configuration": {

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.

why are these nested inside configuration?

* The platform-managed protection configuration.
*/
@visibility(Lifecycle.Read)
configuration?: VirtualMachineProtectionConfiguration;

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.

this doesn't match the CRP api model, please check.

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.

The service returns restorePointCollectionId and backupResourceId directly under properties, not under properties.configuration

*/
#suppress "@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state" "Consistent with established Compute RP patterns (e.g. DedicatedHost, VirtualMachine, CapacityReservation) for SDK and behavioral consistency."
@visibility(Lifecycle.Read)
provisioningState?: string;

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.

I think we can model the enum values to string here and not suppress

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.

To clarify: define the provisioning states as a union instead of a plain string, e.g. union VirtualMachineProtectionProvisioningState { string, ResourceProvisioningState, Creating: "Creating", Deleting: "Deleting" }. That removes the suppression.

@bhnayyar bhnayyar left a comment •

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.

added comments

"$ref": "#/definitions/VirtualMachineProtection"
}
},
"201": {

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.

validate what we actually send in CRP response, I think its 202.

nehalreshu and others added 4 commits October 29, 2026 11:54
- Align the protection PUT with service behavior: 200 for synchronous updates, 202 with Azure-AsyncOperation/Location for asynchronous updates, final state via original-uri.
- Flatten restorePointCollectionId/backupResourceId into read-only properties and remove VirtualMachineProtectionConfiguration.
- Add an extensible provisioningState union (Creating/Updating/Deleting plus terminal states).
- Update examples to match service responses and add a CreateOrUpdate None example.
- Add LintDiff suppressions for the protection PUT (PutResponseCodes, ProvisioningStateSpecifiedForLROPut) and clarify the restore PostResponseCodes reason.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 50dcfb8d-870b-4950-a36f-63b0ace68c4b
…eProtection

CRP never sends Retry-After on the vmProtection PUT 202 and never sets the
Canceled provisioning state, so remove both from the 2026-09-01 spec.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 50dcfb8d-870b-4950-a36f-63b0ace68c4b
…026-09-01

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 50dcfb8d-870b-4950-a36f-63b0ace68c4b
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 50dcfb8d-870b-4950-a36f-63b0ace68c4b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved-Avocado Compute customer-reported Issues that are reported by GitHub users external to the Azure organization. resource-manager SuppressionReviewRequired TypeSpec Authored with TypeSpec typespec-suppressions-review-required PR reviewer must review all reported typespec suppressions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants