@Sourav Thanks for reaching out. You can achieve this by using parameters in your ARM templates. Instead of hardcoding the resource names in the template, you can define parameters for the parts of the name that change per environment. Here’s an example of how you can modify your template:
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"environment": {
"type": "string",
"metadata": {
"description": "The name of the environment. e.g. dev, demo"
}
}
},
"variables": {
"serviceBusName": "[concat('sb-planability-', parameters('environment'))]"
},
...
}
In this template, environment
is a parameter that you provide when deploying the template. The serviceBusName
variable concatenates ‘sb-planability-’ with the value of the environment
parameter. This way, you can use the same template for different environments by just changing the environment
parameter during deployment.
For example, if you want to deploy to the dev environment, you would provide ‘dev’ as the environment
parameter.
do let me know incase of further queries, I would be happy to assist you.