4

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

HariHaran
  • 3,642
  • 2
  • 16
  • 33

1 Answers1

1

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

bmoore-msft
  • 8,376
  • 20
  • 22
  • Thanks for the reply between , Even in azure portal , the expressions are not handled :( -- > https://imgur.com/a/zGMErrT – HariHaran Sep 25 '18 at 04:18
  • 1
    your link worked fine for me... there are some cases where the portal tries to get "fancy" and validate the value as a string instead of expression (for example if you have a param named "dns*" - but you can work around those by fooling the blade (we're also working on fixing) – bmoore-msft Sep 26 '18 at 02:33
  • @bmoore-msft: The link is not working anymore and I have the same problem in my environment. Should this be fixed by now? – Froggy Jan 26 '22 at 15:01
  • What specifically are you seeing? – bmoore-msft Jan 27 '22 at 20:45