Skip to content

Azure/BICEP - Please suggest me how can I can accomplish below scenarios. #4168

Answered by brwilkinson
HariRajan2014 asked this question in Q&A
Discussion options

You must be logged in to vote

I would recommend to simply bring the variable to your main.bicep

var rgname = '${resourcerole}-${environmentName}-${rglocation}-rg'

That way you can easily reference it where you need it.

or what I prefer is:

var deployment = '${resourcerole}-${environmentName}-${rglocation}'
var rgName = '${deployment}-rg'

Here your deployment states your naming standard that will be the base for naming other resources. So it's easily to derive the rgname if you know the deployment.

This is something you can view in these templates, however look for:

var Deployment = '${Prefix}-${Global.OrgName}-${Global.Appname}-${Environment}${DeploymentID}'

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
3 replies
@HariRajan2014
Comment options

@brwilkinson
Comment options

@HariRajan2014
Comment options

Answer selected by brwilkinson
Comment options

You must be logged in to vote
3 replies
@HariRajan2014
Comment options

@brwilkinson
Comment options

@brwilkinson
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants