How to Set Up Azure Traffic Manager: A Step-by-Step Guide
Last Updated :
22 Aug, 2024
Azure Traffic Manager (ATM) is a powerful Azure service to manage user traffic and distributes it to service endpoints using various routing methods. In this article, I will be guiding you with the process of creating a web app till setting up an Azure Traffic Manager.
Primary Terminologies
- Azure: Azure is a cloud computing platform developed by Microsoft that provides a range of tools and services to help developers build, deploy, and manage applications.
- Azure Endpoint: An Azure service that is exposed to the internet and is responsible for receiving user traffic.
- DNS: It translates readable domain names to IP addresses that a computer can understand.
- Azure Web App: It allows us to build and deploy web apps efficiently.
Prerequisites and Initial Setup
- Login to your Azure portal
- GitHub repository with your web app code
- DNS Zone Creation ( eg- GoDaddy)
Steps to Create and Deploy Scalable Applications on Azure
Step 1: Login into your Azure account
Step 2: Click on Create a resource
Step 3: Click on Web App and fill the details
- Resource Group: (Give any name related to the web app)
- Name: (Give any unique name to the web app , this will be a part of the URL)
- Publish: Code
- Runtime Stack: ASP.NET V4.8
- Sku and size: Free F1 ( you can choose a paid plan too)
Step 4: Click on Review + Create and then click on create again.
Step 5: Click on Go to Resource and then Click on the Azure Cloud Shell logo.
Step 6: Write the Bash Code
git clone <github repository url>git config --global user.email "<your email> "
git config --global user.name "<your name>"
cd <path to the code file>
Step 7: Git Deployment
git init
git add .
git commit -m "<commit message>"
Step 8: Configure App Service
az webapp deployment source config-local-git --name <name of web app> --resource-group <resource group name>
Step 9: Deploy Web App
After running the above command you'll be getting a Json output in which there will be a predefined URL "scmURi:" you have to copy that URL and we will add this as a remote into our local github repository.
git remote add azure '<paste the url here> '
git push azure master
Your code will be deployed and you just have to refresh your web page.
Azure Traffic Manager Routing Methods
- Priority Routing- It has a priority list of service endpoints where the primary service endpoint has the highest priority.
- Weighted Routing - It is used to distribute traffic evenly across a set of endpoints.
- Performance Routing- It is used when we want to improve the response time of applications by routing traffic to the location nearest to the user,
- Geographics Routing- In this the endpoint associated with a traffic manager profile must have a pre defined geographic region assigned to it.
- Multivalue Routing- It returns multiple endpoint for a single query, it can only be set to IPv4/IPv6 addresses as endpoints.
- Subnet Routing- It maps a set of users IP address to a specific endpoint.
Step-by-Step Process to Setup Azure Traffic Manager
Creating a Azure Traffic Manager Profile
Step 1: Login into your Azure portal.
Step 2: Search "Traffic Manager Profile" in the search bar and Click on it.
Step 3: Click on "Create traffic manager profile"
- Name- <Write a unique name>
- Routing method- Priority
- Subscription- Free Trial
- Resource group- Click on Create New and write "My RG"
- Resource group location- Central US
- Click on Create (at bottom left corner)
Deploying DNS
Step 1: Search "DNS Zones" in the search bar and Click on it.
Step 2: Click on Create DNS
- Subscription- Free Trial
- Resource group- MyRG (you had created this above)
- Name - <Write any name>.com example-gfgexample.com
- Resource group location- Central US
- Click on "Review+Create"
Register a DNS
Step 1: Go to GoDaddy or a similar website.
Step 2: Click on your Profile Name> Manage Domains
Step 3: Click on DNS > Manage Zones
Step 4: Search for the Domain Name you wrote while Deploying DNS example- gfgexample.com
Step 5: Scroll down to find Nameservers and Click on Changes
Step 6: Open Azure Portal > Overview
Step 7: Copy Name Server 1 and paste it in GoDaddy NameServers (Step5) similarly for Name server 2
- Make sure you remove the dot in the end while pasting a name server
Step 8: Click on Save and with that we have created two Virtual Machines (Endpoint).
Configuring Traffic Routing Methods
Step 1: Search "Virtual Machine" in the search bar and Click on it.
Step 2: Click on VM1 and then Click on Networking.
Step 3: Click NIC Public IP address.
Step 4: Click on Configure.
Step 5: Write a Unique name in DNS name label and Click on Save.
Step 6: Follow the same steps to configure the other Virtual Machines on public IP address.
Adding Endpoints to Your Traffic Manager Profile
Step 1: Search "Traffic Manager Profile" in the search bar and Click on it.
Step 2: Click on the Traffic Manager Profile you created above.
Step 3: Click on Endpoint and Click on Add.
- Type: Azure endpoint
- Name: VM1
- Target resource type: Public IP address
- Public IP address: (Select VM1 from dropbox)
- Priority: 1
Step 4: Click on Save and Follow the same steps to add the second endpoint.
- Type: Azure endpoint
- Name: VM2
- Target resource type: Public IP address
- Public IP address: (Select VM2 from dropbox)
- Priority: 2
Creating a DNS Record
Step 1: Search "Traffic Manager Profile" in the search bar and Click on it.
Step 2: Click on the Traffic Manager Profile you created above.
Step 3: Click on Overview and Copy the DNS name.
Step 4: Search for "DNS Zone" in the search bar.
Step 5: Click on the DNS Zone you've created and Click on Record set.
Step 6: Fill in the Details in Record Set.
- Name: www
- Type: CNAME
- Alias Record set: No
- TTL: 1
- TTL unit: Hours
- Alias: <Paste Copied DNS Name> (Remove "https://" if shows an error message)
Step 7: Click on OK and the whole process is complete and ready to work.
Similar Reads
How to Set up Azure API Management?
Azure API Management is a totally controlled organization provided by Microsoft that allows you to create, put up, and manage APIs (Application Programming Interfaces) in your packages. It gives a scalable and regular way to reveal your APIs to outside builders, partners, and customers, and allows y
11 min read
How to Use Azure Traffic Manager to Manage Your Domain Names?
In the modern-day digital landscape, managing domain names and ensuring the high availability and performance of your web programs is paramount. Azure Traffic Manager is a powerful Azure service that allows you to gain this goal by intelligently routing site visitors across multiple endpoints, impro
6 min read
How to Store and Manage Passwords By Using Azure Key Vault?
Azure key vault is one of the Microsoft Azure offered services that enables users to easily store and manage sensitive information like keys, passwords, and certificates in a way that is easily accessible to authorized users and applications (RBAC). Azure key vault can be easily integrated with othe
6 min read
How to Set up Azure Site Recovery?
Azure Site Recovery is a service provided by Microsoft Azure that contributes to an organization's business continuity and disaster recovery (BCDR) strategy. It ensures that business-critical applications and workloads remain operational during both planned and unplanned outages. What are the Compon
7 min read
Deploying a Web App on Azure App Service: Step-by-Step Guide
Azure is the Cloud computing platform and Suite of cloud services provided by Microsoft. Azure provides various services including building and deploying web apps, logic apps, configuring databases, etc. In this article, let us understand how to deploy a web app on Azure app service. Deploying a Web
5 min read
How To Set Up Azure Event Grid?
Event Grid is like a notification service that lets different computer programs (like apps or services) talk to each other and send messages when something happens. It can be used when you want to automatically trigger a reaction in one program based on something happening in another program. Azure
7 min read
How to Create Management Groups in Azure Through GUI and PowerShell?
Pre-requisites: AZURE Azure's management groups are a hierarchical organizational structure that makes it possible to centralize the management of numerous Azure subscriptions. With management groups, you can apply policies and enforce compliance across your subscriptions and resources, making it ea
3 min read
How to Deploy React App on Azure Virtual Machines?
In this article, we will study how we can deploy our existing React web application to Azure VM on Ubuntu Server. We will also see how to use the public IP of the Azure VM to access the React application using Nginx. For this article, you should know about setting up a VM in Azure. We will see how t
5 min read
How to Change Virtual Network/Subnet in Azure VM
Before diving into how to change a VM's subnet, let's understand what a subnet is. Subnet Definition: A subnet, also known as a subnetwork, is a segmented portion of a larger virtual network. It allows you to divide your Azure network into smaller, more manageable sections. This approach enhances ne
5 min read
Microsoft Azure - Using Azure Resource Manager
In this article, let us examine how to use Azure Resource Manager(ARM). Microsoft Azure came up with the latest service that deploys & manages the development work through the code. We might have heard of IaaS, SaaS, PaaS. Similarly, Microsoft Azure introduced IaaC(Infrastructure as a Code), whi
4 min read