I am attempting to add an endpoint to an existing Azure Traffic Manager. When deploying the template below with New-AzureRmResourceGroupDeployment
it erases previous endpoint configurations.
Is it possible to add an endpoint to an existing Traffic Manager through ARM templates without removing the previous ones? Or is the recommendation to use the Azure PowerShell client instead?
{
"$schema": "http://schema.management.azure.com/schemas/2014-04-01-preview/deploymentTemplate.json",
"contentVersion": "1.0.0.0",
"parameters": {
"trafficManagerName": {
"type": "String"
},
"webAppName": {
"type": "String"
},
"webAppLocationRegion": {
"type": "String"
},
"monitorPath": {
"type": "String"
}
},
"resources": [
{
"type": "Microsoft.Network/trafficManagerProfiles",
"name": "[parameters('trafficManagerName')]",
"apiVersion": "2017-05-01",
"location": "global",
"properties": {
"profileStatus": "Enabled",
"trafficRoutingMethod": "Performance",
"dnsConfig": {
"relativeName": "[parameters('trafficManagerName')]",
"ttl": 70
},
"monitorConfig": {
"protocol": "HTTPS",
"port": 443,
"path": "[parameters('monitorPath')]"
},
"endpoints": [
{
"name": "[parameters('webAppName')]",
"type": "Microsoft.Network/trafficManagerProfiles/azureEndpoints",
"properties": {
"endpointStatus": "Enabled",
"targetResourceId": "[resourceId('Microsoft.Web/sites', parameters('webAppName'))]",
"weight": 1,
"priority": 1,
"endpointLocation": "[parameters('webAppLocationRegion')]"
}
}
]
}
}
]
}
As an analogy, it is possible to incrementally add access policies to Azure Key Vault like so:
{
"type": "Microsoft.KeyVault/vaults/accessPolicies",
"name": "[concat(parameters('keyVaultSettings').name, '/add')]", <!-- notice the "/add" -->
"apiVersion": "2015-06-01",
"properties": {
"mode": "Incremental",
"accessPolicies": [
{
"tenantId": "[reference(concat(resourceId('Microsoft.Web/sites', parameters('webAppName')),'/providers/Microsoft.ManagedIdentity/Identities/default'), '2015-08-31-PREVIEW').tenantId]",
"objectId": "[reference(concat(resourceId('Microsoft.Web/sites', parameters('webAppName')),'/providers/Microsoft.ManagedIdentity/Identities/default'), '2015-08-31-PREVIEW').principalId]",
"permissions": {
"secrets": [
"get",
"list"
]
}
}
]
}
}