If we want to create the traffic manager with ARM and config azureEndpoints
endpoint. We no need to add location property. We can get that by target resource id, The following is my test code, it works correctly for me.
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"variables": {
"tmApiVersion": "2015-11-01"
},
"resources": [
{
"apiVersion": "[variables('tmApiVersion')]",
"type": "Microsoft.Network/trafficManagerProfiles",
"name": "azureendpointexample",
"location": "global",
"properties": {
"profileStatus": "Enabled",
"trafficRoutingMethod": "Performance",
"dnsConfig": {
"relativeName": "azureendpointexample",
"ttl": 30
},
"monitorConfig": {
"protocol": "http",
"port": 80,
"path": "/"
},
"endpoints": [
{
"name": "tomtest",
"type": "Microsoft.Network/trafficManagerProfiles/azureEndpoints",
"properties": {
"endpointStatus": "Enabled",
"endpointMonitorStatus": null,
"targetResourceId": "[resourceId('resourcegroup', 'Microsoft.Web/sites/', 'websitename')]",
"target": "azureendpointexample.azurewebsites.net",
"weight": 1,
"priority": 1
}
}
]
}
}
]
}
Check it from the Azure portal
.