Bicep documentation is thorough, and it’s worth getting to know your way around it if you plan on using Bicep a lot. Have a look at:
deployment functions
defining outputs
Need more? Here’s the solution.