loadTextContent() - parameter as input
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Is your feature request related to a problem? Please describe.**
I would like for loadTextContent() to support variable or parameter as input parameter. What I would like to offer is for the end user to specify text from file or to use the default file available. Currently if I use the below syntax I get error:
The value must be a compile-time constant.bicep(BCP032)
I know that function is being used at compile time so this will probably require some other approach and even changes in template spec for supporting it there as well.
```bicep
var alertRules = {
memoryLow: {
description: empty(bastionHostMonitoring.alertRules.memoryLow.descriptionFilePath) ? loadTextContent('alert-descriptions/memory-low.txt') : loadTextContent(bastionHostMonitoring.alertRules.memoryLow.descriptionFilePath)
}
}
```
Contributor guide
Research direction
Start with the loadTextContent() entry point and the BCP032 compile-time-constant diagnostic described in the issue. Review the requested template spec support as well. Done means users can choose either the supplied text-file path or the default file without the current error, with the required template-spec behavior addressed.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100