0
votes

I am getting the following error when implementing ARM template with availability set '/subscriptions/xxx/resourceGroups/mgRG/providers/Microsoft.Compute/virtualMachines/myVM'. "Unable to evaluate template language function 'resourceId': all function arguments must be string literals"

"availabilitySet": {
                    "id": "[resourceId(subscription(),parameters('RGName'),'Microsoft.Compute/availabilitySets',variables('ASName'))]"

I tried to remove subscription() from parameters, didn't help. I have to keep parameters('RGName') because it is not current Resource Group.

1

1 Answers

1
votes

well, it is what it is, it only accepts strings.

  1. subscription() would return an object, not a string
  2. since you are using subscription() it means you are targeting the same subscription, you can just drop this part
  3. parameters('RGName') - is only needed if the resource is in another resource group. It has to be a string as well
  4. variables('ASName') - has to be a string as well.

if it complains something is not a string, than something is not a string :)