Right-click any file in the VS Code Explorer and choose Replace GUIDs to write a copy of the file with every UUID/GUID replaced by a configurable value. GUIDs embedded inside longer strings (ARM resource ids, machine names, connection strings, ...) are replaced too. The original file is never modified.
Useful for anonymizing Azure resource/template exports (subscription ids, appliance ids, BIOS GUIDs) before sharing them or checking them in as test data.
- Right-click a file in the Explorer.
- Choose Replace GUIDs.
- A copy named
<prefix><original name>(default0guid-<original name>) is written next to the original, and a notification reports how many GUIDs were replaced.
The command is also available from the Command Palette and then applies to the file open in the active editor.
| Setting | Default | Description |
|---|---|---|
replaceGuids.replacementGuid |
00000000-0000-0000-0000-000000000000 |
The value every detected UUID/GUID is replaced with. |
replaceGuids.filePrefix |
0guid- |
Prefix added to the original file name for the scrubbed copy. |
replaceGuids.excludedGuids |
[] |
GUIDs that are left untouched instead of being replaced. |
Some GUIDs are well-known and worth keeping readable — Azure built-in role
definition ids, tenant ids of public services, fixed schema/namespace ids.
Add them to replaceGuids.excludedGuids and they survive the scrub.
Settings UI: Settings → Extensions → Replace GUIDs → Excluded Guids →
Add Item. Or edit settings.json directly to paste a batch:
Matching ignores case and optional {} braces, so a GUID only needs to be
listed once no matter how it is formatted in your files. The notification
reports how many GUIDs were kept because of this list.
cd replace-guids-extension
npx --yes @vscode/vsce packagecode --install-extension replace-guids.vsixOr in VS Code: Extensions view → ... menu → Install from VSIX...
VS Code ^1.85.0.
MIT
