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.