Azure / Azure/deployment-stacks
CLI help for --retention-interval says 1 to 30 days but shorter values like PT3H are supported
- Dominant language
- Bicep
- Stars
- 101
- Forks
- 13
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
The `--retention-interval` help text for `az stack-whatif ... create` says the value must be between 1 day and 30 days:
```
--retention-interval --ri [Required] : The retention interval for What-If results. The
value must be in ISO 8601 format and between 1 day
and 30 days.
```
Values shorter than a day are accepted and work correctly. `PT3H` creates the result and persists as a retention interval of `3:00:00`.
This matters because `PT3H` or less is the recommended setting. Results at or under `PT3H` are cleaned up automatically, and longer lived results are not, so they accumulate against the 800 per scope limit until someone deletes them. The published docs now recommend `PT3H`, so the CLI help currently contradicts the guidance we're giving people.
**To Reproduce**
```
az stack-whatif group create \
--name "test-pt3h" \
--resource-group "" \
--stack-id "" \
--template-file "main.bicep" \
--action-on-unmanage "detachAll" \
--deny-settings-mode "none" \
--retention-interval "PT3H"
```
Succeeds. `az stack-whatif group show --name "test-pt3h" --resource-group "" --no-pretty-print` then reports `"retentionInterval": "3:00:00"`.
**Expected behavior**
The help text should reflect the range that's actually supported, and ideally point at `PT3H` or less as the recommended value.
**Additional context**
Seen on the `stack-whatif` extension bundled with az 2.88.0. Applies to the `group`, `sub` and `mg` variants, since they share the parameter description.
Docs for reference: [Preview deployment stack changes with what-if](https://learn.microsoft.com/azure/azure-resource-manager/bicep/deployment-stacks-what-if)
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.