Summary
When kars up targets an existing resource group, it strips every tag from that group. Tags applied before the run are gone afterwards.
Version
@kars-runtime/cli@0.1.26
Reproduction
az group create -n <rg> -l <region> \
--tags owner=someone environment=poc expiry=2026-11-30 cost-center=1234
az group show -n <rg> --query tags # 4 tags
npx @kars-runtime/cli@0.1.26 up --resource-group <rg> ... --yes
az group show -n <rg> --query tags # empty
Observed on every run, including runs that later failed for unrelated reasons — so the stripping happens early, around the step that logs Resource group '<rg>' ready.
Impact
- Cost attribution breaks. Tag-based cost allocation in Azure Cost Management silently stops working for the group.
- Governance tooling breaks. Policies and automation keyed on tags such as owner, expiry, environment or data-classification stop matching.
- Safety tooling can break closed. Teardown guards that assert an expected tag before permitting destructive operations will refuse to run after a deploy, which is the safe direction but still a surprise.
Azure resource-group tag updates are last-write-wins on a full replace, so a PUT that omits existing tags removes them. A merge (az group update --set tags.x=y, or the ARM equivalent) preserves them.
Suggested fix
When the resource group already exists, either leave its tags untouched or merge kars's own tags into the existing set rather than replacing it. If replacement is intentional, it should be documented and ideally opt-in.
Summary
When
kars uptargets an existing resource group, it strips every tag from that group. Tags applied before the run are gone afterwards.Version
@kars-runtime/cli@0.1.26Reproduction
Observed on every run, including runs that later failed for unrelated reasons — so the stripping happens early, around the step that logs
Resource group '<rg>' ready.Impact
Azure resource-group tag updates are last-write-wins on a full replace, so a
PUTthat omits existing tags removes them. A merge (az group update --set tags.x=y, or the ARM equivalent) preserves them.Suggested fix
When the resource group already exists, either leave its tags untouched or merge kars's own tags into the existing set rather than replacing it. If replacement is intentional, it should be documented and ideally opt-in.