Azure Traffic Manager Priority Routing | App Services Failover | Step by Step

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video we are going to see how to configure priority routing with azure traffic manager azure traffic manager works by manipulating your dns responses there are six ways for you to configure your azure traffic manager profile and priority routing is one of them if i go here in the documentation they have shown how priority routing works so basically priority routing is not a load balancing methodology it is basically a failover pattern now if you think about geographic routing for example it will route the traffic based on the location of the users let's say if the users are in asia you can direct those users to the instance that you hosted in asia and then you can direct the users let's say u.s to the instance that you hosted in u.s if you configure azure traffic manager to work in geographic routing it will work as a geographical load balancer but if you implement priority routing as your traffic manager will help you to implement failover let's say for example you have primary instance and if something goes wrong in that region that your primary instance is in you want to fail over to another instance you can specify the priority of each of your instances if the primary instance is degraded for some reason as your traffic manager will direct the traffic to your failover instance and when the primary instance is back again as your traffic manager can again direct users to your primary endpoint and one key point here is that beginners misunderstand this sometimes azure traffic manager will not root your traffic through azure traffic manager it will basically send the dns response to the user to contact the failover node and then user's browser will directly connect to that fill our nodes and also when you do this you should be careful about dns time to leave as well because user's browser can cache the dns response from traffic manager now let's implement this on azure for that i have created a script here as you can see first i'm going to deploy a web application in southeast asia region and after that i'm going to deploy another web application in australia's region then i'm going into azure portal to show you how to configure a traffic manager profile now let me copy this script here and then i'm going to paste it on my cli as you can see the resources are getting created the resources are ready now let me go to azure portal as you can see i'm in that resource group and we have two app services and two app service plans and now let me change these app services so that we can see which app service it is because if you just access it they all have this generic page let me change that i'm going into app service editor and then let me change this hey app service developers to australia since this is the app service that i have hosted in australian region now i'm going back let me do that to the southeast asia app service as well all right now i'm going back to the resource group and then i'm going to create the traffic manager profile let me search for traffic manager here we have traffic manager profile going in all right here as you can see we don't have many options we can name it we can give a global unique name and then we can provide the routing method you can change this routing method later as well now let me call it something like this and then a routing method i'm going to go with priority and that is the topic for the day and then the resource group is okay now now if you look here the resource group location it is we can't change it because this is a global resource now let me create it all right deployment is in progress and that's complete i'm going into that resource and now if i go back to the resource group and if i refresh it here let me regroup it yeah as you can see and also we can see the summary view as well we have the load balancer not the load balancer the traffic manager and then we have the app service we have deployed in southeast asia and australia now let me go back to the resource group list view and then i'm going into my traffic manager profile and here if i go into configuration we can change the routing method as well also as i said earlier dns time to leave is important because it will take this number of seconds for the changes that you do to a traffic manager profile to propagate because of the dns cache now let me change this to one second because it is easier for this demo now i'm going into endpoints section i haven't saved it let me save it now i'm going into endpoints section now we can add endpoint so basically we can register our two app services here i'm going to add a new endpoint since this is a azure endpoint we can select that this is not an external or i'm not going to use nested traffic managers here and then i'm going to call it let's see e1 endpoint 1 and then the target resource type is going to be an app service and here we have an option to select the app service the primary endpoint for this demo is going to be southeast asia region and then we have a very important setting here and that is the priority the lesser the value here the more the priority if i put one here this is going to be the highest priority basically if this endpoint works all the traffic from all the users will be directed to this endpoint and if this doesn't work and only if this doesn't work other endpoints will get activated now let me put one here because this is going to be the primary endpoint and let me add this all right as you can see the monitor status is checking endpoint now let me add my second endpoint as well let me call it e 2 and this is going to be an app service and the one in australia as you can see we have two here automatically selected because we have added priority one now if i change this to one as you can see we are getting the message no two endpoints can share the same priority value since we have configured this to be priority based endpoint we can't do it but let's say if you have configured your traffic manager profile to be weighted one you can add the same number here that will equally distribute your traffic now let me add two here because this is not the priority endpoint this is the fellow endpoint now let me add this now let's wait for one or two minutes until this gets updated all right as you can see the monetary statuses are online now now i'm going into the overview section of my traffic manager profile and then i'm going to copy the dns name let me go to a new tab here and let's paste it here as you can see we're getting the response from southeast asia region and remember this is the primary region that we have configured here as you can see now let me go back and let's try to do the same again let's try to access it and copy this and let's access it with a incognito account as you can see we're getting the same response now if i go back i'm going into the resource group and then i'm going to stop the web application that we have in southeast asia to simulate a failover scenario let me do that now as you can see our app is stopped and we have added the dns time to leave as one second now let me go to my incognito browser again let's try to access it as you can see we are getting the response from australia region now let's go back and start the application again and then i'm going back to the incognito browser we are still getting the application from australia region because it can take a few seconds for this setting to get updated even though we have set the time to leave to one second now let's try again as you can see we are getting the response from our primary region in this video we have understood what traffic manager is and the type of routing methods that it has such as geographic routing and we saw how to configure priority based routing and one thing to keep in mind is that this is not a load balancer type of a scenario that we have implemented this is a failover scenario and azure traffic manager is a versatile tool that we can use to do many things now this is the end of the video if you have any further questions or comments let me know down below and don't forget to like this video and subscribe if you learned something new today and thanks for watching
Info
Channel: Meet Kamal Today - Cloud Mastery
Views: 52
Rating: undefined out of 5
Keywords:
Id: zSLWhRebYrc
Channel Id: undefined
Length: 9min 14sec (554 seconds)
Published: Mon Nov 22 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.