How to write a variable/parameter to stdout?

Viewed 1581

I'm trying to debug my first Bicep template.

How can I just write a variable or parameter value to standard output?

Something like:

var hello = 'hello world!'
write-host(hello)
2 Answers

The best is to use module outputs which you can read from Portal. Module deployments are separate deployments visible in the "Deployments" section of resource group / subscription / etc. Even if the top-level deployment will fail, outputs from modules inside that were successful can be read, alongside parameters they took.

Remember, that bicep is a declarative language, not imperative, so the file is not being processed sequentially.

Related