Skip to content

Commit f54ba99

Browse files
authored
Merge pull request #102420 from mumian/0127-resourceid
0127 resourceid
2 parents 4f17670 + a44a2f2 commit f54ba99

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

articles/azure-resource-manager/templates/error-not-found.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ In the reference function, use `Full` to get all of the properties including the
9292
For example, to get the tenant ID for a managed identity that is applied to a virtual machine scale set, use:
9393

9494
```json
95-
"tenantId": "[reference(concat('Microsoft.Compute/virtualMachineScaleSets/', variables('vmNodeType0Name')), variables('vmssApiVersion'), 'Full').Identity.tenantId]"
95+
"tenantId": "[reference(resourceId('Microsoft.Compute/virtualMachineScaleSets', variables('vmNodeType0Name')), variables('vmssApiVersion'), 'Full').Identity.tenantId]"
9696
```

articles/azure-resource-manager/templates/templates-cloud-consistency.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ In general, avoid hardcoded endpoints in a template. The best practice is to use
444444
The following reference template function retrieves the endpoint namespace from the storage resource provider:
445445

446446
```json
447-
"diskUri":"[concat(reference(concat('Microsoft.Storage/storageAccounts/', variables('storageAccountName')), '2015-06-15').primaryEndpoints.blob, 'container/myosdisk.vhd')]"
447+
"diskUri":"[concat(reference(resourceId('Microsoft.Storage/storageAccounts', variables('storageAccountName'))).primaryEndpoints.blob, 'container/myosdisk.vhd')]"
448448
```
449449

450450
By replacing the hardcoded value of the storage account endpoint with the `reference` template function, you can use the same template to deploy to different environments successfully without making any changes to the endpoint reference.

0 commit comments

Comments
 (0)