Azure ARM template concat with resourceId

Hi I am working in Azure ARM template. I am trying to get app url and add some string at the end.

 {
   "name": "HealthCheck__SwaggerUrl",
   "value": "[concat(resourceId('Microsoft.Web/sites', variables('appServiceNameApi'), '2018-02-01').defaultHostName), '/swagger/v1/swagger.json']"
 }

I am trying to get app service url and append /swagger/v1/swagger.json. Above statement gives me error

Deployment template language expression evaluation failed: 'Unable to parse language expression 'concat(resourceId('Microsoft.Web/sites', variables('appServiceNameApi'), '2018-02-01').defaultHostName), '/swagger/v1/swagger.json'': expected token 'EndOfData' and actual 'Comma'.'. 

I am not able to get the root cause of this issue. Can someone help me to identify the issue. Any help would be greatly appreciated. Thank you

Upvotes: 1

Views: 1253

Answers (1)

Stringfellow
Stringfellow

Reputation: 2908

Update to use reference.

 {
   "name": "HealthCheck__SwaggerUrl",
   "value": "[concat(reference(resourceId('Microsoft.Web/sites', variables('appServiceNameApi')), '2018-02-01').defaultHostName, '/swagger/v1/swagger.json')]"
 }

Upvotes: 2

Related Questions