Skip to content

Commit 94890e9

Browse files
author
Henry Dai
committed
Update CLI to rename changeRecords for 2026-01-01-repview
1 parent 8d51e56 commit 94890e9

3 files changed

Lines changed: 203 additions & 282 deletions

File tree

src/azure-changesafety/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ az changesafety changerecord show # Display details for a ChangeRecord resour
1919
Run `az changesafety changerecord -h` to see full parameter details and examples.
2020

2121
## Examples
22-
Create a ChangeRecord for a manual touch operation (e.g., Deletes a traffic manager profile):
22+
Create a ChangeRecord for a manual touch operation (e.g., delete a Traffic Manager profile):
2323
```bash
2424
az changesafety changerecord create \
2525
-g MyResourceGroup \
26-
-n changerecord-vm-maintenance \
26+
-n changerecord-delete-tm \
2727
--change-type ManualTouch \
28-
--rollout-type Normal \
29-
--targets "subscriptionId=<subId>,operation=DELETES" \
28+
--rollout-type Hotfix \
29+
--targets "resourceId=/subscriptions/<subId>/resourceGroups/MyResourceGroup/providers/Microsoft.Network/trafficManagerProfiles/myProfile,operation=DELETE" \
30+
--description "Delete Traffic Manager profile for maintenance"
3031
```
3132

3233
Create a ChangeRecord for an app deployment with a StageMap reference:

src/azure-changesafety/azext_changesafety/_help.py

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,23 @@
2727
Provide at least one target definition to describe which resources or operations the ChangeRecord
2828
will affect. Targets are expressed as comma or semicolon separated key=value pairs such as
2929
resourceId=RESOURCE_ID,operation=DELETE. The command is also available through the alias
30-
`az changesafety changerecord`. If you omit scheduling flags, the anticipated start time defaults
31-
to now and the anticipated end time defaults to eight hours later (UTC).
30+
`az changesafety changerecord`. If you omit scheduling flags, the anticipated start time
31+
defaults to now and the anticipated end time defaults to eight hours later (UTC).
3232
parameters:
3333
- name: --targets
3434
short-summary: >
3535
One or more target definitions expressed as key=value pairs (for example
36-
resourceId=RESOURCE_ID,operation=CREATE,resourceType=Microsoft.Compute/virtualMachines).
36+
resourceId=RESOURCE_ID,operation=DELETE,resourceType=Microsoft.Compute/virtualMachines).
37+
- name: --description
38+
short-summary: A description of the change being performed.
3739
- name: --anticipated-start-time
3840
short-summary: Expected start time in ISO 8601 format. Defaults to current UTC time when omitted.
3941
- name: --anticipated-end-time
4042
short-summary: Expected completion time in ISO 8601 format. Defaults to eight hours after the anticipated start time when omitted.
4143
- name: --change-type
4244
short-summary: Classify the change such as AppDeployment, Config, ManualTouch, or PolicyDeployment.
4345
- name: --rollout-type
44-
short-summary: Specify the rollout urgency (Normal, Hotfix, or Emergency).
46+
short-summary: Specify the rollout type (Normal, Hotfix, or Emergency).
4547
- name: --stage-map-name --stagemap-name
4648
short-summary: StageMap name in the current subscription scope; the resource ID is built for you.
4749
- name: --stage-map
@@ -53,12 +55,15 @@
5355
text: |-
5456
az changesafety changerecord create -g MyResourceGroup -n changerecord002 --change-type ManualTouch --rollout-type Normal --stage-map "{resource-id:/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.ChangeSafety/stageMaps/rolloutStageMap}" --targets "resourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm,operation=PATCH" --links "[{name:status,uri:'https://contoso.com/change/rollout-002'}]"
5557
az changesafety changerecord delete -g MyResourceGroup -n changerecord002 --yes
56-
- name: Create a change state for a VM rollout
58+
- name: Create a ChangeRecord for a VM rollout
5759
text: |-
5860
az changesafety changerecord create -g MyResourceGroup -n changerecord001 --change-type AppDeployment --rollout-type Normal --targets "resourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm,operation=PUT"
61+
- name: Create a ChangeRecord for deleting a Traffic Manager profile
62+
text: |-
63+
az changesafety changerecord create -g MyResourceGroup -n delete-trafficmanager --change-type ManualTouch --rollout-type Hotfix --targets "resourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Network/trafficManagerProfiles/myProfile,operation=DELETE" --description "Delete Traffic Manager profile"
5964
- name: Create with staging rollout configuration
6065
text: |-
61-
az changesafety changerecord create -g MyResourceGroup -n changerecord-ops01 --rollout-type Hotfix --targets "resourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Web/sites/myApp,operation=POST"
66+
az changesafety changerecord create -g MyResourceGroup -n changerecord-ops01 --change-type AppDeployment --rollout-type Hotfix --targets "resourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Web/sites/myApp,operation=POST"
6267
- name: Reference a StageMap by name
6368
text: |-
6469
az changesafety changerecord create -g MyResourceGroup -n changerecord003 --change-type ManualTouch --rollout-type Normal --stagemap-name rolloutStageMap --targets "resourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Compute/virtualMachines/myVm,operation=DELETE"
@@ -68,20 +73,17 @@
6873
type: command
6974
short-summary: Update an existing ChangeRecord resource.
7075
long-summary: >
71-
Use this command to modify descriptive metadata, rollout settings, or replace targets for an
72-
existing ChangeRecord. When you pass --targets, the supplied definitions overwrite the previous set.
73-
This command is also available through the alias `az change-safety change-record`.
76+
Use this command to modify descriptive metadata, rollout settings, or scheduling for an
77+
existing ChangeRecord. Note: The changeDefinition (targets) cannot be modified after creation.
7478
parameters:
75-
- name: --targets
76-
short-summary: >
77-
Optional target definitions to replace the existing list. Provide key=value pairs such as
78-
resourceId=RESOURCE_ID,operation=DELETE.
7979
- name: --stage-map-name --stagemap-name
8080
short-summary: StageMap name in the current subscription scope; the resource ID is built for you.
8181
- name: --stage-map
8282
short-summary: Reference an existing StageMap resource using resource-id=RESOURCE_ID and optional parameters key=value pairs.
8383
- name: --comments
84-
short-summary: Provide notes about the latest update to the change state.
84+
short-summary: Provide notes about the latest update to the ChangeRecord.
85+
- name: --description
86+
short-summary: Update the description of the change.
8587
- name: --anticipated-start-time
8688
short-summary: Update the expected start time in ISO 8601 format. If omitted, the current value is preserved.
8789
- name: --anticipated-end-time
@@ -93,9 +95,9 @@
9395
- name: Update scheduling window
9496
text: |-
9597
az changesafety changerecord update -g MyResourceGroup -n changerecord001 --anticipated-start-time "2024-09-01T08:00:00Z" --anticipated-end-time "2024-09-01T12:00:00Z"
96-
- name: Replace the target definition
98+
- name: Update description
9799
text: |-
98-
az changesafety changerecord update -g MyResourceGroup -n changerecord001 --targets "resourceId=/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/MyResourceGroup/providers/Microsoft.Sql/servers/myServer,operation=PATCH"
100+
az changesafety changerecord update -g MyResourceGroup -n changerecord001 --description "Updated rollout for production deployment"
99101
"""
100102

101103
helps['changesafety changerecord delete'] = """

0 commit comments

Comments
 (0)