HariHaran
HariHaran

Reputation: 4199

arm template functions not working with default values

I am deploying a bunch of resources from Arm template. I am trying to provide the resource name unique by using this "[uniqueString(subscription().subscriptionId)]" . I have the templates hosted in github and using the Deploy to Azure button am trying to deploy, but the site just shows the plain string with the function and not the value. Any idea would be appreciated.

Between here's my code

"parameters": {
    "functionAppName": {
      "type": "string",
      "metadata": {
        "description": "Name of the function app"
      },
      "defaultValue": "[concat('asfnapp',uniqueString(resourceGroup().id))]"
    }
   }

I have the rest of the parameters in the same way.

Edit : Added repository URL - GITHUB

enter image description here

Upvotes: 4

Views: 1309

Answers (1)

bmoore-msft
bmoore-msft

Reputation: 8737

Ok, I thought you were referring to one of the templates in the QuickStart repo - they all (by default) go through this UX: https://ms.portal.azure.com/#create/Microsoft.Template

it looks like you're not using that UX - and I suspect that what you're using does not handle expressions in parameters (just assumes they are strings). So nothing you can do to fix that (your template is fine).

A workaround would be to use this:

https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fhariharan618%2Ftest%2Fmaster%2Fazuredeploy.json

Upvotes: 1

Related Questions