Hi @Alok Maheshwari ,
Welcome to Microsoft Q&A! Thanks for posting the question.
You may use a combination of following features of Bicep to add conditional logic to your template:
1. Deploy Conditon - This helps you to conditionally deploy resource.
2. Default Values of Parameters - The default value is used when a value is not provided during deployment.
Here are some Microsoft learn modules to help you understand it in detail:
1. Build flexible Bicep templates by using conditions and loops
2. Add flexibility by using parameters and variables
---
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.