Azure ARM 模板与 resourceId 连接

Azure ARM template concat with resourceId

您好,我正在使用 Azure ARM 模板。我正在尝试获取应用 url 并在末尾添加一些字符串。

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

我正在尝试获取应用程序服务 url 并附加 /swagger/v1/swagger.json。上面的语句给我错误

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'.'. 

我无法找到此问题的根本原因。有人可以帮我找出问题所在。任何帮助将不胜感激。谢谢

更新以使用 reference

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