You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I have a powershell .ps1 script that I want to use to do some advanced calculations and return some outputs (subnet math). Currently I have to embed the script in the arm template with ScriptContent or awkwardly place it on a github script URI which makes it less portable and more difficult to locally test changes.
Ideally I could keep the .ps1 as a separate file (so I can unit test it with pester and whatnot) and then at bicep compilation pull it in as a string to ScriptContent. Currently I am doing this with a separate powershell step after the bicep compilation but it would be nice to have it native in the bicep template.
Describe the solution you'd like
To keep this generic, a bicep expression that will read a file and output it as a string. That way it could be used outside of just deploymentscripts, basically a cat operator though the name maybe should be file or something, I'll leave to the team to decide.
Concerns
Should expressions in the file be preserved or escaped? Since Powershell often uses ${} syntax. I say escaped and you can sub in expressions with the format operator if you need to (maybe)? Maybe an operator true/false parameter? EDIT: For Powershell at least, expressions can be replaced by using the arguments parameter, but something like UserData may still need a way to substitute in expressions.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
I have a powershell .ps1 script that I want to use to do some advanced calculations and return some outputs (subnet math). Currently I have to embed the script in the arm template with ScriptContent or awkwardly place it on a github script URI which makes it less portable and more difficult to locally test changes.
Ideally I could keep the .ps1 as a separate file (so I can unit test it with pester and whatnot) and then at bicep compilation pull it in as a string to ScriptContent. Currently I am doing this with a separate powershell step after the bicep compilation but it would be nice to have it native in the bicep template.
Describe the solution you'd like
To keep this generic, a bicep expression that will read a file and output it as a string. That way it could be used outside of just deploymentscripts, basically a
cat
operator though the name maybe should befile
or something, I'll leave to the team to decide.Concerns
arguments
parameter, but something like UserData may still need a way to substitute in expressions.The text was updated successfully, but these errors were encountered: