@codemod/arm-hardcoded-apiversion
Inline statically resolvable Azure Resource Manager (ARM) template resource apiVersion expressions as hard-coded string literals.
Installation
bash
Usage
This codemod targets ARM template JSON files and rewrites resource apiVersion values when the value can be resolved to a concrete string at codemod time.
- Rewrites
"apiVersion": "[parameters('name')]"when the referenced parameter has a stringdefaultValue - Rewrites
"apiVersion": "[variables('name')]"when the referenced variable resolves to a string literal - Rewrites
"apiVersion": "[concat(...)]"when every concat segment resolves to a string literal - Leaves unresolved expressions unchanged, including references without a string default and expressions that depend on runtime-only ARM functions
Example:
json
becomes:
json
Development
bash
License
MIT