We have an Azure ARM template, which is adding appsettings for a Microsoft.Web/site.
"resources": [
{
"apiVersion": "2016-03-01",
"name": "myazurefunction",
"type": "Microsoft.Web/sites",
"properties": {
"name": "myazurefunction",
"siteConfig": {
"appSettings": [
{
"name": "MY_SERVICE_URL",
"value": "[concat('https://myservice-', parameters('env'), '.domain.ca')]"
}
]
}
}
}
]
We also have four parameters.environment.json files. For instance, this is the content of parameters.dev.json.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01...",
"contentVersion": "1.0.0.0",
"parameters": {
"env": {
"value": "dev"
}
}
}
The template and its parameters favor convention over configuration. This is working nicely for the most part, and leads to the following MY_SERVICE_URL values.
- https://myservice-dev.domain.ca
- https://myservice-qa.domain.ca
- https://myservice-ci.domain.ca
- https://myservice-prod.domain.ca
The problem is that we want to break the convention for the dev environment. That is, we want it to have a MY_SERVICE_URL that looks something like this:
How can we configure the ARM template to break the convention for only one environment?
My first though is to use a conditional like this, but such an ARM function appears not to be available.
"name": "MY_SERVICE_URL",
"value": "[parameters('env') -eq 'dev'
? 'https://abc123.foo.bar.baz.ca'
: concat('https://myservice-', parameters('env'), '.domain.ca')]"