Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This article describes how to use an Azure Resource Manager template (ARM Template) to add an external endpoint to an existing Traffic Manager profile.
An Azure Resource Manager template is a JavaScript Object Notation (JSON) file that defines the infrastructure and configuration for your project. The template uses declarative syntax. You describe your intended deployment without writing the sequence of programming commands to create the deployment.
If your environment meets the prerequisites and you're familiar with using ARM templates, select the Deploy to Azure button. The template will open in the Azure portal.
If you don't have an Azure subscription, create a trial subscription before you begin.
An existing Azure Traffic Manager profile. For more information on creating an Azure Traffic Manager profile, see Quickstart: Create a Traffic Manager profile using an ARM template.
The template used in this quickstart is from Azure Quickstart Templates.
{
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"existingTMProfileName": {
"type": "string",
"metadata": {
"description": "Name of the traffic manager profile to add a endpoint to"
}
},
"endpointName": {
"type": "string",
"metadata": {
"description": "Name of the endpoint to add to traffic manager profile"
}
}
},
"variables": {
"endpointStatus": "Enabled",
"endpointMonitorStatus": "Degraded",
"endpointLocation": "chinanorth",
"target": "www.msn.com",
"weight": "3",
"priority": "3"
},
"resources": [
{
"apiVersion": "2018-04-01",
"type": "Microsoft.Network/TrafficManagerProfiles/ExternalEndpoints",
"name": "[concat(parameters('existingTMProfileName'), '/', parameters('endpointName'))]",
"properties": {
"endpointStatus": "[variables('endpointStatus')]",
"endpointLocation": "[variables('endpointLocation')]",
"endpointMonitorStatus": "[variables('endpointMonitorStatus')]",
"target": "[variables('target')]",
"weight": "[variables('weight')]",
"priority":"[variables('priority')]"
}
}
]
}
One Azure resource is defined in the template:
To find more templates that are related to Azure Traffic Manager, see Azure Quickstart Templates.
Select the
Deploy to Azure
to deploy the template on Azure operated by 21Vianet.Note
Templates you downloaded or referenced from the GitHub Repo "azure-quickstart-templates" must be modified in order to fit in the Azure operated by 21Vianet Environment. For example, replace some endpoints -- "blob.core.windows.net" by "blob.core.chinacloudapi.cn", "cloudapp.azure.com" by "cloudapp.chinacloudapi.cn"; change some unsupported Location, VM images, VM sizes, SKU and resource-provider's API Version when necessary.
In this article, select Edit template in Azure portal and replace the value of endpointLocation with actual China region parameters in variables properties, then select Save button.
Enter the values.
The template deployment adds another endpoint based on your inputs to an existing profile.
The resource group name is the existing resource group that contains the existing profile.
Note
existingTMProfileName must match your existing profile name in order for the template to deploy successfully. If deployment fails, start over with Step 1.
It takes a few minutes to deploy the template. When completed, the output is similar to:
Azure PowerShell is used to deploy the template. In addition to Azure PowerShell, you can also use the Azure portal, Azure CLI, and REST API. To learn other deployment methods, see Deploy templates.
Use Get-AzTrafficManagerProfile to verify that another endpoint was added to the profile.
Get-AzTrafficManagerProfile -ResourceGroupName myResourceGroup -Name ExternalEndpointExample | Select Endpoints
The output is similar to:
When you no longer need the Traffic Manager profile, delete the resource group. This command removes the Traffic Manager profile and all the related resources.
To delete the resource group, call the Remove-AzResourceGroup
cmdlet:
Remove-AzResourceGroup -Name <your resource group name>
In this quickstart, you added an endpoint to an existing Traffic Manager profile.
To learn more about routing traffic, continue to the Traffic Manager tutorials.