From 6de2c3d1169e76a6bd4cfb69eb70010629c9868c Mon Sep 17 00:00:00 2001 From: Rui Zhan Date: Mon, 8 Jun 2026 10:27:06 -0700 Subject: [PATCH 1/2] doc --- .../Microsoft.Compute/Compute/ComputeDisk/Snapshot.tsp | 5 ++++- .../Microsoft.Compute/Compute/ComputeDisk/models.tsp | 10 ++++++++-- .../Compute/stable/2026-03-02/DiskRP.json | 6 +++--- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/Snapshot.tsp b/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/Snapshot.tsp index 92998ca8398e..0158b8c27e3f 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/Snapshot.tsp +++ b/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/Snapshot.tsp @@ -139,7 +139,10 @@ interface Snapshots { >; /** - * Locks the immutability policy of a snapshot. Once locked, the policy cannot be reduced or removed until the lock period expires. + * Locks or updates the immutability policy of a snapshot. This action requires elevated roles such as 'Owner' or 'Administrator'. + * When type is set to 'Locked', the policy is locked and the immutability duration cannot be reduced until expiry. + * When type is set to 'Unlocked', the policy is set or updated as an unlocked policy — this is functionally equivalent to calling + * updateImmutabilityPolicy, but requires elevated privileges. This action has all the privileges of updateImmutabilityPolicy. */ @added(Versions.v2026_03_02) @action("updateImmutabilityPolicyLock") diff --git a/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp b/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp index 001d3af21fc9..cba3e2559162 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp +++ b/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp @@ -1174,7 +1174,10 @@ model ImmutabilityPolicyData { } /** - * Data used for locking the immutability policy of a snapshot. + * Data used for locking the immutability policy of a snapshot. This action has elevated privileges and can both lock and unlock policies. + * When type is set to 'Locked', the policy is locked and cannot be reduced until expiry. When type is set to 'Unlocked', the policy is + * set or updated as an unlocked policy, equivalent to calling updateImmutabilityPolicy. This action requires elevated roles such as + * 'Owner' or 'Administrator' regardless of the type value. */ @added(Versions.v2026_03_02) model ImmutabilityPolicyLockData { @@ -1185,7 +1188,10 @@ model ImmutabilityPolicyLockData { immutabilityDurationDays: int32; /** - * The type of the immutability policy. 'Unlocked' allows the policy to be modified by privileged users; 'Locked' prevents reduction of the immutability duration but allows extension of the lock period. + * The type of the immutability policy to apply. When set to 'Locked', the policy is locked and the immutability duration cannot be + * reduced (only extended). When set to 'Unlocked', the policy is set or updated as an unlocked policy — this is functionally equivalent + * to calling updateImmutabilityPolicy but requires the elevated privileges of the lock action. Both values are accepted because + * updateImmutabilityPolicyLock has all the privileges of updateImmutabilityPolicy. */ type: ImmutabilityPolicyType; } diff --git a/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json b/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json index efd52c000ccd..c68fe44283ca 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json +++ b/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json @@ -2561,7 +2561,7 @@ "tags": [ "Snapshots" ], - "description": "Locks the immutability policy of a snapshot. Once locked, the policy cannot be reduced or removed until the lock period expires.", + "description": "Locks or updates the immutability policy of a snapshot. This action requires elevated roles such as 'Owner' or 'Administrator'.\nWhen type is set to 'Locked', the policy is locked and the immutability duration cannot be reduced until expiry.\nWhen type is set to 'Unlocked', the policy is set or updated as an unlocked policy — this is functionally equivalent to calling\nupdateImmutabilityPolicy, but requires elevated privileges. This action has all the privileges of updateImmutabilityPolicy.", "parameters": [ { "$ref": "../../../../../../common-types/resource-management/v3/types.json#/parameters/ApiVersionParameter" @@ -4281,7 +4281,7 @@ }, "ImmutabilityPolicyLockData": { "type": "object", - "description": "Data used for locking the immutability policy of a snapshot.", + "description": "Data used for locking the immutability policy of a snapshot. This action has elevated privileges and can both lock and unlock policies.\nWhen type is set to 'Locked', the policy is locked and cannot be reduced until expiry. When type is set to 'Unlocked', the policy is\nset or updated as an unlocked policy, equivalent to calling updateImmutabilityPolicy. This action requires elevated roles such as\n'Owner' or 'Administrator' regardless of the type value.", "properties": { "immutabilityDurationDays": { "type": "integer", @@ -4291,7 +4291,7 @@ }, "type": { "$ref": "#/definitions/ImmutabilityPolicyType", - "description": "The type of the immutability policy. 'Unlocked' allows the policy to be modified by privileged users; 'Locked' prevents reduction of the immutability duration but allows extension of the lock period." + "description": "The type of the immutability policy to apply. When set to 'Locked', the policy is locked and the immutability duration cannot be\nreduced (only extended). When set to 'Unlocked', the policy is set or updated as an unlocked policy — this is functionally equivalent\nto calling updateImmutabilityPolicy but requires the elevated privileges of the lock action. Both values are accepted because\nupdateImmutabilityPolicyLock has all the privileges of updateImmutabilityPolicy." } }, "required": [ From 2ed0a01e965ef9be4c62ba8ee526c8a5aaf4714b Mon Sep 17 00:00:00 2001 From: Rui Zhan Date: Tue, 9 Jun 2026 21:26:40 -0700 Subject: [PATCH 2/2] Change immutabilityDurationDays minimum from 1 to 0 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .../Microsoft.Compute/Compute/ComputeDisk/models.tsp | 2 +- .../Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp b/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp index cba3e2559162..4da16fb685b7 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp +++ b/specification/compute/resource-manager/Microsoft.Compute/Compute/ComputeDisk/models.tsp @@ -1164,7 +1164,7 @@ model ImmutabilityPolicyData { /** * The immutability duration for the snapshot, in number of days. */ - @minValue(1) + @minValue(0) immutabilityDurationDays: int32; /** diff --git a/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json b/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json index c68fe44283ca..8b7ab9842945 100644 --- a/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json +++ b/specification/compute/resource-manager/Microsoft.Compute/Compute/stable/2026-03-02/DiskRP.json @@ -4267,7 +4267,7 @@ "type": "integer", "format": "int32", "description": "The immutability duration for the snapshot, in number of days.", - "minimum": 1 + "minimum": 0 }, "type": { "$ref": "#/definitions/ImmutabilityPolicyType",