The resourceId function generates resource identifiers that are well-formed, rather than via the manual concatenation of string values. There are no checks made while concatenating string variables, and a template will fail if there are any issues with the supplied values or the malformed resourceId. Instead, using resourceId will ensure that a proper resource identifier, including the subscription ID, resource group name, and resource information is generated. Using the resourceId function should be the preferred way of generating the resource identifier.
The next code statement in an ARM template builds a virtual machine resource identifier using string concatenation. This is a bad practice:
"[concat('/subscriptions/',subscription().subscriptionId,'/resourceGroups/',resourceGroup().name ,'/providers/','Microsoft...