Bicep should not require an intermediate temp folder #14439
-
Per #14403, a temp folder is used to copy all bicep files during a deployment (which currently only copies the main file). I'd like to understand why this is necessary, it's not like the files are locked or anything, and the bicep compiler works just fine accepting a direct bicep file and then finding the relative other bicep files as modules. It should instead just work with the files in-place. Specifically here: Since you are just calling bicep build anyways, you should instead of saving it to a file use the Alternatively if you want a json file and can't handle accepting the stream, you can use However, honestly you should just be incorporating and using the Bicep .NET APIs rather than the CLI command. See https://github.com/StefanIvemo/BicepPowerShell/blob/main/Source/Private/ParseBicep.ps1 for an implementation example (in powershell but easy to convert to C#)
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi JustinGrote, Thank you for your insights, it helps me a lot. The reasons why a temp folder is used to copy all bicep files during a deployment are as following:
Reviewed our current situation, I agree with you it is unnecessary to copy all bicep files to a temp folder. Redirect the output path by --outdir is a good idea. And we will evaluate the pros and cons about using the Bicep .NET APIs. Thanks again, |
Beta Was this translation helpful? Give feedback.
-
This was resolved with #14444. Thank you @BethanyZhou! |
Beta Was this translation helpful? Give feedback.
This was resolved with #14444. Thank you @BethanyZhou!