You are on page 1of 6

AzureCon Challenge.

Implementing Traffic Manager


Overview
In todays world, being able to deliver lightning fast content and applications is everything. The Traffic Manager Service allows you to build policies around
routing between Azure data centers. For example, we could deploy to Web Apps to the West US datacenter and to the East US datacenter and can then
route between them using the Traffic Manager. We can apply one of several types of scheduling algorithm which would enable our users in New York to be
routed to the East US datacenter and our users in Seattle to the West US. The Traffic Manager Service also supports failover scenarios where one datacenter
is unavailable. If this should happen to the West US datacenter then all of the Seattle traffic will be routed to the East US datacenter.
In this challenge well look at building an international footprint with the Traffic Manager Service between Europe and the United States.

1. Login to Azure
For this challenge, you have either elected to use your own subscription or have created a new Azure
subscription using the provided Azure Pass (or Free Trial). If you want to switch to use the provided Azure
Pass the promotion code is displayed on the My Account page on the http://challenge.azurecon.com web
site. If there is no promo code displayed, you will need to use the free trial http://azure.microsoft.com/pricing/free-trial.
Azure has TWO management portals - the classic portal (http://manage.windowsazure.com) and a new
portal that is in Preview at http://portal.azure.com. You will use BOTH the Preview portal and the Classic
Portal in this challenge.
1.

Open a browser and go to http://portal.azure.com

2.

Enter your Microsoft Account email address and password for the Microsoft Account you
associated with your Azure Pass or your own subscription.

3.

You will now be in your Azure subscription (see opposite) and from here you can create and
manage Azure services.

2. Provision your first Web Site.


1.

SWITCH to the Azure Preview Portal

2.

In the portal click +NEW, Web + Mobile, Web App

3.

In the Web App, you have to enter a unique name. Append 1 to the name, to make it easier later.

4.

In the CREATE NEW APPSERVICE PLAN box, enter mywebaptm1. An App Service plan is a unit of billing and scaling of resources to support all
of the app services within a single plan, which gives you flexibility to change and scale things independently.

5.

For LOCATION pick any location.

6.

For Resource Group, enter mywebrgtm1.

7.

Click CREATE. Your web app will provision and be ready in less than 60 seconds.

Page | 1

8.

Click the BROWSE button at the top of your web app blade. A new browser tab opens, connecting to your public app URL which will be
something like <your Web App name>.azurewebsites.net and a default HTML page is displayed for you.

9.

Dont close this new browser tab, switch back to your Web App blade in the Portal.

10.

In the top panel, click the Tools link, click EXTENSIONS and on the Installed web app extensions blade, click Add

11.

You need to choose an extension first SELECT Visual Studio Online and then click the OK button to Accept Legal Terms and then OK again on
the Add web app extension blade. After a few seconds, you will see the extension appear in your list of installed extensions.

12.

Click the Visual Studio Online extension and then click the BROWSE button. A new browser opens and after 10-20 seconds you will see the
Visual Studio Online Monaco code editor we will refer to this as Monaco. This is a lightweight, simple code editor integrated right into the
Portal. At the top left, you will see the only file on your web server hostingstart.html this is that blue getting started page you browsed to.

3. Personalize your Web Site


Now you need some form of web application that will display some content. Lets build a simple app to do this
1.

In the Monaco editor, right click the hostingstart.html file and select DELETE and OK.

2.

Click the WWWROOT, and then click the New Document icon

3.

In the name text box, enter default.html (it is important you call it exactly this..!)

4.

You web page for your video will be pretty simple. Copy/Paste in this code into the code window and replace {location} with the location you
chose for your WebApp in the previous task:
<!DOCTYPE html>
<html>
<head>
<title>Microsoft Azure Web App {location}</title>
</head>
<body>
<h1>Microsoft Azure Web App - {location}</h1>
</body>
</html>

Page | 2

5.

In Monaco, click the RUN button on the left nav (looks like a Play icon). This will launch a new browser window and your page will be shown!

4. Provision your second Web Site


1.

2.

Repeat tasks 2 to create a new web site using 2 as a suffix instead of 1 and choose a different location that the one you choose previously. So if
your login was aztrainpass02730@outlook.com, you would use following values for your website:
a.

Web app: same name but with 2 at the end instead of 1

b.

App Service plan: mywebaptm2

c.

Resource Group: mywebrgtm2

d.

Location: It should be different than the previously chosen location.

Repeat task 3 to Personalize your new web site, replacing {location} in the default.html with the one you chose in the previous step.

Now you have two identical web sites in two different regions. Next, we will configure them to be used by the Traffic Manager.

5. Configure Traffic Manager


In this task we are going to configure Traffic Manager in Failover mode to make sure that if one instance of our application is down the other one will take
over the workload.
1.

SWITCH to the Azure Classic Portal (you will already have this in one of your browser tabs)

2.

Click NEW, NETWORK SERVICES, TRAFFIC MANAGER, and then click QUICK CREATE.

Page | 3

3.

In the DNS Prefix, you have to enter a unique name so a suggestion is to use the name you choose for your web app (without the 1) + tm. Make
sure you get a confirmation tick in the DNS Prefix text box.

4.

For the Load Balancing Method choose Failover, and press the Create button.

5.

The Traffic Manager will be created in an Inactive state, as you havent configure it yet.

6.

Press the arrow next to the Profile Name in order to configure it.

7.

In the Traffic manager tab, press Endpoints and then the Add Endpoints link (or the plus sign at the bottom of the page).

8.

On the Add Service Endpoints blade change the Service Type to Web App, and then select the two Web apps created in the previous tasks.

9.

Please take note of the Warning at the top of the page, and then press the check mark to add the Endpoints.

10.

Go to the Configure tab of the Traffic Manager and change the DNS Time to Live (TTL) to 30 seconds. Note as well the order of the Web Apps on
the Failover Priority List. If you like you can change the order of the apps on the list.

Page | 4

6. Testing the configuration


On this task we will test the configuration and make sure that it works.
1.

Open a new In-Private window and navigate to the Traffic Manager DNS name. So if your login was aztrainpass02730@outlook.com, this would be
az02730tm.trafficmanager.net.

2.

Make sure that the output corresponds to the output of the site on top of your priority list. In this example this is Microsoft Azure Web App - West
US.

3.

Close the In-private window.

4.

On the Azure Classic Portal go back to the Endpoints, select the entry corresponding to the Web app on top of your Failover priority list, and press
the Disable button at the bottom of the page.

5.

Wait for at least 30 seconds (or the time you specified on the TTL).

6.

Repeat Step 2.

7.

The output should now correspond to the output of the second site on your priority list. In our example this is Microsoft Azure Web App - West
Europe. If the output is not thee correct one, continue to read.

8.

Close the In-private window.

9.

If the output is still the one from step 2, you will have to Open a command prompt window As Administrator, and run the following command:
ipconfig /flushdns.

Page | 5

10.

Repeat step 7.

--- END OF LAB --Go back to the AzureCon Challenge web site (http://challenge.azurecon.com) and complete the challenge question to get your points.
REMEMBER: You only have one chance at the question, make sure you really know the answer!

Page | 6

You might also like