New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allows prompting for for bicep parameters that reference empty or not set environment variables #2896
Conversation
Does this also close this: #1910 |
Yes, I looked to see if this issue already existed but didn't find this one :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a little nervous about this change as is, just because I'm worried about how we are now using ${NIL}
as a way to signal to the prompting logic that it needs to prompt.
It was also unclear to me that this would actually end up working:
{
"parameters": {
"foo": {
"value": "${FOO-}"
},
}
}
My expectation in the above is that when FOO is unset, that we would allow this to convert into the empty string and then we would not prompt for this value. I think with the above change, we'd prompt here.
I also think that given the implementation, something like:
{
"parameters": {
"foo": {
"value": "The value of FOO is: ${FOO}"
},
}
}
Would end up having us prompt for the value, when FOO is unset (because we use contains?). I'm not sure if that's what we want.
I'm also wondering if given the implementation, this would fail in case where you tried to something like:
{
"parameters": {
"vmCpuCount": {
"value": "${VM_CPU_COUNT}"
},
}
}
If the vmCpuCount
parameter is of type number, and VM_CPU_COUNT is unset, are we going to do the right thing, or are we going to try to treat ${NIL}
as a number and blow up?
aa27b4c
to
c15dd21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is by design and not changed in this PR. When we do prompt the user for a value we offer them the opportunity to save the value. We don't know that the value expression in the |
@wbreza I was expecting the value 'something' because |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash:
pwsh:
WindowsPowerShell install
MSI install
Standalone Binary
MSIContainer
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Fixes #2895 & #1910
When
main.parameters.json
references an empty or not set value expressionazd
will prompt the user for a value unless the parameter also defines a default value.The only edge case scenario I could think of where this would be undesired is if the bicep param does define a non-empty default string value but the user explicitly wants to specify/override with an empty string.
Use Cases