Skip to content

Commit 70e3899

Browse files
committed
Updates with CLI
1 parent cd35cb3 commit 70e3899

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

includes/virtual-machines-disks-incremental-snapshot.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,32 @@ You can also use Azure Resource Manager templates to create an incremental snaps
106106
}
107107
```
108108

109+
## CLI
110+
111+
You can create an incremental snapshot with the Azure CLI using [az snapshot create](https://docs.microsoft.com/en-us/cli/azure/snapshot?view=azure-cli-latest#az-snapshot-create). An example command would look like the following:
112+
113+
```bash
114+
az snapshot create -g <exampleResourceGroup> \
115+
-n <exampleSnapshotName> \
116+
-l <exampleLocation> \
117+
--source <exampleVMId> \
118+
--incremental
119+
```
120+
121+
You can also identify what snapshots are incremental snapshots in the CLI with by using the `--query` parameter on [az snapshot show](https://docs.microsoft.com/en-us/cli/azure/snapshot?view=azure-cli-latest#az-snapshot-show). You can use that parameter to directly query the **SourceResourceId** and **SourceUniqueId** properties of snapshots. SourceResourceId is the Azure Resource Manager resource id of the parent disk. **SourceUniqueId** is the value inherited from the **UniqueId** property of the disk. If you delete a disk and then create a disk with the same name, the value of the **UniqueId** property will change.
122+
123+
Examples of either queries would look like the following:
124+
125+
```bash
126+
az snapshot show -g <exampleResourceGroup> \
127+
-n <yourSnapShotName> \
128+
--query [creationData.sourceResourceId] -o tsv
129+
130+
az snapshot show -g <exampleResourceGroup> \
131+
-n <yourSnapShotName> \
132+
--query [creationData.sourceUniqueId] -o tsv
133+
```
134+
109135
## Next steps
110136

111137
If you haven't yet signed up for the preview and you'd like to start using incremental snapshots, please email us at [email protected] to get access to the public preview.

0 commit comments

Comments
 (0)