Tuesday, June 21, 2016

Implementation of Azure Traffic Manager

Azure Traffic Manager allows to control distribution of traffic to specified end points. These end points include Azure websites and cloud services.

Traffic Manager improves availability of critical applications, responsiveness of the applications, can help in maintenance of a service without downtime, and traffic distribution based on certain configuration thats set up.

Implementation of Traffic Manager

1 - Log on to Azure Portal
2 - Click Traffic Manager , and Add New as shown below

                                                                  


      

3-  In the Quick Create box, as shown below there are 3 options of Load Balancing viz. Performance (default) , Round Robin or FailOver. Select the default "Performance" option, later on we can change it as required. The performance option ensures the load is equally distributed to the Traffic Manager endpoints
                                                                 


The Round robin ensure requests are hit to the endpoints alternatively where as the failover option ensures if the first end point goes down then the second one handles all the requests.

4- Put a name for your Traffic Manager and click Create


Configuration of Traffic Manager

Once the traffic Manager is created, you need to configure it. Click the traffic manager created. Click on the "EndPoints" tab to add the endpoints
                                                                           

Select either cloud service or Azure website as end point. Here I am adding cloudservice as endpoints taking an MVC website as an example.

Once you add the EndPoints, Azure gets the status of end points.  The status of the traffic manager would be degraded one.

To get this online, you would need to do more two things. The first one being, add a simple html file (e.g. probe.html) at the root of the website. This would return status code as 200.  Ensure this file can be anonymously accessed. The second one, add a negate entry in the web.config as follows

  <conditions>
            <add input="{HTTP_HOST}" matchType="Pattern" pattern="^xxxx.cloudapp.net$" negate="true" />
          </conditions>

After doing above, you would see the status of the traffic manager as "online". The probe.html could be advanced by writing custom code e.g. to check DB connection ,etc & then return the status code.

                                                                        



No comments: